SommelierStEthDepositTurboStEthStrategy
Overview
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
address public constant stEth = STETH_MAINNET; // Ethereum mainnet's StETH Token
ICurveLpPool public constant pool = ICurveLpPool(CURVE_ETH_STETH_POOL_MAINNET); // Curve ETH-stETH poolState Variables
No additional state variables beyond those inherited from BaseSommelierStrategy.
Functions
Constructor
constructor() initializerEmpty 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 investminOutputAfterInvestment: Minimum expected shares
Returns:
depositedAmount: Amount of tokens received
_divest
Withdraws assets from Cellar Vault and converts back to ETH.
Parameters:
shares: Amount of shares to withdraw
Returns:
withdrawn: Amount of assets received
Receive Function
Allows contract to receive native ETH.
Last updated