# Booster

The[ booster.sol](https://github.com/convex-eth/platform/blob/main/contracts/contracts/Booster.sol) is our main deposit contract for LP tokens.

```javascript
//main Convex contract(booster.sol) basic interface
interface IConvex{
    //deposit into convex, receive a tokenized deposit.  parameter to stake immediately
    function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
    //burn a tokenized deposit to receive curve lp tokens back
    function withdraw(uint256 _pid, uint256 _amount) external returns(bool);
}
```

### Pool Info

To gather pool information access the poolInfo array

```javascript
//number of pools
var poolLength = await booster.poolLength()
//get information for pool "n"
var poolInfo = await booster.poolInfo(n)
```

Pool information is returned in the following struct.

```javascript
struct PoolInfo {
        address lptoken;
        address token;
        address gauge;
        address crvRewards;
        address stash;
        bool shutdown;
}
```

**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.

```javascript
//deposit into a pool "n" and receive the deposit token
await booster.deposit( n, amount, false )

//deposit into a pool "n" and immediately stake into the rewards contract
await booster.deposit( n, amount, true )

//deposit all lp tokens for pool "n" and stake into the rewards contract
await booster.depositAll( n, true )
```

### Withdrawals

There are two withdraw commands, withdraw() and withdrawAll(). By burning a convex deposit token you can receive the underlying LP token.

```javascript
//withdraw from pool "n"
await booster.withdraw( n, amount )

//withdraw all from pool "n"
await booster.withdrawAll( n )
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convexfinance.com/convexfinanceintegration/booster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
