Main

⌘K
🌲Introduction
🎯FAQ
🚀Getting started
📁Set up wallet
🧭Trading on Dradex
🕎Transfer tokens to & from other blockchains
🚜Staking & Farming
🌃List new market
Spot Exchange
Whitepaper
🎉Audit report
🌏Unified Order Book & AMM Liquidity
🚆Deployed Contracts
✏️Fees & Revenues
📘API
🏅Referrals
🤞Retroactive rewards
🎲Listing
🎆Community help center
🗾Policy
🚥Terms of use
⛴️Privacy Policy
Docs powered by archbee 
16min

Unified Order Book & AMM Liquidity

Introduction

Dradex is a protocol for decentralized token exchange on Solana, where an Order Book works together in tandem with an AMM Liquidity Pool to provide the best prices, lowest slippage.

There are problems with current AMM models. Due to the Constant Product mechanism, the AMM Price is based on reserve amounts of tokens in the pool, it is changing as a match happens. A larger match size or volume (compared to the reserve amounts in the pool) would result in a larger difference (or slippage) between the initial LP price and the final matching price. This results in highly volatile markets where arbitragers make a lot of profit and Liquidity Providers suffer substantial amounts of Impermanent Loss.

Standalone order books, on the other hand, suffer for lack of liquidity. In the DEX environment where there are fewer market makers than CEX, launching a new order book is much more difficult compared to AMM liquidity pool , it lacks liquidity and becomes a highly inefficient market. Consequently, there are fewer takers coming in to trade, then fewer makers to place maker orders. It is a death spiral. As a result, a market order would be impractical in these markets because of this lack of liquidity and would result in huge slippage.

Therefore, we come up with Dradex's Unified Order Book & AMM Liquidity Model, which integrates the Order Book model with the AMM Constant Product Liquidity formula, this increases the liquidity, reduces slippage, also provide best price and more options in order book for user to trade.

What is the unified AMM and Order Book exchange model?

The order book model

Document image


The central limit order book (CLOB) is the common model in CEX that matches orders from buyers and sellers based on a set of rules. Market markers create bid (buy) and ask (sell) orders in the order book. Takers fill the current best market maker orders.

Pros:

  • This allows users to create limit orders at a specific price with more flexibility.
  • This reduces the possibility of slippage.

Cons:

  • It requires many market makers to create a tight spread and tradable market.
  • Launching a new market on CLOB is hard due to the lack of liquidity in the beginning.

The Automated Market Maker (AMM) Liquidity Pool Model

Document image


AMM is the common model for DEX. The liquidity providers deposit both tokens into the liquidity pool. Users could trade against the liquidity pool by swapping tokens based on the constant product formula.

Pros:

  • The liquidity of tokens is always provided by the AMM system.

Cons:

  • Users can only swap at the current liquidity pool’s price and cannot enjoy any other advanced trading features.
  • Liquidity providers are exposed to impermanent losses.
  • The larger the order, the higher the slippage.

The unified AMM and Order Book model

Document image


The liquidity pool becomes a maker in the central limit order book. Apparently, if we have more makers, the unified market will be more efficient, offer deep liquidity, and better prices for users.

As mentioned above, the larger the size matched against the liquidity pool, the higher the slippage. Therefore, in order to provide the best price, we need to determine how much volume is matched against the liquidity pool and how much volume is matched against other market markers in the order book.

The optimal volume and algorithm proof can be found here: https://www.dradex.io/whitepaper.pdf

Below are two examples demonstrating that a unified model gives the best price, better liquidity, and minimum slippage.

Document image


The above is an example, the order book is quite liquid, while the size of the order is fairly large compared to the liquidity in the liquidity pool. The single liquidity pool model in this case underperforms. The unified AMM & order book model gives the best result.

Document image


What are the unified AMM and Order Book model advantages?

Best price compared to single liquidity pool model and order book model.

Given the same state of market makers/ liquidity pool, the unified model offers the best price. This has been proven in our whitepaper.

Deeper liquidity, less slippage in Order book market order

Not many order book exchanges allow the market order due to its huge slippage in the less liquid market. However, with the unified AMM & Order Book model, the market order in the order book is at least equal to or better than the swapping in the liquidity pool.

It is easier to launch a new market on a unified AMM & Order book model

Launching a new market on an order book exchange is difficult due to the lack of liquidity and makers in the beginning. With a unified model, users could tap the liquidity not only from market makers but also from the liquidity pool.

Furthermore, a unified model can offer users advanced trading features from an order book compared to a single liquidity pool model.

Advantages of stable pool in unified model over other stable pool formulas

For the stable pairs, the market is more stable, unless there are depegged events.

The common model for a stable pair in the DEX market is the liquidity pool using a stable formula. However, when there is a depegged event, there is a huge arbitrage opportunity for arbitrageurs to swap the depegged coin to other stable coins with less cost due to the stable formula. This already happened during the UST depegging event.

Therefore, a good stable pair market should ensure the price reflects the market demand in both stable price periods and depegging events.

The liquid order books in big CEXs are the most efficient for the stable pair, due to the market makers placing the order with the price reflecting the current demand.

On the other hand, a normal liquidity pool reflects the market demand better than a stable formula pool. However, it still has a huge slippage when matching against huge orders.

A unified AMM & Order book model helps to solve these problems. The order book market makers help to stabilize the normal liquidity pool, by reducing the slippage when matching against large orders. Furthermore, the market makers and the normal liquidity pool reflect the market demand, when depegging events happen, the liquidity providers are protected against the arbitrager draining the other non-depegged coins.

Updated 03 Mar 2023
Did this page help you?
Yes
No
UP NEXT
Deployed Contracts
Docs powered by archbee 
TABLE OF CONTENTS
Introduction
What is the unified AMM and Order Book exchange model?
The order book model
The Automated Market Maker (AMM) Liquidity Pool Model
The unified AMM and Order Book model
What are the unified AMM and Order Book model advantages?
Best price compared to single liquidity pool model and order book model.
Deeper liquidity, less slippage in Order book market order
It is easier to launch a new market on a unified AMM & Order book model
Advantages of stable pool in unified model over other stable pool formulas