BeefyUSDCeDAIStrategy
Overview
The BeefyUSDCeDAIStrategy contract is a sophisticated strategy that manages USDCe-DAI positions through Gamma's Hypervisor (concentrated liquidity positions) and stakes them in a Beefy Vault. It handles complex liquidity calculations and token conversions through Curve's AtriCrypto zapper.
Constants
State Variables
Functions
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_uniProxy
: Gamma's UniProxy contract_hypervisor
: Gamma's Hypervisor contract_beefyVault
: Beefy vault address
Core Functions
calculateUSDCeToSwap
Calculates optimal USDCe amount to swap for balanced liquidity provision.
Parameters:
totalUSDCe
: Total USDCe amountratio
: Target ratio
Returns:
Amount of USDCe to swap
_invest
Complex investment process:
Calculates optimal token ratio
Swaps portion of USDCe to DAI
Deposits into Gamma Hypervisor
Stakes LP tokens in Beefy
Parameters:
amount
: Amount to investminOutputAfterInvestment
: Minimum expected shares
Returns:
Amount of shares received
_divest
Withdrawal process:
Withdraws from Beefy
Removes liquidity from Hypervisor
Converts tokens back to USDCe
Parameters:
amount
: Amount of Beefy shares to divest
Returns:
Amount of USDCe received
Internal View Functions
_shareValue
Calculates underlying value including:
Base and limit range positions
Unused token balances
Fee accumulation
_sharesForAmount
Calculates shares for amount considering:
Current token ratios
Liquidity distribution
Price calculations
_convertUsdceToDai
Calculates DAI equivalent of USDCe amount.
Gamma Helper Functions
computeLiquidityFromShares
Calculates liquidity amount for given share position.
getPositionInfo
Retrieves position information including:
Current liquidity
Accumulated fees
_CalcBurnLiquidity
Calculates token amounts from burning liquidity position.
Last updated