Centralized Exchange (CEX)
- You deposit assets into the exchange's wallets. They hold custody. Your account balance is an IOU.
- Orders go into a centralized order book. When a match happens, the exchange updates its internal ledger.
- Fast, tight spreads, deep liquidity, fiat on/off-ramps.
- Risk: hacks, insolvency (FTX 2022), account freezes, withdrawal delays.
Decentralized Exchange (DEX) — AMMs
- You trade directly from your wallet; you keep custody.
- No order book. A smart contract holds pools of two tokens and uses a pricing formula — typically
x × y = k (constant product). - A swap shifts the ratio, moving the price. Large swaps move price more — this is slippage.
- Risk: smart contract bugs, bad frontends, MEV (your tx visible in mempool before inclusion).
The tradeoff in one line
CEX optimizes for liquidity + speed + convenience; you pay with custody risk. DEX optimizes for self-custody + transparency; you pay with slippage + gas.
Impermanent loss (preview for DeFi 101)
If you provide liquidity to a Uniswap pool and the price moves, you end up with a different ratio than you started. Compared to just holding the two tokens, you lose some — this is impermanent loss. We cover the math in the DeFi track.