🐸
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
  • State Variables
  • Functions
  • Initialization Functions
  • initialize
  • Core Functions
  • _invest
  • _divest
  • View Functions
  • previewLiquidate
  • Internal View Functions
  • _shareValue
  • _sharesForAmount
  • _lpPrice
  1. maxAPY ERC4626
  2. Base Strategies

BaseBeefyCurveStrategy

Overview

The BaseBeefyCurveStrategy contract extends BaseBeefyStrategy to provide functionality for strategies that interact with both Beefy Finance and Curve protocols. It supplies underlying tokens into a Curve pool, then deposits the Curve LP tokens into a Beefy vault for additional yield.

State Variables

ICurveLpPool public curveLpPool;     // Main Curve pool for this strategy

Functions

Initialization Functions

initialize

function initialize(
    IMaxApyVault _vault,
    address[] calldata _keepers,
    bytes32 _strategyName,
    address _strategist,
    ICurveLpPool _curveLpPool,
    IBeefyVault _beefyVault
) public virtual initializer

Initializes the strategy with Curve and Beefy components.

Parameters:

  • _vault: MaxApy vault address

  • _keepers: Array of keeper addresses

  • _strategyName: Name of the strategy

  • _strategist: Strategist address

  • _curveLpPool: Curve LP pool address

  • _beefyVault: Beefy vault address

Core Functions

_invest

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

Invests assets by adding liquidity to Curve and depositing LP tokens to Beefy.

Parameters:

  • amount: Amount to invest

  • minOutputAfterInvestment: Minimum expected Beefy shares

Returns:

  • Amount of Beefy shares received

_divest

function _divest(uint256 amount) internal virtual override returns (uint256)

Withdraws assets from Beefy and removes liquidity from Curve.

Parameters:

  • amount: Amount of Beefy shares to withdraw

Returns:

  • Amount of underlying assets received

View Functions

previewLiquidate

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

Calculates expected output for withdrawal through both Beefy and Curve.

Parameters:

  • requestedAmount: Amount requested to withdraw

Returns:

  • Expected liquidated amount

Internal View Functions

_shareValue

function _shareValue(uint256 shares) internal view virtual override returns (uint256)

Calculates underlying value of shares considering both Beefy and Curve conversion.

Parameters:

  • shares: Amount of Beefy shares

Returns:

  • Underlying asset value

_sharesForAmount

function _sharesForAmount(uint256 amount) internal view virtual override returns (uint256)

Calculates Beefy shares needed for given amount, considering Curve conversion.

Parameters:

  • amount: Amount of underlying assets

Returns:

  • Required Beefy shares

_lpPrice

function _lpPrice() internal view returns (uint256)

Returns estimated price of Curve LP token.

Returns:

  • LP token price

PreviousBaseHopStrategyNextStrategies

Last updated 6 months ago