> For the complete documentation index, see [llms.txt](https://docs.townsq.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.townsq.xyz/technical-details/interest-rate-framework.md).

# Interest Rate Framework

The lending protocol uses a dynamic rate model that automatically adjusts to balance supply and borrowing activity. This mechanism ensures lenders receive competitive yields while borrowers face fair costs, keeping the overall system healthy and efficient.

### Core Concepts

#### Utilization Ratio (U)

This ratio shows how much of the pool’s liquidity is currently borrowed relative to the total deposits.

$$
U=Total Supplied / Total Borrowed​
$$

A higher utilization means most funds are borrowed, which generally drives interest rates upward.

**Variable Rate:** Moves up or down based on the utilization ratio.

**Interest Rate Calculations**

**Variable Borrow Interest Rate** (i<sub>vb</sub>):

The variable interest rate depends on the utilization ratio and is calculated using the following formulas:

$$
\text{If } U\_t < U\_{opt} : \quad i\_{vb}(t) = R\_{v0} + \frac{U\_t}{U\_{opt}} \times R\_{v1}
$$

$$
\text{If } U\_t \geq U\_{opt} : \quad
i\_{vb}(t) = R\_{v0} + R\_{v1} + \frac{U\_t - U\_{opt}}{1 - U\_{opt}} \times R\_{v2}
$$

**Deposit Interest Rate**

The deposit interest rate, earned by depositors, is derived from the interest paid by borrowers.

$$
i\_d(t) = U\_t \times i\_b(t) \times (1 - RR)
$$

( RR ) is the retention rate, representing the protocol's fee.

i<sub>b</sub>(t) is the overall borrow interest rate, which is a weighted average of variable and stable borrow rates.

**Borrow Interest Amount**

The stable borrow interest amount is the sum of the stable borrowed amounts multiplied by their respective interest rates.

$$
O\_{sb}(t) = \sum B\_i \times i\_{sb}(i)
$$

### Collateral and Borrowing Limits

#### Collateral Factor (CF)

Each asset has a **collateral factor (CF)**, which sets the maximum amount you can borrow against it, expressed as a percentage of its value.

**Example:**\
If USDC has a CF of **80%**, depositing **$10 USDC** allows you to borrow up to **$8 worth** of assets.

#### Borrowable Amount (BA)

The total borrowing capacity is calculated from the collateral you provide, its market price, and the asset’s collateral factor:

$$
BA(t) = \sum \left( A^t\_i \times P\_i \times CF\_i \right)
$$

#### Borrow Factor (BF)

Some assets are treated as riskier when borrowed, so they are adjusted with a **borrow factor (BF)**. This increases the effective exposure when borrowing volatile assets.

**Example:**\
If BTC has a **BF of 110%**, then borrowing **$10 BTC** is treated as **$11 of risk exposure** in the system.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.townsq.xyz/technical-details/interest-rate-framework.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.
