Chai Protocol

Search…

Getting Started

Product Suite

Security & Contracts

Chai DEX

Chai DEX is a one-stop shop for decentralized swapping trading, liquidity providing and farming on Aurora.

Furthermore, Chai DEX employs both dynamic and stable AMM, which is optimized for trading pegged value crypto assets with minimal slippage.

Market makers are essential in an exchange to provide liquidity, control spreads, and maintain slippages. Since cryptocurrency exchanges work 24x7, the need for automated market makers rose. AMMs democratized cryptocurrency trading by doing away with order books and institutional market makers. Instead, AMMs execute trade automatically using algorithms and liquidity pools. Let’s understand a few basic concepts first.

Having understood what AMMs are, let’s now deconstruct them. You can think of an AMM as a friendly and obedient market maker bot, always willing to quote a price, no matter the time of the day or day of the week.

To quote you a price, the bot uses a mathematical formula (used interchangeably with pricing algorithm or swap algorithm) and works relentlessly in the background. The algorithm implemented varies from the simplex to the complex.

Introducing Stable AMM

The innovation into AMMs mathematical formula continued to find a solution to the slippage (constant product formula) and fixed liquidity (constant sum formula) problems. Hybrid mathematical models, combining the best of many models, rose to prominence. One such model is the stable AMM algorithm.

Stable AMM is a hybrid algorithm. The hybrid combines both Constant Product and Constant Sum models, and the following chart shows the algorithm in relation to constant product and constant sum invariants.

**Constant Sum:**When the liquidity pool portfolio is balanced, the algorithm functions as a Constant Sum formula;**x + y = k**. You can observe the Stable AMM red line staying close to the Constant Sum green*line*, and the price is stable.**Constant Product:**As the liquidity pool portfolio becomes imbalanced, the Stable AMM algorithm functions as a Constant Product formula;**x * y = k**. You can observe the Stable AMM red line now resembling the Constant Product*purple line*, and the price becoming expensive.

Chai liquidity pools implement the Stable AMM mathematical formula to reduce slippage and keep the market liquid. Saddle facilitates trades of stablecoins, where the price is pegged to an underlying asset, bringing in further stability. For example:

The Constant Product formula *does not update* the price of the tokens in the pool with the market movement. The stable AMM formula motivates swaps around price ratio 1.0, well suited for stablecoins. Dynamic pegs are the next evolution of AMMs.

Dynamic pegs will bring the benefits of Stableswaps to cryptocurrency assets which aren’t pegged to another asset. By using an automatic price change mechanism, the algorithm will move the price based on real-time profit margin calculations, to adjust for slippages. Thus, benefiting both the traders and the AMMs.

Last modified 3mo ago

Copy link

Outline

Understanding Automated Market Maker (AMM)

AMM Swap Algorithms

Introducing Stable AMM

Pegged-value assets

Dynamic Pegs