Overview
A decentralized exchange, or DEX, enables peer-to-peer cryptocurrency trading directly from users' wallets without a central authority or custodian. Instead of an order book run by a company, DEXs use smart contracts to match buyers and sellers, typically through automated market makers or on-chain order books. Anyone can list an asset or provide liquidity without permission.
How It Works
Most DEXs use automated market maker (AMM) pools: users deposit pairs of assets into smart contract pools, and trades swap against the pool at prices set by a mathematical formula. A user who wants to trade approves the token via their wallet, and the contract executes the swap atomically. For order-book DEXs, an off-chain matching engine finds counterparties while settlement happens on-chain.
Why It Matters
DEXs remove the need to trust an exchange with your funds and open trading to any asset, including newly launched tokens that centralized platforms would not list. They are a core pillar of DeFi because they provide the liquidity and price discovery that lending, derivatives, and yield products build on. Their trade-offs are slippage, gas costs, and the need for users to take custody and manage smart contract risk themselves.
Related Concepts
DEXs are built on Automated Market Makers and Liquidity Pools, which determine pricing and depth. LPs face Impermanent Loss, and arbitrageurs extracting MEV affect the prices traders receive.