# - BTCB Lending

## 💡**Deposit BTCB To Get ibBTCB**

![](/files/-Mc9KDazhgK-l-mds5Uo)

**ibBTCB** can be calculated by;

* *CASE 1* : (Total BTCB Deposit Amount) > 0

$$
{Number}\space{of}\space{Token}=\frac{{Deposit}\space{Amount}\*{Total}\space{Token}}{{Total}\space{Liquidity}}
$$

* *CASE 2 :* (Total BTCB - Deposit Amount) ≤ 0

$$
{Number}\space{of}\space{Token}={Deposit}\space{Amount}
$$

**\*Total  Liquidity = Total BTCB Deposited + Cumulative Borrow Interest**

Total ibBTCB token is set based on the first user who deposits this asset. For example, if Bob is the first user who deposits 1 BTCB, then the total ibBTCB token starts with 1 ibBTCB. If Alice then adds 0.5 BTCB then the total liquidity will be  1.5 BTCB, then Alice gets 0.33 ibBTCB (0.5 \* 1 / 1.5).

## 💡**Withdraw ibBTCB to get BTCB**

The number of withdrawal share that can be calculated from the following equation;

$$
{Withdrawal}\space{Share}=\frac{{Withdrawal}\space{Amount}\*{Total}\space{Token}}{{Total}\space {Liquidity}}
$$

![](/files/-McCzleXKv4tBqsj8LnF)

### 📎Total BTCB Deposited (Total Supply)

Can be called '*Total Liquidity*', the total amount of liquidity in each asset pool, calculated as

$$
TotalLiquidity = TotalAvailableLiquidity+TotalBorrows
$$

### 📎Total Debt Issued (Total Borrowing)

Can be called '**Total Borrow Shares**', the total number of shares of Total Borrow for an asset, while **Total Borrows** are the sum of the total borrowed amount and accumulated borrow interest of an asset.

### 📎Current ibBTCB APR

Can be calculated from the following equation

$$
{ibBTCB}\space{APR} = \frac{{Borrow}\space{Interest}\*Utilization}{100}
$$


---

# 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://btestafinance.gitbook.io/btesta-finance/btesta-protocol/untitled/lend-and-earn/btcb-lending.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.
