A deep-dive into the calculation and conversion between USD and USDC, and the use of various interest models.
USD to USDC Settlement
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 USDCBalanceβ₯0, below situation will trigger conversion.
When USDCBalance<0, below situation will trigger conversion.
min(1.0,pusdcusdβ)unsettledUSDβ<threshold
where unsettledUSD=βPnL+βFunding+βFinancialCosts, threshold<0, and threshold 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 pricepexecβ. Keeper fees will be paid by takers.
When withdrawal actions andnegative amounts trigger USD to USDC settlement, entry price of positions will be changed to the oracle priceporacleβ. Keeper fees will be paid by LP.
Interest Rate Model
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 supply of USDC is from liquidity providers and the maximum supply is max(1.0,pusdcusdβ)LPβββ£sβ£β. Where s 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 IR0β until the specific rebalancing conditions are met.
Where, IR0β is the minimum interest rate when DE=0, IRmaxβ is the maximum interest rate when DE=1, IRvertexβ is the vertex interest rate when DE=DEβ, DEβ is the vertex debt/equity ratio.
Symbol
Rate
IR0β
5%
IRmax0β
120%
IRvertexβ
25%
DEβ
40%
Time-weighted Variable Interest Rate Model
To protect LP in extreme market conditions, IRmaxβ follows time-weighted variable interest rate model and will change over time. When DE>DEβ for 12 hours, IRmaxβ will double.
For takers with negative USDC balance N , the accrued interests between t0β and t1β (no actions happen between t0β and t1β in the protocol) is calculated as below: