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.
- Wallet signs txyou authorize the swap; no deposit first
- Contract executeson-chain; atomic; immutable once confirmed
- Funds returned to walletyou never lost custody
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.
Key takeaways
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.