Booster
The main deposit contract for LP tokens
The booster.sol is our main deposit contract for LP tokens.
1
//main Convex contract(booster.sol) basic interface
2
interface IConvex{
3
//deposit into convex, receive a tokenized deposit. parameter to stake immediately
4
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
5
//burn a tokenized deposit to receive curve lp tokens back
6
function withdraw(uint256 _pid, uint256 _amount) external returns(bool);
7
}
Copied!

Pool Info

To gather pool information access the poolInfo array
1
//number of pools
2
var poolLength = await booster.poolLength()
3
//get information for pool "n"
4
var poolInfo = await booster.poolInfo(n)
Copied!
Pool information is returned in the following struct.
1
struct PoolInfo {
2
address lptoken;
3
address token;
4
address gauge;
5
address crvRewards;
6
address stash;
7
bool shutdown;
8
}
Copied!
lptoken: the underlying token(ex. the curve lp token) token: the convex deposit token(a 1:1 token representing an lp deposit). The supply of this token can be used to calculate the TVL of the pool gauge: the curve "gauge" or staking contract used by the pool crvRewards: the main reward contract for the pool stash: a helper contract used to hold extra rewards (like snx) on behalf of the pool until distribution is called shutdown: a shutdown flag of the pool

Deposits

There are two deposit commands, deposit() and depositAll(). Depositing into the booster will return a "deposit token" as a receipt. This token can be staked in the rewards contract to earn CRV and other rewards.
1
//deposit into a pool "n" and receive the deposit token
2
await booster.deposit( n, amount, false )
3
4
//deposit into a pool "n" and immediately stake into the rewards contract
5
await booster.deposit( n, amount, true )
6
7
//deposit all lp tokens for pool "n" and stake into the rewards contract
8
await booster.depositAll( n, true )
Copied!

Withdrawals

There are two withdraw commands, withdraw() and withdrawAll(). By burning a convex deposit token you can receive the underlying LP token.
1
//withdraw from pool "n"
2
await booster.withdraw( n, amount )
3
4
//withdraw all from pool "n"
5
await booster.withdrawAll( n )
Copied!
Last modified 5mo ago