Written by Pablo Gómez
Founder & CEO at Metlabs · Reviewed on October 11, 2026
A DEX contrasts with a CEX (Centralized Exchange like Binance or Coinbase), where an operator custodies funds and keeps an internal order book off-chain. On a DEX the assets stay under the user's control until the transaction settles atomically on-chain, meaning it either executes in full or reverts. There are two main architectures. The dominant one is AMM-based DEXs, with no order book, where the price is derived from liquidity pools through a mathematical formula. The other replicates an order book, on-chain or hybrid, as seen in perpetual derivatives venues.
This matters because it is the secondary market of DeFi. It enables non-custodial trading, permissionless access (anyone can list a pair by creating a pool) and composability with other protocols. The typical flow chains a swap router, the pool contracts, a price-calculation function and on-chain events. The user pays network gas plus a protocol or liquidity-provider fee.
Sources
Also known as
- Decentralized Exchange





