The SommelierStEthDepositTurboStEthStrategy contract is a specialized strategy that supplies an underlying token into a generic Sommelier Vault to earn yield. It handles conversions between ETH and stETH using Curve pools.
Constants
addresspublicconstant stEth = STETH_MAINNET;// Ethereum mainnet's StETH TokenICurveLpPool publicconstant pool =ICurveLpPool(CURVE_ETH_STETH_POOL_MAINNET);// Curve ETH-stETH pool
State Variables
No additional state variables beyond those inherited from BaseSommelierStrategy.
Functions
Constructor
constructor() initializer
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
_cellar: Sommelier Turbo-stETH cellar address
Core Functions
liquidateExact
Withdraws exactly amountNeeded to vault.
Parameters:
amountNeeded: Amount to withdraw
Returns:
loss: Amount of realized loss
View Functions
previewLiquidate
Simulates withdrawal including potential losses.
Parameters:
requestedAmount: Amount requested to withdraw
Returns:
liquidatedAmount: Expected output amount
previewLiquidateExact
Calculates required input for exact output.
Parameters:
liquidatedAmount: Desired output amount
Returns:
requestedAmount: Required input amount
maxLiquidate
Returns maximum withdrawable amount after losses.
Returns:
Maximum withdrawable amount
maxLiquidateExact
Returns maximum withdrawable amount before losses.
Returns:
Maximum withdrawable amount before losses
Internal Core Functions
_adjustPosition
Adjusts strategy positions based on available capital.
Parameters:
minOutputAfterInvestment: Minimum expected output
_invest
Invests assets into Cellar Vault through stETH conversion.
Parameters:
amount: Amount to invest
minOutputAfterInvestment: Minimum expected shares
Returns:
depositedAmount: Amount of tokens received
_divest
Withdraws assets from Cellar Vault and converts back to ETH.