> For the complete documentation index, see [llms.txt](https://docs.definer.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.definer.org/copy-of-definer.org/faq/withdrawal-amount-calculations.md).

# Withdrawal Amount Calculations

#### **Definitions:**

* **Interest (I)**: the interest earned by the user from the protocol and has not been withdrawn yet
* **Total Withdrawal Amount (TWA):** the amount deducted from the deposit balance&#x20;
* **Interest Reserve (IR):** the amount of interest reserved for the protocol and only be deducted when the user withdraws the interest&#x20;
* **Withdrawal Amount (WA)**: the final amount transferred to the user's wallet after the deduction of interest reserve from the total withdrawal amount
* **Interest Reserve Factor (IRF):** the ratio between interest reserve and the total withdrawal amount. &#x20;

When users withdraw funds from the savings contract, the interest will always be deducted first from the users' deposit balance. And there is a portion of the interest that will be reserved from users' deposit balance for the protocol upon the withdrawal of any interest. If the user didn't withdraw any interest, the reserved interest would be kept in the user's account and continue to generate interest. The interest reserve is only a portion of interest earned through the platform.&#x20;

**Calculations:**

$$Total Withdrawal Amount =Withdrawal Amount +Interest Reserve$$

If $$Total Withdrawal Amount <= Interest$$,  then $$Interest Reserve=Total Withdrawal Amount\*Interest Reserve Factor$$&#x20;

If $$Total Withdrawal Amount > Interest,$$ then $$Interest Reserve=Interest\*Interest Reserve Factor$$

$$0<=IFR<=1$$


---

# 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.definer.org/copy-of-definer.org/faq/withdrawal-amount-calculations.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.
