For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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

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

Calculates expected output for withdrawal through both Beefy and Curve.

Parameters:

  • requestedAmount: Amount requested to withdraw

Returns:

  • Expected liquidated amount

Internal View Functions

_shareValue

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

Parameters:

  • shares: Amount of Beefy shares

Returns:

  • Underlying asset value

_sharesForAmount

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

Parameters:

  • amount: Amount of underlying assets

Returns:

  • Required Beefy shares

_lpPrice

Returns estimated price of Curve LP token.

Returns:

  • LP token price

Last updated