🐸
maxAPY for Devs
  • maxAPY ERC7540
    • MetaVault
      • Introduction
      • Architecture
      • Core Operations
      • State Management & Operations
      • Asset Management
      • Settlement Mechanics
      • Withdrawal Queue Mechanics
      • Deployed Addresses
  • Periphery
    • Hurdle Rate Oracle
    • SharePriceOracle
    • Deployed Addresses
  • maxAPY ERC4626
    • Introduction
    • Architecture
    • Vault
      • MaxApyFactory
      • MaxApyRouter
      • MaxApyVault
    • Periphery
      • MaxApyHarvester
    • Base Strategies
      • BaseStrategy
      • BaseSommelierStrategy
      • BaseYearnV3Strategy
      • BaseYearnV2Strategy
      • BaseConvexStrategy
      • BaseConvexStrategyPolygon
      • BaseBeefyStrategy
      • BaseHopStrategy
      • BaseBeefyCurveStrategy
    • Strategies
      • Ethereum - WETH
        • Convex
          • ConvexdETHFrxETHStrategy
        • Sommelier
          • SommelierMorphoEthMaximizerStrategy
          • SommelierStEthDepositTurboStEthStrategy
          • SommelierTurboDivEthStrategy
          • SommelierTurboEEthV2Strategy
          • SommelierTurboEthXStrategy
          • SommelierTurboEzEthStrategy
          • SommelierTurboRsEthStrategy
          • SommelierTurboStEthStrategy
          • SommelierTurboSwEthStrategy
        • Yearn
          • YearnAaveV3WETHLenderStrategy
          • YearnAjnaWETHStakingStrategy
          • YearnCompoundV3WETHLenderStrategy
          • YearnV3WETH2Strategy
          • YearnV3WETHStrategy
          • YearnWETHStrategy
      • Ethereum - USDC
        • Convex
          • ConvexCrvUSDWethCollateralStrategy
        • Sommelier
          • SommelierTurboGHOStrategy
        • Yearn
          • YearnAjnaDAIStakingStrategy
          • YearnDAIStrategy
          • YearnLUSDStrategy
          • YearnUSDCStrategy
          • YearnUSDTStrategy
      • Polygon - WETH
        • Hop
          • HopETHStrategy
      • Polygon - USDC.e
        • Convex
          • ConvexUSDCCrvUSDStrategy
          • ConvexUSDTCrvUSDStrategy
        • Beefy
          • BeefyCrvUSDUSDCeStrategy
          • BeefyMaiUSDCeStrategy
          • BeefyUSDCeDAIStrategy
        • Yearn
          • YearnAaveV3USDTLenderStrategy
          • YearnAjnaUSDCStrategy
          • YearnCompoundUSDCeLenderStrategy
          • YearnDAILenderStrategy
          • YearnDAIStrategy
          • YearnMaticUSDCStakingStrategy
          • YearnUSDCeLenderStrategy
          • YearnUSDCeStrategy
          • YearnUSDTStrategy
    • Subgraph
      • Overview
      • Schema
      • Query Guide
Powered by GitBook
On this page
  • Overview
  • Constants
  • State Variables
  • Functions
  • Constructor
  • Initialization Functions
  • initialize
  • Core Functions
  • liquidateExact
  • View Functions
  • previewLiquidate
  • previewLiquidateExact
  • maxLiquidate
  • maxLiquidateExact
  • Internal Core Functions
  • _adjustPosition
  • _invest
  • _divest
  • Receive Function
  1. maxAPY ERC4626
  2. Strategies
  3. Ethereum - WETH
  4. Sommelier

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 pool

State Variables

No additional state variables beyond those inherited from BaseSommelierStrategy.

Functions

Constructor

constructor() initializer

Empty constructor marked as initializer.

Initialization Functions

initialize

function initialize(
    IMaxApyVault _vault,
    address[] calldata _keepers,
    bytes32 _strategyName,
    address _strategist,
    ICellar _cellar
) public override initializer

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

function liquidateExact(uint256 amountNeeded) external override checkRoles(VAULT_ROLE) returns (uint256 loss)

Withdraws exactly amountNeeded to vault.

Parameters:

  • amountNeeded: Amount to withdraw

Returns:

  • loss: Amount of realized loss

View Functions

previewLiquidate

function previewLiquidate(uint256 requestedAmount) public view override returns (uint256 liquidatedAmount)

Simulates withdrawal including potential losses.

Parameters:

  • requestedAmount: Amount requested to withdraw

Returns:

  • liquidatedAmount: Expected output amount

previewLiquidateExact

function previewLiquidateExact(uint256 liquidatedAmount) public view override returns (uint256 requestedAmount)

Calculates required input for exact output.

Parameters:

  • liquidatedAmount: Desired output amount

Returns:

  • requestedAmount: Required input amount

maxLiquidate

function maxLiquidate() public view override returns (uint256)

Returns maximum withdrawable amount after losses.

Returns:

  • Maximum withdrawable amount

maxLiquidateExact

function maxLiquidateExact() public view override returns (uint256)

Returns maximum withdrawable amount before losses.

Returns:

  • Maximum withdrawable amount before losses

Internal Core Functions

_adjustPosition

function _adjustPosition(uint256, uint256 minOutputAfterInvestment) internal override

Adjusts strategy positions based on available capital.

Parameters:

  • minOutputAfterInvestment: Minimum expected output

_invest

function _invest(uint256 amount, uint256 minOutputAfterInvestment) internal override returns (uint256 depositedAmount)

Invests assets into Cellar Vault through stETH conversion.

Parameters:

  • amount: Amount to invest

  • minOutputAfterInvestment: Minimum expected shares

Returns:

  • depositedAmount: Amount of tokens received

_divest

function _divest(uint256 shares) internal override returns (uint256 withdrawn)

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

receive() external payable

Allows contract to receive native ETH.

PreviousSommelierMorphoEthMaximizerStrategyNextSommelierTurboDivEthStrategy

Last updated 6 months ago