# Compounding Model

{% hint style="info" %}
In order to provide maximum flexibility to both Depositors and Borrowers, interest payments are automatically integrated in Deposit and Borrow Balances and are compounded at every block.
{% endhint %}

To compute each Borrow Balance, we use a specific Denominated Currency called $$lToken$$. When a new Lending Pool is created for Token A, we create a $$lToken^A$$, whose price in Token A unit evolves as follows:

$$
L^A\_0=1 \hspace{1cm} and \hspace{1cm}
L^A\_{t+1}=L^A\_t (1+r\_tdt)
$$

where $$d\_t$$ is the time period expressed in years. \
\
By updating this price, each Borrow Balance can be easily incremented by the interest accrued during the period.

For Depositors, we follow a similar approach by introducing a Deposit Token, or $$dToken$$, that represents their ownership in a specific Lending Pool. As opposed to $$lToken$$ , these $$dTokens$$ are minted and transferred to Depositors in exchange for their deposits.

In order to materialize the accruing interest over deposits, $$dToken^A$$ will be convertible into an increasing amount of Token A. With $$R\_t$$being the Deposit rate, the price of $$dToken$$ in Token A Unit, or $$D^A\_t$$, evolves as follows:

$$
D^A\_0=1 \hspace{1cm} and \hspace{1cm}
D^A\_{t+dt}=D^A\_t (1+R\_tdt)
$$

Upon withdrawal, Depositors can redeem their $$dToken^A$$ for Token A at the current price, reflecting their deposits plus the interest earned.


---

# 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.securd.org/documentation/securd-models/compounding-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.
