Skip to main content
Yield optimizer for Curve Finance LP tokens. Deposit Curve LP tokens to earn boosted CRV rewards plus CVX incentives without needing to lock CRV.

What it offers

  • deposit: Deposit Curve LP tokens into Convex pool (with auto-staking)
  • withdraw: Withdraw Curve LP tokens from Convex pool
  • getReward: Claim accumulated CRV + CVX + extra rewards

Notes

  • Pool IDs (pid) are sequential integers
  • Third param in deposit = auto-stake in reward pool (always pass true for yield)
  • Each pool has its own BaseRewardPool contract (get from poolInfo.crvRewards)
  • Approve Curve LP token to Booster before depositing
  • getReward with claimExtras=true claims CRV + CVX + any extra reward tokens

Its names in a program

On Ethereum, Convex is a namespace: its contracts need no import.

Deployments

ABI

Where a line says what an address it returns is, a program that calls the function through its namespace calls that contract’s methods on the result directly: <Namespace>.<Contract>.<function>(...).<method>(...). A token’s methods are the ERC-20 functions, and its writes are SafeERC20.

BaseRewardPoolABI

import BaseRewardPoolABI from "./protocols/convex/BaseRewardPoolABI.json";
  • getReward(address _account, bool _claimExtras) returns (bool)
  • earned(address account) view returns (uint256)
  • balanceOf(address account) view returns (uint256)
  • withdrawAndUnwrap(uint256 amount, bool claim) returns (bool)

BoosterABI

import BoosterABI from "./protocols/convex/BoosterABI.json"; Speaks for: booster.
  • deposit(uint256 _pid, uint256 _amount, bool _stake) returns (bool)
  • withdraw(uint256 _pid, uint256 _amount) returns (bool)
  • poolLength() view returns (uint256)
  • poolInfo(uint256) view returns (address lptoken, address token, address gauge, address crvRewards, address stash, bool shutdown): lptoken is a token, token is a token, crvRewards is a Convex.BaseRewardPool

Next steps