IStrategy
Title: IStrategy
Author: Vendored minimal subset of Yearn V3 (https://github.com/yearn/tokenized-strategy/blob/master/src/interfaces/ITokenizedStrategy.sol).
Upstream license: AGPL-3.0.
Minimal interface for an external yield strategy managed by a StrategyManager.
Strategies are trusted external contracts that accept asset deposits and report
their current managed balance. The vault PUSHES assets to a strategy via a direct
ERC-20 transfer; the strategy PULLS assets back to the vault via withdraw.
Functions
asset
Returns the address of the underlying asset this strategy manages.
function asset() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
totalAssetsManaged
Returns the current total asset balance managed by this strategy.
This value is trusted by the StrategyManager and VaultCore for accounting. Strategy implementations MUST report accurate balances to avoid mispricing vault shares.
function totalAssetsManaged() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
withdraw
Withdraws amount of the underlying asset to to.
Called by the StrategyManager during rebalancing to recall excess allocations. The strategy is responsible for executing the ERC-20 transfer.
function withdraw(uint256 amount, address to) external returns (uint256 withdrawn);Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | Amount of underlying asset to withdraw. |
| to | address | Recipient address (typically the vault). |
Returns
| Name | Type | Description |
|---|---|---|
| withdrawn | uint256 | Actual amount transferred (may be less if strategy has slippage). |