Section 15 of 18

Build
+20 Lynx

BaseStrategy: harvest, tend, and the Realize-Report-Reinvest Cycle

What You Are Building

The strategy-side counterpart to the vault's report(). StrategyHarvest extends BaseStrategy (section 8) and adds the periodic cycle that closes the loop between strategy state and vault accounting:

  1. Read what the vault wants back.
  2. Realize the strategy's P&L.
  3. Call vault.report() to settle.
  4. Reinvest whatever underlying is left in the strategy.

The keeper bot calls harvest() on a cadence picked by the strategist via harvestTrigger(). Yearn keepers across mainnet harvest strategies many times per day.

Your Code

Solution.sol
Solidity
Loading editor...

Requirements

Write your implementation, then click Run Tests. Tests execute on the server.

Sign up free — keep reading + earn 20 Lynx

Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.

Sign up free to continue

Already have an account? Log in