🔄 Trading Mechanics: Order Books vs AMMs

Understand how CEX order matching differs from DEX liquidity pools

📊 How Trading Works on Each Exchange

CEXs and DEXs use fundamentally different mechanisms to facilitate trades. Understanding these differences is key to choosing the right platform.

🎮 Interactive: Trading System Explorer

Compare how order books and AMMs execute trades:

📊

Order Book (CEX)

Traditional market with buy and sell orders matched centrally

How It Works
Buyers and sellers place limit/market orders. Exchange matches orders at best price.
Example
Binance Order Book
Trade Execution Steps
1
Place Order
User submits buy/sell order with price and quantity
2
Order Queue
Order added to order book (bids/asks sorted by price)
3
Matching Engine
Centralized engine matches orders at best prices
4
Settlement
Balances updated instantly in exchange database
Liquidity Source
Professional market makers provide liquidity for tight spreads
✓ Advantages
  • Deep liquidity
  • Fast execution
  • Limit orders
  • Stop losses
  • Low slippage
✗ Disadvantages
  • Centralized control
  • Custody risk
  • Can be manipulated

🎮 Interactive: Price Impact Comparison

See how the same trade executes differently on each system:

$100$5,000
📊

Order Book (CEX)

Base Price:$2000
Slippage:0.00%
Final Price:$2000.00
Execution Time:~50ms
Order Book Depth
Deep liquidity from market makers → minimal slippage even for large orders
🤖

AMM (DEX)

Pool Price:$2000
Price Impact:-0.00%
Final Price:$1999.99
Execution Time:~15-120s
Formula: x × y = k
Larger trades deplete pool reserves → higher price impact
Key Insight: For small trades, both systems perform similarly. DEX simplicity might be preferable.

Real-World Examples

🟣

Binance (CEX)

Model: Centralized order book
Speed: ~50ms execution
Volume: $30B+ daily
Pairs: 600+ trading pairs
Professional market makers provide liquidity. Users deposit funds to exchange wallets.
🦄

Uniswap (DEX)

Model: Automated Market Maker (AMM)
Speed: ~15-120s (Ethereum blocks)
Volume: $1-2B daily
Pairs: Unlimited (any ERC-20)
Anyone can create pools and provide liquidity. Users trade directly from their wallets.
💡

When to Use Each

Use Order Book (CEX) for:
  • • Large trades requiring deep liquidity
  • • Active trading with limit orders and stop losses
  • • Day trading requiring instant execution
  • • Fiat on-ramps (buying crypto with USD)
Use AMM (DEX) for:
  • • Small-to-medium trades with acceptable price impact
  • • Trading new tokens not yet on CEXs
  • • Maintaining self-custody and privacy
  • • Providing liquidity to earn fees