Möbius Exchange
  • 📜Möbius Exchange Overview
    • 🦾How Möbius Innovates with ALM?
    • 📊Key Advantages of Möbius
    • 🏗️Möbius’s Role in the Mantle Ecosystem
  • 🎨Whitepaper
    • 📃A Brief History of StableSwap
    • 🔬Asset Liability Management
    • 🏦Deposit and Withdrawal
    • ↔️Swap formula
    • 💹LP token value and Fee sharing
    • 🎯Benefits of Möbius Exchange’s ALM Approach
  • 👨‍💻How to use Möbius Exchange
  • 💻Smart Contracts
  • 🎒Media Kit
  • 👮Security
  • 📱Social Channels
  • ❓FAQ
Powered by GitBook
On this page
  • Deposit
  • Withdrawal
  • Withdrawal when coverage ratio is at or above 100%
  • Withdrawal when coverage ratio is below 100%
  • Property 1. Low fee for normal coverage ratio while higher fee for extreme coverage ratio
  • Property 2. Lower bound for coverage ratio
  • Calculation of the withdrawal amount
  1. Whitepaper

Deposit and Withdrawal

Deposit

As liquidity providers deposit tokens, the pool's assets increase, and LP tokens are issued to the providers, representing the pool's liability.

Mathematically, this can be expressed as:

a=a0+Δaa = a_0 + \Delta{a}a=a0​+Δa
l=l0+Δll = l_0 + \Delta{l}l=l0​+Δl

where a0,l0a_0, l_0a0​,l0​ are the initial asset and liability before the deposit, a,la, la,l are the post-deposit asset and liability, and Δa,Δt\Delta{a} , \Delta{t}Δa,Δt are the change in asset and liability.

The amount of token deposited, and the amount of liability increase are the same during the deposit action.

Δa=Δl\Delta{a} = \Delta{l}Δa=Δl

Withdrawal

As a recap, the coverage ratio of token iii is defined as follow,

coverage ratioi=ri=assetilliabilityi\text{coverage ratio}_i = r_i = \frac{\text{asset}_i}{\text{lliability}_i}coverage ratioi​=ri​=lliabilityi​asseti​​

Liquidity providers can redeem their LP tokens, which represent a portion of the liability, and receive the corresponding tokens in return when they withdraw their assets.

For example, in a pool with 100 USDT in assets and 100 USDT in liabilities, an LP holding 10 LP tokens can redeem 10 USDT. In this scenario, the asset liability management model would burn the 10 LP tokens, decrease the liability by 10 USDT, and decrease the asset by 10 USDT as it is returned to the LP.

Withdrawal when coverage ratio is at or above 100%

In the case where the asset has a coverage ratio at or above 100%, ri>=1r_i >= 1ri​>=1 , withdrawal fees are waived as the system holds sufficient assets for these token accounts, and the withdrawal would not lower the coverage ratio.

We denote aaa as the asset amount, lll as the liability amount, Δa\Delta{a}Δa and Δl\Delta{l}Δl are the changes in aaa and lll respectively after the withdrawal action.

The amount of liability decrease is −Δl-\Delta{l}−Δl since the change in liability is negative. The amount of asset to be returned to the LP is denoted by −Δa-\Delta{a}−Δa since the change in asset is also negative.

The rate of change in liability is the same as asset as there is no fee. Therefore

dadl=1\frac{da}{dl} = 1dlda​=1
amount of token return to LP=−Δa=−Δl\text{amount of token return to LP} = -\Delta{a} =-\Delta{l}amount of token return to LP=−Δa=−Δl

LPs can get back the same amount of asset as the amount of LP token they are redeeming.

Withdrawal when coverage ratio is below 100%

For asseti\text{asset}_iasseti​ with a coverage ratio of less than 100%, the withdrawal fee is imposed to discourage users to withdraw in this asseti\text{asset}_iasseti​ . However, LPs can use the LP token of asseti\text{asset}_iasseti​ to withdraw assetj\text{asset}_jassetj​ at no fee if assetj\text{asset}_jassetj​ has coverage ratio greater than 100%, i.e. rj>=100%r_j >= 100\%rj​>=100%. This mechanism encourages LPs to withdraw over-covered assets while simultaneously burning the liability of under-covered assets, helping to bring the coverage ratios into equilibrium.

If the LPs like to withdraw the original asset that is under-covered, the action is still allowed but is penalized by a fee as it further deviates the pool from the equilibrium.

The penalty function p(r)p(r)p(r) is the marginal fee that would be imposed when the coverage ratio is at rrr. It is formulated as follow,

Definition - 3.1

p(r)={1,0≤r≤rt,(1−r1−rt)4,rt<r<1,0,r≥1.p(r) = \begin{cases} 1, & 0 \le r \le r_t,\\[6pt] \left(\frac{1 - r}{1 - r_t}\right)^4, & r_t < r < 1,\\[6pt] 0, & r \ge 1. \end{cases} p(r)=⎩⎨⎧​1,(1−rt​1−r​)4,0,​0≤r≤rt​,rt​<r<1,r≥1.​

Where rtr_trt​ is the threshold coverage ratio where the penalty reaches 1. It is a configurable constant that determines the shape of the function.

The penalty function p(r)p(r)p(r) is the marginal fee that would be imposed when the coverage ratio is at rrr.

Coverage ratio

Marginal Withdrawal fee

95%

0.00%

90%

0.08%

85%

0.39%

80%

1.23%

75%

3.01%

70%

6.25%

65%

11.58%

60%

19.75%

55%

31.64%

50%

48.23%

45%

70.61%

40%

100%

Table 3.1. Illustration of the withdrawal fee under different coverage ratios. rtr_trt​ is configured to be 0.4. For example, then the coverage ratio is 85%, withdrawing 1 unit of the under-covered asset, the result would be 0.9961. Note that this withdrawal fee can be 0 if they withdraw the over-covered asset.

The withdrawal fee formula ensures the following properties hold true.

Property 1. Low fee for normal coverage ratio while higher fee for extreme coverage ratio

The fee structure ensures minimal withdrawal fees for coverage ratios that are not extreme; for instance, at a 90% coverage ratio, the marginal fee is 0.08%. However, when the coverage ratio drops to an extreme value such as 70%, the marginal withdrawal fee increases to 6.25%.

High withdrawal fee is indeed a risk that LPs would face if one of the assets in the pool depegs, and the LPs have to pay a high withdrawal fee for the under-covered asset. However, It is important to note that LPs can wait for the coverage ratio to return to a higher value so the withdrawal fee returns to normal, or immediately withdraw assets with a coverage ratio greater than 1 with no fee.

Property 2. Lower bound for coverage ratio

As p(r)p(r)p(r) would approach 100% as rrr reaches rtr_trt​. The withdrawal fee ensures that the coverage ratio cannot go below rtr_trt​ , as further withdrawal would result in 100% fee and hence cannot lower rrr. In this extreme scenario, LPs would be incentivized to withdraw the over-covered asset at no fee.

Calculation of the withdrawal amount

In the case of r0<100%r_0 < 100\%r0​<100%, the marginal fee at rrr is given by p(r)p(r)p(r), and the marginal withdrawal rate, for each unit of liability, is redeemable for 1−p(r)1-p(r)1−p(r) unit of asset.

We have the following.

dadl=1−p(r)\frac{da}{dl} = 1-p(r)dlda​=1−p(r)

Since a=rla = r la=rl, and dadl=r+ldrdl\frac{da}{dl} = r + l \frac{dr}{dl} dlda​=r+ldldr​

r+ldrdl=1−(1−r1−rt)4 r + l \frac{dr}{dl} = 1 - \left( \frac{1 - r}{1 - r_t} \right)^4 r+ldldr​=1−(1−rt​1−r​)4

Rearrange terms:

ldrdl=1−r−(1−r1−rt)4l \frac{dr}{dl} = 1 - r - \left( \frac{1 - r}{1 - r_t} \right)^4ldldr​=1−r−(1−rt​1−r​)4

Substitute v=1−rv = 1 - r v=1−r, drdl=−dvdl\frac{dr}{dl} = -\frac{dv}{dl}dldr​=−dldv​

−ldvdl=v−(v1−rt)4-l \frac{dv}{dl} = v - \left( \frac{v}{1 - r_t} \right)^4−ldldv​=v−(1−rt​v​)4
ldvdl=(v1−rt)4−vl \frac{dv}{dl} = \left( \frac{v}{1 - r_t} \right)^4 - vldldv​=(1−rt​v​)4−v
∫dvv((v1−rt)3−1)=∫dll\int \frac{dv}{v \left( \left( \frac{v}{1 - r_t} \right)^3 - 1 \right)} = \int \frac{dl}{l}∫v((1−rt​v​)3−1)dv​=∫ldl​
13ln⁡∣v3(1−rt)4−v3∣=ln⁡∣lC∣\frac{1}{3} \ln \left| \frac{v^3}{(1 - r_t)^4 - v^3} \right| = \ln \left| \frac{l}{C} \right|31​ln​(1−rt​)4−v3v3​​=ln​Cl​​
v3(1−rt)4−v3=(lC)3\frac{v^3}{(1 - r_t)^4 - v^3} = \left( \frac{l}{C} \right)^3(1−rt​)4−v3v3​=(Cl​)3
v3=(1−rt)4(lC)31+(lC)3v^3 = \frac{(1 - r_t)^4 \left( \frac{l}{C} \right)^3}{1 + \left( \frac{l}{C} \right)^3}v3=1+(Cl​)3(1−rt​)4(Cl​)3​

Solve for constant CCC, when a=a0,l=l0a=a_0, l=l_0a=a0​,l=l0​

(1−a0l0)3=(1−rt)4(l0C)31+(l0C)3\left(1 - \frac{a_0}{l_0}\right)^3 = \frac{(1 - r_t)^4 \left( \frac{l_0}{C} \right)^3}{1 + \left( \frac{l_0}{C} \right)^3}(1−l0​a0​​)3=1+(Cl0​​)3(1−rt​)4(Cl0​​)3​
1C3=1l03(1(1−a0l0)3−1(1−rt)4)\frac{1}{C^3} = \frac{1}{l_0^3} \left( \frac{1}{(1 - \frac{a_0}{l_0})^3} - \frac{1}{(1 - r_t)^4} \right)C31​=l03​1​((1−l0​a0​​)31​−(1−rt​)41​)

After simplifying and rearranging, we have the final result.

When an LP redeem −Δl-\Delta{l}−Δl amount of liability, given the initial asset a0a_0a0​, liability l0l_0l0​ ,

Formula - 3.2

l=l0−(−Δl)l = l_0 - (-\Delta{l})l=l0​−(−Δl)
a=l(1−(MNN+(Ml03−N)(ll0)3)1/3)a = l \left( 1 - \left( \frac{M N}{N + (M l_0^3 - N)\left(\frac{l}{l_0}\right)^3} \right)^{1/3} \right)a=l​1−​N+(Ml03​−N)(l0​l​)3MN​​1/3​

where M=(1−rt)4M = (1 - r_t)^4M=(1−rt​)4 and N=(1−a0l0)3l03N = \left(1 - \frac{a_0}{l_0}\right)^3 l_0^3N=(1−l0​a0​​)3l03​.

amount of token return to LP=−Δa=a0−a\text{amount of token return to LP} = -\Delta{a} = a_0 - aamount of token return to LP=−Δa=a0​−a

PreviousAsset Liability ManagementNextSwap formula

Last updated 2 months ago

🎨
🏦