Skip to content
Lattice

IStrategy

Git Source

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

NameTypeDescription
<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

NameTypeDescription
<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

NameTypeDescription
amountuint256Amount of underlying asset to withdraw.
toaddressRecipient address (typically the vault).

Returns

NameTypeDescription
withdrawnuint256Actual amount transferred (may be less if strategy has slippage).