Decentralized Exchange (DEX)

A peer-to-peer crypto marketplace that uses smart contracts to let users trade directly from their wallets without intermediaries.

A decentralized exchange (DEX) is a peer-to-peer crypto trading platform where users swap assets directly from their own wallets instead of depositing funds with a centralized company. Most DEXs rely on smart contracts, on-chain programs that handle trade execution, pricing logic, and settlement without requiring a traditional intermediary.

How a DEX works

On a DEX, you connect a self-custody wallet and approve a smart contract to move a specific token amount for a trade. When you submit a swap, the smart contract routes the transaction, updates balances, and finalizes settlement on the blockchain. Many popular DEX designs use automated market makers (AMMs), which price trades using liquidity pools funded by other users. For example, rather than matching a buyer and seller in an order book, an AMM lets you trade against a pool of two tokens whose ratio shifts as swaps occur.

DEX vs. centralized exchange (CEX)

Compared with a centralized exchange, a DEX typically offers greater self-custody and censorship resistance because you keep control of your private keys and funds remain in your wallet until a trade executes. However, users take on more responsibility, including managing wallet security, paying network fees, and double-checking token contract addresses to avoid scams. Liquidity can also vary by trading pair and blockchain, which affects slippage, the difference between the expected price and the executed price.

Risks and real-world use

DEX activity depends on smart contract security and market conditions. Vulnerabilities in contracts, malicious tokens, or front-running can lead to losses, and AMM pools can expose liquidity providers to impermanent loss when prices move.
DEXs matter because they enable open, permissionless trading infrastructure, expanding access to crypto markets while highlighting the trade-offs between autonomy, usability, and risk.