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