YearnAjnaWETHStakingStrategy
Overview
The YearnAjnaWETHStakingStrategy contract is a strategy that supplies WETH into a Yearn V3 Vault and stakes the vault shares to earn additional AJNA rewards. It manages the conversion of AJNA rewards back to WETH through Uniswap V3.
Constants
State Variables
Functions
Constructor
Empty constructor marked as initializer.
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 V3 vault address
Core Functions
liquidateExact
Withdraws exact amount to vault and re-stakes any remaining shares.
Parameters:
amountNeeded
: Amount to withdraw
Returns:
loss
: Amount of realized loss
Internal Core Functions
_beforePrepareReturn
Claims and processes staking rewards before preparing return.
_invest
Invests assets and stakes the received shares.
Parameters:
amount
: Amount to investminOutputAfterInvestment
: Minimum expected shares
Returns:
depositedAmount
: Amount of tokens received
_divest
Unstakes and withdraws assets from vault.
Parameters:
shares
: Amount of shares to withdraw
Returns:
withdrawn
: Amount of assets received
_liquidatePosition
Liquidates position up to requested amount.
Parameters:
amountNeeded
: Amount to liquidate
Returns:
liquidatedAmount
: Amount actually liquidatedloss
: Amount of losses incurred
_unwindRewards
Claims AJNA rewards and converts them to WETH.
Parameters:
_yearnStakingRewards
: Staking rewards contract
Internal View Functions
_ajnaBalance
Returns strategy's AJNA token balance.
Returns:
Current AJNA balance
_shareBalance
Returns strategy's staked vault share balance.
Returns:
Current staked share balance
Last updated