> For the complete documentation index, see [llms.txt](https://docs.predy.finance/predy-v6/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predy.finance/predy-v6/dev/interest-rate-model.md).

# Interest Rate Model

### Purpose

The Interest Rate Model is a fundamental component in decentralized finance (DeFi) protocols, particularly for lending and borrowing platforms. It is designed to dynamically adjust the interest rates based on the utilization of the asset pool, thereby ensuring an efficient allocation of capital and maintaining the stability of the protocol.

### How It Works

The Interest Rate Model uses a set of parameters defined in the `IRMParams` struct, which includes the base rate, kink rate, slope1, and slope2. These parameters allow the model to create a piecewise linear interest rate curve that adjusts based on the utilization ratio of the asset pool.

1. **Base Rate**: The minimum interest rate applied regardless of utilization.
2. **Kink Rate**: The utilization ratio threshold at which the interest rate curve changes its slope.
3. **Slope1**: The interest rate increases per unit of utilization before reaching the kink rate.
4. **Slope2**: The interest rate increases per unit of utilization after exceeding the kink rate.

By combining these parameters, the model calculates the appropriate interest rate to apply at any given utilization level, ensuring a balanced and efficient lending and borrowing environment.

The interest rate *R* follows the model:

$$
R=Base+U \cdot Slope1\ (U\<KinkRate)
$$

$$
R=Base+KinkRate \cdot Slope1+(U-KinkRate) \cdot Slope2\ (U≥KinkRate)
$$

where *U* is the utilization ratio of the lending pool.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.predy.finance/predy-v6/dev/interest-rate-model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
