Withdrawal Amount Calculations

How to calculate the withdrawal amount?

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

  • Interest Reserve (IR): the amount of interest reserved for the protocol and only be deducted when the user withdraws the interest

  • 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.

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.

Calculations:

TotalWithdrawalAmount=WithdrawalAmount+InterestReserveTotal Withdrawal Amount =Withdrawal Amount +Interest Reserve

If TotalWithdrawalAmount<=InterestTotal Withdrawal Amount <= Interest, then InterestReserve=TotalWithdrawalAmountInterestReserveFactorInterest Reserve=Total Withdrawal Amount*Interest Reserve Factor

If TotalWithdrawalAmount>Interest,Total Withdrawal Amount > Interest, then InterestReserve=InterestInterestReserveFactorInterest Reserve=Interest*Interest Reserve Factor

0<=IFR<=10<=IFR<=1

Last updated