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
  • Scenario 1: Coverage Ratios within normal range
  • Scenario 2: Extreme Coverage Ratios
  1. Whitepaper

Swap formula

Similar to other AMMs, Möbius Exchange’s swap mechanism is designed to encourage trades that move the system towards equilibrium and discourage trades that move it away from equilibrium. The difference lies in the fact that Möbius Exchange's equilibrium is defined as the coverage ratios of all assets are equal.

Without loss of generality, assume token A has a higher coverage ratio than token B, ra>rbr_a > r_bra​>rb​. If a trader exchanges token B for token A, this action increases the under-covered rbr_brb​ and decreases the over-covered rar_ara​ , hence bringing the pool closer to equilibrium. The pool would therefore offer a favorable rate in incentivize trades in this direction.

Conversely, if a trader exchanges token A for token B, this action further increases the over-covered rar_ara​ and further decreases the under-covered rbr_brb​ , hence further diverging the pool from the equilibrium. The pool would therefore offer a worse rate to penalize the trades in this direction.

This dynamic rate can be expressed mathematically in terms of coverage ratios.

Recall from the previous section, the penalty function is defined as,

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.​

As the trader swaps token A to token B, amount of token A in the pool would increase while amount of token B would decrease. The coverage ratio of A increases from rAr_ArA​ to rA′r_A'rA′​ while B decreases from rBr_BrB​ to rB′r_B'rB′​.

The swap rate is given by

Definition - 4.1

Exchange rateA−>B=1+∫rArA′p(r) dr∗1rA′−rA−∫rB′rBp(r) dr∗1rB−rB′\text{Exchange rate}_{A->B} = 1 + \int_{r_A}^{r_A'} p(r) \, dr* \frac{1}{r_A'-r_A} - \int_{r_B'}^{r_B} p(r) \, dr * \frac{1}{r_B-r_B'}Exchange rateA−>B​=1+∫rA​rA′​​p(r)dr∗rA′​−rA​1​−∫rB′​rB​​p(r)dr∗rB​−rB′​1​

To evaluate the integral of −p(s) over the interval [r,r′][r,r'][r,r′], we define the function F(r)=∫r1−p(s)ds.F(r) = \int_r^1 -p(s) ds.F(r)=∫r1​−p(s)ds.

Since F(r) is a monotonically decreasing function, it attains its minimum at r=1. This boundary condition F(1)=0 follows naturally from the definition of the integral, as the integral over an interval of zero width vanishes. The closed-form solution for F(r) is derived as follows:

Formula - 4.2

F(r)={1+4rt5−r,0≤r≤rt,(1−r)55(1−rt)4,rt<r<1,0,r≥1.F(r) = \begin{cases} \displaystyle \frac{1 + 4r_t}{5} - r, & 0 \le r \le r_t, \\ \displaystyle \frac{(1 - r)^5}{5(1 - r_t)^4}, & r_t < r < 1, \\ 0, & r \ge 1. \end{cases} F(r)=⎩⎨⎧​51+4rt​​−r,5(1−rt​)4(1−r)5​,0,​0≤r≤rt​,rt​<r<1,r≥1.​

As the system would penalize the action for reducing token B's coverage ratio, while at the same time, reward it for increasing token A's coverage ratio. The value of p(r)p(r)p(r) ensures that only when increasing the coverage ratio of an under-covered asset would be rewarded, and further amount that increases the over-covered asset would not be rewarded as p(r)=0p(r) = 0 p(r)=0 for r≥1r \ge 1r≥1. Similarly, decreasing an under-covered asset will be penalized, while decreasing an over-covered asset would not be penalized.

Scenario 1: Coverage Ratios within normal range

Under normal market conditions, when both coverage ratios of the two assets to be traded remain above 80% (or a configurable threshold), the value of p(r)p(r)p(r) stays near zero. This ensures that swap rates remain stable and attractive for traders, preventing unnecessary slippage while optimizing liquidity efficiency.

Scenario 2: Extreme Coverage Ratios

In abnormal situations, such as when Token A's coverage ratio falls below 60% while Token B's rises to 150%. This implies that Token B is unwanted due to depegging or an increase in Token A's demand.

To safeguard Token A's solvency, the value of p(r)p(r)p(r) would become larger as rrr begins to fall under 60%. Thus penalizing traders for further reducing Token A's coverage ratio. Conversely, the p(r)p(r)p(r) would be higher for trades from Token A to Token B as a reward for bringing the pool back from extreme to equilibrium coverage ratio.

PreviousDeposit and WithdrawalNextLP token value and Fee sharing

Last updated 1 month ago

🎨
↔️