Symmetry
  • 🚀Welcome to Symmetry
  • 💡Getting Started
  • Guides and FAQs
    • 📜Dashboard
    • 📈Trade
      • 🧑‍🏫Risk Management Measurements
        • Funding
        • Position Financial Cost Mechanism
        • "Adjusted" AMM
      • 💣Case Studies - Liquidation
      • 👩‍🏫USD Settlement & Interest Rate Model
    • 🐳Liquidity
      • Mint and redeem of LP tokens
    • 🎰Coupons
  • Developers
    • Deployed Contracts
  • Links
    • Symmetry Website
    • Github
    • Twitter
    • Discord
    • Telegram
    • Medium
Powered by GitBook
On this page
  • USD to USDC Settlement
  • Interest Rate Model
  1. Guides and FAQs
  2. Trade

USD Settlement & Interest Rate Model

A deep-dive into the calculation and conversion between USD and USDC, and the use of various interest models.

PreviousCase Studies - LiquidationNextLiquidity

Last updated 1 year ago

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≥0USDCBalance \ge 0USDCBalance≥0, below situation will trigger conversion.

unsettledUSDmin(1.0,pusdcusd)+USDCBalance<threshold\frac {unsettledUSD} {min(1.0, p_{usdcusd})} +USDCBalance < threshold min(1.0,pusdcusd​)unsettledUSD​+USDCBalance<threshold
  • When USDCBalance<0USDCBalance < 0USDCBalance<0, below situation will trigger conversion.

unsettledUSDmin(1.0,pusdcusd)<threshold\frac {unsettledUSD} {min(1.0, p_{usdcusd})} < thresholdmin(1.0,pusdcusd​)unsettledUSD​<threshold

where unsettledUSD=∑PnL+∑Funding+∑FinancialCostsunsettledUSD= \sum PnL+ \sum Funding + \sum FinancialCostsunsettledUSD=∑PnL+∑Funding+∑FinancialCosts, threshold<0threshold <0threshold<0, and thresholdthresholdthreshold 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 pexecp_{exec}pexec​. 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 poraclep_{oracle}poracle​. 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 real-time annual interest rate is calculated as the combination of two interest rate models:

  • Linear Interest Rate Model

Symbol
Rate

5%

120%

25%

40%

  • Time-weighted Variable Interest Rate Model

The supply of USDC is from liquidity providers and the maximum supply is LP−∑∣s∣max(1.0,pusdcusd)\frac {LP-\sum |s|} {max(1.0, p_{usdcusd})}max(1.0,pusdcusd​)LP−∑∣s∣​. Where sss 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 IR0IR_0IR0​ until the specific rebalancing conditions are met.

Here we introduce the debt/equity ratio, DEDEDE.

DE={max(totalUSDCDebt×max(1.0,pusdcusd)LP−∑∣s∣,2)(LP−∑∣s∣)>02(LP−∑∣s∣)≤0DE = \left \{ \begin{array}{rcl} max(\frac {totalUSDCDebt \times max(1.0,p_{usdcusd})} {LP - \sum |s|},2) && (LP - \sum |s|)>0 \\ 2 && (LP - \sum |s|) \le 0 \end{array} \right.DE={max(LP−∑∣s∣totalUSDCDebt×max(1.0,pusdcusd​)​,2)2​​(LP−∑∣s∣)>0(LP−∑∣s∣)≤0​

where, the ceiling of DEDEDE is set as 2.

IR={IRvertex+DE−DE∗1−DE∗×(IRmax−IRvertex)DE>DE∗IR0+DEDE∗×(IRvertex−IR0)DE≤DE∗IR = \left \{ \begin{array}{rcl} IR_{vertex} + \frac {DE - DE^*} {1-DE^*} \times (IR_{max} - IR_{vertex}) && DE > DE^*\\ \\ IR_0 + \frac {DE} {DE^*} \times (IR_{vertex} - IR_0) && DE \le DE^* \end{array} \right.IR=⎩⎨⎧​IRvertex​+1−DE∗DE−DE∗​×(IRmax​−IRvertex​)IR0​+DE∗DE​×(IRvertex​−IR0​)​​DE>DE∗DE≤DE∗​

Where, IR0IR_0IR0​ is the minimum interest rate when DE=0DE =0DE=0, IRmaxIR_{max}IRmax​ is the maximum interest rate when DE=1DE =1DE=1, IRvertexIR_{vertex}IRvertex​ is the vertex interest rate when DE=DE∗DE =DE^*DE=DE∗, DE∗DE^*DE∗ is the vertex debt/equity ratio.

To protect LP in extreme market conditions, IRmaxIR_{max}IRmax​ follows time-weighted variable interest rate model and will change over time. When DE>DE∗DE > DE^*DE>DE∗ for 12 hours, IRmaxIR_{max}IRmax​ will double.

For takers with negative USDC balance NNN , the accrued interests between t0t_0t0​ and t1t_1t1​ (no actions happen between t0t_0t0​ and t1t_1t1​ in the protocol) is calculated as below:

DEti≤DE∗DE^{t_i} \le DE^*DEti​≤DE∗

ΔI=∫0Δt(IR×N) dt=N∫0Δt(IR0+DEDE∗×(IRvertex−IR0)) dt=N⋅Δt⋅(IR0+DEDE∗×(IRvertex−IR0))\begin{align*} \Delta I &= \int_{0}^{\Delta t } (IR\times N) \,dt \\ &=N\int_{0}^{\Delta t } (IR_0 + \frac {DE} {DE^*} \times (IR_{vertex} - IR_0)) \,dt \\ &=N \cdot \Delta t \cdot(IR_0 + \frac {DE} {DE^*} \times (IR_{vertex} - IR_0)) \end{align*}ΔI​=∫0Δt​(IR×N)dt=N∫0Δt​(IR0​+DE∗DE​×(IRvertex​−IR0​))dt=N⋅Δt⋅(IR0​+DE∗DE​×(IRvertex​−IR0​))​

DEti>DE∗DE^{t_i} > DE^*DEti​>DE∗

ΔI=∫0Δt(IR×N) dt=N∫0Δt(IRvertex+DE−DE∗1−DE∗((1+t12)IRmaxti−IRvertex)) dt=N⋅(1−DE1−DE∗⋅IRvertex⋅Δt+DE−DE∗1−DE∗⋅IRmaxti⋅(Δt+Δt224))\begin{align*} \Delta I &= \int_{0}^{\Delta t} (IR\times N) \,dt \\ &=N\int_{0}^{\Delta t} (IR_{vertex} + \frac {DE - DE^*} {1-DE^*} ((1+\frac {t} {12})IR^{t_i}_{max} - IR_{vertex})) \,dt \\ &=N \cdot \left(\frac {1 - DE} {1-DE^*} \cdot IR_{vertex} \cdot \Delta t + \frac {DE - DE^*} {1-DE^*} \cdot IR^{t_i}_{max} \cdot(\Delta t + \frac {\Delta t^2} {24} )\right) \end{align*}ΔI​=∫0Δt​(IR×N)dt=N∫0Δt​(IRvertex​+1−DE∗DE−DE∗​((1+12t​)IRmaxti​​−IRvertex​))dt=N⋅(1−DE∗1−DE​⋅IRvertex​⋅Δt+1−DE∗DE−DE∗​⋅IRmaxti​​⋅(Δt+24Δt2​))​

then calculate IRmaxti+1IR^{t_{i+1}}_{max}IRmaxti+1​​ for next transaction:

IRmaxti+1={(1+Δt12)IRmaxtiDEti+1>DE∗IRmax0DEti+1≤DE∗IR^{t_{i+1}}_{max}=\left \{ \begin{array}{rcl} (1+\frac{\Delta t}{12})IR^{t_{i}}_{max} && DE^{t_{i+1}} > DE^*\\ \\ IR^{0}_{max} && DE^{t_{i+1}} \le DE^* \end{array} \right.IRmaxti+1​​=⎩⎨⎧​(1+12Δt​)IRmaxti​​IRmax0​​​DEti+1​>DE∗DEti+1​≤DE∗​
📈
👩‍🏫
IR0IR_0IR0​
IRmax0IR^0_{max}IRmax0​
IRvertexIR_{vertex}IRvertex​
DE∗DE^*DE∗