How Crypto Actually Trades

CEX vs DEX: Two Different Machines

Centralized and decentralized exchanges share a purpose but differ in every structural detail, and choosing between them is always a tradeoff, not a moral stance.

Both a centralized exchange and a decentralized exchange let you swap one asset for another. Everything else is different: who holds your funds, how price is discovered, who can participate, and where the failure modes live. Understanding the mechanics of each is more useful than picking a side.

How a CEX works

A centralized exchange runs a traditional limit order book on private infrastructure. When you deposit, you transfer custody to the exchange. Your "balance" is a database entry. Matching happens off-chain at millisecond speed. KYC is required in most jurisdictions. The exchange is a single entity you are trusting with your funds, your identity, and your trade history.

  • Order book matching: bids and asks are queued by price, matched when they overlap. Depth is visible in the order book.
  • Custodial by design: the exchange controls the private keys. Withdrawal requests are processed by their systems.
  • Counterparty risk is concentrated: if the exchange becomes insolvent, freezes withdrawals, or is hacked at the custody layer, users are creditors, not key holders.
  • Speed and liquidity: for major pairs, CEX order books are deep and execution is fast. Spreads on BTC/USDT on Binance are fractions of a basis point.

How a DEX works

A decentralized exchange executes swaps via smart contracts on a public blockchain. The most common model today is the automated market maker (AMM), though on-chain order books exist on faster chains. You keep custody throughout: your wallet connects to the contract, signs a transaction, and the swap settles atomically on-chain. No account, no KYC, no deposit.

  1. Wallet signs txyou authorize the swap; no deposit first
  2. Contract executeson-chain; atomic; immutable once confirmed
  3. Funds returned to walletyou never lost custody
A DEX is permissionless by design. A new token can launch a pool with no listing process, no approval, no gatekeeping. This is also why DEXes are where most scam tokens and rug pulls originate.

The real tradeoffs

  • Speed: CEX wins. DEX execution speed is bounded by block time, 12 seconds on Ethereum, 400ms on Solana, plus confirmation wait.
  • Custody: DEX wins. You never hand keys to anyone.
  • Liquidity on majors: CEX wins. Institutional market makers operate on CEX order books.
  • Access to new tokens: DEX wins. Any token with a pool is tradeable immediately.
  • Privacy: DEX is pseudonymous but fully transparent on-chain. CEX has KYC. Neither is truly private.
  • Failure mode: CEX failure is counterparty insolvency. DEX failure is smart contract exploit or oracle manipulation.
Decentralization does not mean trustless in practice. DEX aggregators, bridges, oracle providers, and upgrade-key holders all introduce dependencies. "DEX" is a spectrum, not a binary.

Key takeaways

1A CEX runs an off-chain order book and holds custody of user funds, making counterparty risk the dominant concern.
2A DEX executes on-chain via smart contracts, preserving user custody but introducing contract and oracle risk.
3For major pairs, CEX liquidity and speed are meaningfully better than most DEX pools.
4DEXes are permissionless, which enables fast access to new assets and creates a favorable environment for scam tokens simultaneously.
5Choosing between CEX and DEX is a tradeoff matrix, not a values statement.

Educational content only, not financial advice. Trading and investing carry real risk of loss, including your entire capital. Do your own research and consult a licensed professional before making financial decisions.

This is one lesson of 541.

The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.