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
  1. Guides and FAQs
  2. Liquidity

Mint and redeem of LP tokens

the calculation

Parameters:

Symbol
Meaning

lp

LP

total LP tokens’ net asset value, in USD, equal to LP’s cash after instantly closing all user positions without fee

s

net position of each currency in USD for all users. = (loi-soi)

pr

Oracle price of each currency

execution price of each currency

When calculating the mint and redeem process, Symmetry's algorithm looks at its impact on the overall welfare of the LP holders. Specifically:

  • When a liquidity provider mints lp tokens, it reduces the risk (or does not change the risk) other LPs take (from acting as the counterparty of traders). Therefore, lpmint=lporaclelp_{mint} = lp_{oracle}lpmint​=lporacle​

  • When a liquidity provider redeems lp tokens, it adds risks (or does not change the risks) other LPs take. Therefore, lpredeem≀lporaclelp_{redeem} \leq lp_{oracle}lpredeem​≀lporacle​

Let's go through the calculation with examples. Note: the following examples do NOT include gas fees.

Assumptions:

LPLPLP = $100,000,000, TotalSupplyTotalSupplyTotalSupply=1,000,000

BTC-USDC swap: s=$0, Ξ»\lambdaΞ» = 0.05, pr=0.8, poraclep_{oracle}poracle​= $25,000

ETH-USDC swap: s=$-10,000,000, Ξ»\lambdaΞ» = 0.05, pr=0.75, poraclep_{oracle}poracle​= $2000

Mint

If someone wants to mint 250,000 lp, how much USDC would he need (assuming the USDC's price remains at $1)?

lporacle=100,000,0001,000,000=$100lp_{oracle}= \frac {100,000,000} {1,000,000} = \$100lporacle​=1,000,000100,000,000​=$100

250,000Γ—lporacle=$25,000,000250,000 \times lp_{oracle} = \$25,000,000250,000Γ—lporacle​=$25,000,000=

Redeem

If someone wants to redeem 250,000 lp, how much USDC could he get (assuming the USDC's price remains at $1)?

The maximum liquidity available for redemption is LPβˆ’βˆ‘βˆ£s∣=$90,000,000LP - \sum |s| = \$90,000,000LPβˆ’βˆ‘βˆ£s∣=$90,000,000.

lporacle=100,000,0001,000,000=$100lp_{oracle}= \frac {100,000,000} {1,000,000} = \$100lporacle​=1,000,000100,000,000​=$100

Every lp can be viewed as holding 0 BTC-USDC position and βˆ’10,000,0001,000,000=$βˆ’10\frac {-10,000,000} {1,000,000} =\$-101,000,000βˆ’10,000,000​=$βˆ’10 ETH-USDC position. Thus, 250,000 lplplp would hold 0 BTC-USDC position and $-2,500,000 ETH-USDC position.

To close $-2,500,000 ETH-USDC position:

LP=100,000,000βˆ’250,000Γ—100=$75,000,000LP = 100,000,000 - 250,000 \times 100 = \$75,000,000LP=100,000,000βˆ’250,000Γ—100=$75,000,000,

s=βˆ’10,000,000+2,500,000=$βˆ’7,500,000s = -10,000,000 +2,500,000 = \$-7,500,000s=βˆ’10,000,000+2,500,000=$βˆ’7,500,000

T=$βˆ’2,500,000T=\$-2,500,000T=$βˆ’2,500,000

pmid=poracleβ‹…(1+Ξ»β‹…sprβ‹…LP)=$1,986.67p_{mid} = p_{oracle} \cdot (1 + \frac {\lambda \cdot s} {pr \cdot LP})=\$1,986.67pmid​=poracle​⋅(1+prβ‹…LPΞ»β‹…s​)=$1,986.67

pmidβ€²=poracleβ‹…(1+Ξ»β‹…(s+T)prβ‹…LP)=$1,982.22p'_{mid} = p_{oracle} \cdot (1 + \frac {\lambda \cdot (s+T)} {pr \cdot LP}) = \$1,982.22pmid′​=poracle​⋅(1+prβ‹…LPΞ»β‹…(s+T)​)=$1,982.22

pexec=$1,984.44p_{exec} = \$1,984.44pexec​=$1,984.44

The calculation assumes 0 trading fees and 0 gas fees.

slippage=1,984.44βˆ’2,000=$βˆ’15.56slippage = 1,984.44-2,000= \$-15.56slippage=1,984.44βˆ’2,000=$βˆ’15.56

PnL=2,500,0002,000Γ—(1,984.44βˆ’2,000)=$βˆ’19,444.44PnL= \frac {2,500,000} {2,000} \times (1,984.44-2,000)= \$-19,444.44PnL=2,0002,500,000​×(1,984.44βˆ’2,000)=$βˆ’19,444.44

Adding in the 0.1% redemption fee:

250,000Γ—lpredeem=(250,000Γ—100βˆ’19,444.44)Γ—(1βˆ’0.1%)=24,955,575250,000 \times lp_{redeem}= (250,000 \times 100 - 19,444.44)\times(1-0.1\%) = 24,955,575 250,000Γ—lpredeem​=(250,000Γ—100βˆ’19,444.44)Γ—(1βˆ’0.1%)=24,955,575, which is less than 25,000,000.

PreviousLiquidityNextCoupons

Last updated 1 year ago

Each LP token’s net asset value in US dollars.

a risk management parameter for each currency. pr

Further elaborations on trading prices are explained .

🐳
lp=LPTotalSupplylp=\frac {LP} {TotalSupply}lp=TotalSupplyLP​
∈(0,1)\in (0,1)∈(0,1)
poracle p_{oracle}poracle​
pexecp_{exec}pexec​
here