# - BNB Lending (V2)

## 💡**Deposit BNB To Get ibBNB**&#x20;

![](https://2223290131-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXh2hL0GBQR3Ak_8bv%2F-McOZpGkiThg-FE3gyDi%2F-McO_HP-lsRGzfhfkqx5%2Fimage.png?alt=media\&token=cbacd5be-049c-4b9e-b24e-c726ed459821)

**ibBNB** can be calculated by;

* *CASE 1* : (Total BNB - Deposit Amount) > 0

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

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

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

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

Total ibBNB token is set based on the first user who deposits this asset. For example, if Bob is the first user who deposits 1,000 BNB, then the total ibBNB token starts with 1,000 ibBNB. If Alice then adds 100 BNB then the total liquidity will be 1,100 BNB, then Alice gets 90.90 ibBNB (100 \* 1,000 / 1,100).

## 💡**Withdraw ibBNB to get BNB**

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}}
$$

![](https://2223290131-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWXh2hL0GBQR3Ak_8bv%2F-MbK_CFnAnOnmmAJ3CXp%2F-MbKd3E_GbASLRfKJILs%2Fimage.png?alt=media\&token=8141487d-c149-494a-b71b-7b9a94313203)

### 📎Total BNB 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 ibBNB APR

Can be calculated from the following equation

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