How Decentralized Exchanges Work: A Plain-English Overview
Order books, automated market makers, and the mechanics behind on-chain swaps.
A decentralized exchange, or DEX, lets users swap tokens directly on a blockchain without an intermediary holding their funds. The two dominant designs are on-chain order books and automated market makers.
An automated market maker replaces the order book with a pool of two or more tokens supplied by liquidity providers. A mathematical formula sets the swap price based on the ratio of tokens in the pool. Anyone can add liquidity and earn a share of trading fees, but they also take on price-exposure risk to the pooled assets.
On-chain order-book DEXs work more like a traditional exchange, matching buy and sell orders. They typically live on high-throughput chains or Layer 2s where the cost of posting and updating orders is low enough to be practical.
Either way, the user's wallet signs the swap directly, and the funds never sit with a custodian. That reduces counterparty risk but shifts responsibility for key management, transaction review, and contract vetting onto the user.