# Interest Rate Model

The interest rates charged to borrowers in Project Galapago are not static; they are dynamic and depend on the pool's Utilization Rate ($$U$$). This dynamic interest model is designed to promote liquidity within the pool.

When there is an abundance of capital (low $$U$$), borrowers pay less interest to incentivize borrowings. However, when capital becomes scarce (high $$U$$), interest rates increase to encourage more deposits and prompt borrowers to repay their loans, thereby replenishing the pool's liquidity.

The mechanism also accounts for liquidity risk. As $$U$$ approaches 100%, the liquidity risk increases. To manage this risk, the protocol implements an inflection point ($$Uoptimal​$$), beyond which the interest rate slope increases sharply. This inflection point is a crucial part of the interest model, triggering a rapid rise in interest rates when $$U$$ exceeds $$Uoptimal​$$ and helping to restore liquidity quickly.

The interest rate model can be represented as:

$$if \hspace{1mm} U < U\_{optimal}: \hspace{1cm} R\_t = R\_0 + \frac{U\_t}{U\_{optimal}} R\_{slope1}$$

$$if \hspace{1mm} U \geq U\_{optimal}: \hspace{1cm} R\_t = R\_0 + R\_{slope1} + \frac{U\_t-U\_{optimal}}{1-U\_{optimal}}R\_{slope2}$$

where $$R\_{slope1}, R\_{slope2}$$ and $$R\_0$$ are parameters that define the slopes and intercepts of the interest rate model, and $$R\_t$$ is the resulting interest rate.

The actual annual percentage yield (APY) can be calculated as:

$$
ActualAPY=(1+ \frac  {TheoreticalAPY} {secsperyear})^{secsperyear}−1
$$

This model ensures that the interest rates adapt to the current liquidity conditions, promoting the sustainability of the pool and providing fair returns for depositors and reasonable rates for borrowers. It ensures that the pool remains liquid, reduces risks, and balances the needs of all users of the protocol.


---

# 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://docs.galapago.app/interest-rate-model.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.
