YearnDAIStrategy
Overview
The YearnDAIStrategy contract is a strategy that supplies DAI into a Yearn V2 Vault to earn yield. It handles conversions between the underlying asset and DAI through Curve's 3pool.
Constants
Functions
Initialization Functions
initialize
Initializes the strategy with required components.
Parameters:
_vault
: MaxApy vault address_keepers
: Array of keeper addresses_strategyName
: Name of the strategy_strategist
: Strategist address_yVault
: Yearn V2 vault address
Internal Core Functions
_invest
Invests assets by:
Swapping underlying to DAI through Curve
Depositing DAI into Yearn vault
Parameters:
amount
: Amount to investminOutputAfterInvestment
: Minimum expected shares
Returns:
depositedAmount
: Amount of tokens received
_divest
Withdraws assets by:
Withdrawing DAI from Yearn vault
Swapping DAI to underlying through Curve
Parameters:
shares
: Amount of shares to withdraw
Returns:
withdrawn
: Amount of assets received
Internal View Functions
_shareValue
Calculates underlying value of shares including Curve conversion rate.
Parameters:
shares
: Share amount
Returns:
Underlying value
_sharesForAmount
Calculates shares needed for amount including Curve conversion rate.
Parameters:
amount
: Asset amount
Returns:
Required shares
Key Features:
Uses Curve's 3pool for token conversions
Sets 1M DAI maximum trade size
Sets minimum trade size to 0.01 token units
Handles token conversions during deposits and withdrawals
Last updated