Mint and redeem of LP tokens

the calculation

Parameters:

Symbol
Meaning

lp

Each LP token’s net asset value in US dollars. lp=LPTotalSupplylp=\frac {LP} {TotalSupply}

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

a risk management parameter for each currency. pr (0,1)\in (0,1)

poracle p_{oracle}

Oracle price of each currency

pexecp_{exec}

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}

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

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

Assumptions:

LPLP = $100,000,000, TotalSupplyTotalSupply=1,000,000

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

ETH-USDC swap: s=$-10,000,000, λ\lambda = 0.05, pr=0.75, poraclep_{oracle}= $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} = \$100

250,000×lporacle=$25,000,000250,000 \times lp_{oracle} = \$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 LPs=$90,000,000LP - \sum |s| = \$90,000,000.

lporacle=100,000,0001,000,000=$100lp_{oracle}= \frac {100,000,000} {1,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} =\$-10 ETH-USDC position. Thus, 250,000 lplp would hold 0 BTC-USDC position and $-2,500,000 ETH-USDC position.

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

LP=100,000,000250,000×100=$75,000,000LP = 100,000,000 - 250,000 \times 100 = \$75,000,000,

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

T=$2,500,000T=\$-2,500,000

pmid=poracle(1+λsprLP)=$1,986.67p_{mid} = p_{oracle} \cdot (1 + \frac {\lambda \cdot s} {pr \cdot LP})=\$1,986.67

pmid=poracle(1+λ(s+T)prLP)=$1,982.22p'_{mid} = p_{oracle} \cdot (1 + \frac {\lambda \cdot (s+T)} {pr \cdot LP}) = \$1,982.22

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

slippage=1,984.442,000=$15.56slippage = 1,984.44-2,000= \$-15.56

PnL=2,500,0002,000×(1,984.442,000)=$19,444.44PnL= \frac {2,500,000} {2,000} \times (1,984.44-2,000)= \$-19,444.44

Adding in the 0.1% redemption fee:

250,000×lpredeem=250,000×10019,444.44)×(10.1%)=24,955,575250,000 \times lp_{redeem}= (250,000 \times 100 - 19,444.44)\times(1-0.1\%) = 24,955,575 , which is less than 25,000,000.

Further elaborations on trading prices are explained here.

Last updated