ConvexUSDTCrvUSDStrategy

Overview

The ConvexUSDTCrvUSDStrategy contract is a strategy that supplies USDT into the crvUSD-USDT pool in Curve on Polygon, then stakes the curve LP tokens in Convex to maximize yield. It manages conversions between USDT and other tokens using Curve's AtriCrypto zapper.

Constants

address public constant crvUsd = CRV_USD_POLYGON;                                 // CRVUSD token address
address public constant wpol = WPOL_POLYGON;                                      // Wrapped MATIC address
address public constant crv = CRV_POLYGON;                                        // CRV token address
address public constant usdt = USDT_POLYGON;                                      // USDT token address
uint256 public constant CRVUSD_USDT_CONVEX_POOL_ID = CRVUSD_USDT_CONVEX_POOL_ID_POLYGON;  // Convex pool ID
IConvexBoosterPolygon public constant convexBooster = IConvexBoosterPolygon(CONVEX_BOOSTER_POLYGON);  // Convex booster
ICurveAtriCryptoZapper constant zapper = ICurveAtriCryptoZapper(CURVE_AAVE_ATRICRYPTO_ZAPPER_POLYGON);  // Curve zapper

State Variables

IRouter public router;                           // Router for swaps
ICurveLpPool public curveLpPool;                // Main Curve pool

Functions

Initialization Functions

constructor

Empty constructor marked as initializer.

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

  • _curveLpPool: Curve LP pool address

  • _router: Router address for swaps

Core Functions

_invest

Invests assets through:

  1. Converting USDCe to USDT via zapper

  2. Adding USDT to crvUSD-USDT pool

  3. Staking LP tokens in Convex

Parameters:

  • amount: Amount to invest

  • minOutputAfterInvestment: Minimum expected LP tokens

Returns:

  • Amount of tokens received

_divest

Withdraws assets through:

  1. Withdrawing from Convex

  2. Removing liquidity from Curve

  3. Converting USDT to USDCe via zapper

Parameters:

  • amount: LP tokens to divest

Returns:

  • Amount received after withdrawals and conversions

_unwindRewards

Claims and converts rewards:

  1. Claims CRV rewards

  2. Swaps CRV through multiple hops

  3. Converts crvUSD through Curve pool

Parameters:

  • rewardPool: Convex rewards pool

Internal View Functions

_convertUsdtToUsdce

Converts USDT to USDCe using zapper.

Parameters:

  • usdtAmount: USDT amount

Returns:

  • Equivalent USDCe amount

_convertUsdceToUsdt

Converts USDCe to USDT using zapper.

Parameters:

  • usdceAmount: USDCe amount

Returns:

  • Equivalent USDT amount

_lpValue

Calculates underlying value of LP tokens.

Parameters:

  • lp: LP token amount

Returns:

  • USDCe value

_lpForAmount

Calculates LP tokens needed for amount.

Parameters:

  • amount: USDCe amount

Returns:

  • Required LP tokens

_estimatedTotalAssets

Calculates total strategy value including conversions.

Returns:

  • Total value in USDCe

_lpPrice

Returns Curve LP token price.

_crv

Returns CRV token address.

_crvUsdBalance

Returns strategy's crvUSD balance.

_simulateHarvest

Simulates harvest operation and reverts with simulation data.

Last updated