Page cover image

πŸ”Swap

Utilizing a stableswap 2.0 model, Wombat users can: swap stablecoins at hyper-efficient exchange rates with minimal slippage.

The swap price is defined by the rate of change in cash of asset x per change in cash of asset y. Defined as:

exchangeΒ rate=βˆ‚Axβˆ‚Ay=1+Arx21+Ary2exchange\ rate = \frac{\partial A_x}{\partial A_y} = \frac{1 + \frac{A}{r_x^2}}{1 + \frac{A}{r_y^2}}

As you may have noticed, the exchange rate is independent of the number of token x and token y in the pool and depends solely on the coverage ratio.

Example

Assume AA = 0.05, rxr_x = 80% and ryr_y = 150%. We have

exchangeΒ rate=1+0.050.821+0.051.52β‰ˆ1.055exchange\ rate = \frac{1 + \frac{0.05}{0.8^2}}{1 + \frac{0.05}{1.5^2}} \approx 1.055

If we reverse the direction, swap from token y to token x. We have

exchangΒ rate=1+0.051.521+0.050.82β‰ˆ0.95exchang\ rate = \frac{1 + \frac{0.05}{1.5^2}}{1 + \frac{0.05}{0.8^2}} \approx 0.95

Incentives for convergence of coverage ratio

Wombat incentivizes a swap if the coverage ratio of two tokens is converged and penalizes if it diverges, as shown in the above example. It helps keep the pool in a healthy state and prevents a token from being defaulted. Learn more in below guide:

Deposit Gain and Withdrawal Fee

Last updated