> For the complete documentation index, see [llms.txt](https://polytrade.gitbook.io/polytrade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polytrade.gitbook.io/polytrade/lenderpool.md).

# LenderPool

## deposit

```
function deposit(uint amount) external;
```

#### **Is used by lenders to deposit stable tokens to the smart contracts.**

| Parameter Name | Type   | Description                                                   |
| -------------- | ------ | ------------------------------------------------------------- |
| `amount`       | `uint` | is used by lenders to deposit stable token to smart contract. |

### Requirements

| Type     | Description                                                                                                                                                                          |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `amount` | <p>should be greater than zero.<br>must be approved from the stable token contract for the LenderPool.<br>should be less than the validation limit or KYC needs to be completed.</p> |

## withdrawAllDeposit

```
function withdrawAllDeposit() external;
```

#### **Send lender T-Stable equivalent to stable deposited.**

## withdrawDeposit

```
function withdrawDeposit(uint amount) external;
```

#### **Send lender T-Stable equivalent to stable requested.**

| Parameter Name | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| `amount`       | `uint` | Total token requested by lender. |

### Requirements

| Type     | Description                                                               |
| -------- | ------------------------------------------------------------------------- |
| `amount` | <p>should be greater than 0.<br>should be not greater than deposited.</p> |

## redeemAll

#### Call transfers all rewards and deposited amount in the stable token.

```
function redeemAll() external;
```

### Requirements

| Type         | Description                                           |
| ------------ | ----------------------------------------------------- |
| `RedeemPool` | should have stable tokens more than lender deposited. |

## switchRewardManager

#### **Is used to** switch reward managers.

```
    function switchRewardManager(address newRewardManager) external;
```

| Parameter Name     | Type    | Description                                           |
| ------------------ | ------- | ----------------------------------------------------- |
| `newRewardManager` | address | newRewardManager, Address of the new `RewardManager`. |

## switchVerification

**Updates the Verification contract address.**

```
function switchVerification(address newVerification) external;
```

| Parameter Name       | Type    | Description                                |
| -------------------- | ------- | ------------------------------------------ |
| `switchVerification` | address | Updates the Verification contract address. |

## switchStrategy

#### Is used for switching the strategy.

```
function switchStrategy(address newStrategy) external;
```

| Parameter Name | Type    | Description                          |
| -------------- | ------- | ------------------------------------ |
| `newStrategy`  | address | address of the new staking strategy. |

## claimReward

#### Transfer all the `token` reward to `msg.sender`

```
function claimReward(address token) external;
```

| Parameter Name | Type    | Description           |
| -------------- | ------- | --------------------- |
| `token`        | address | address of the token. |

## rewardOf

#### Returns the total reward of the lender

```
function rewardOf(address lender, address token) external returns (uint);
```

| Parameter Name | Type    | Description                      |
| -------------- | ------- | -------------------------------- |
| `lender`       | address | address                          |
| `token`        | address | Returns the total pending reward |
| `uint`         | return  | Returns the total pending reward |

## getStrategyBalance

#### Returns total balance allocated by LenderPool in the Strategy (external protocol)

```
function getStrategyBalance() external view returns (uint);
```

| Parameter Name | Type   | Description                                                                     |
| -------------- | ------ | ------------------------------------------------------------------------------- |
| `unit`         | return | Returns total balance allocated by LenderPool in the Strategy external protocol |

## getDeposit

#### Returns total amount deposited by the lender.

```
function getDeposit(address lender) external view returns (uint);
```

| Parameter Name | Type    | Description                                            |
| -------------- | ------- | ------------------------------------------------------ |
| lender         | address | address of the lender                                  |
| uint           | returns | returns amount of stable token deposited by the lender |
