USD Settlement & Interest Rate Model
A deep-dive into the calculation and conversion between USD and USDC, and the use of various interest models.
Last updated
A deep-dive into the calculation and conversion between USD and USDC, and the use of various interest models.
Last updated
Funding fees, positions’ financing costs and PNL are all settled in real time in USD value. In below situations, total accumulated USD value will be converted to USDC amounts:
Takers’ trade actions, i.e. open trades, close all / part of positions;
Takers withdraw USDC and withdrawal amounts exceeds existing USDC balance;
When , below situation will trigger conversion.
When , below situation will trigger conversion.
where , , and now could be set as -10,000 at the beginning.
When traders’ trade action triggers USD to USDC settlement, entry price of positions will be changed to the execution price . Keeper fees will be paid by takers.
When withdrawal actions and negative amounts trigger USD to USDC settlement, entry price of positions will be changed to the oracle price . Keeper fees will be paid by LP.
When takers making money, they will receive USDC and USDC could be used as collaterals;
When takers losing money, USDC will be deducted from their accounts. If takers do not have enough USDC, which means USDC balance is negative, protocol will auto borrow USDC for accounts and start to charge interests. Interests will be credited to LP.
Our target to charge interests is encouraging takers to deposit USDC as soon as possible, as negative USDC balance will not only take use of extra margin but also will be charged interests.
The real-time annual interest rate is calculated as the combination of two interest rate models:
Linear Interest Rate Model
5%
120%
25%
40%
Time-weighted Variable Interest Rate Model
The supply of USDC is from liquidity providers and the maximum supply is . Where is net positions of each currency for all users in USD.
Total USDC debts equals to the sum of negative USDC balance from all takers. USDC debts maintain the base interest rate until the specific rebalancing conditions are met.
Here we introduce the debt/equity ratio, .
where, the ceiling of is set as 2.
Where, is the minimum interest rate when , is the maximum interest rate when , is the vertex interest rate when , is the vertex debt/equity ratio.
To protect LP in extreme market conditions, follows time-weighted variable interest rate model and will change over time. When for 12 hours, will double.
For takers with negative USDC balance , the accrued interests between and (no actions happen between and in the protocol) is calculated as below:
then calculate for next transaction: