What does “decentralized exchange (DEX)” mean?
Also called: decentralised exchange, crypto DEX
An exchange where swaps are carried out by smart contracts on a blockchain: there's no account to open, you trade straight from your own wallet, and your coins stay in your hands. Prices usually come from a liquidity pool's formula.
In detail
To buy coins on a centralized exchange, you first open an account and hand your money and coins to the exchange to hold, and its system matches the orders. A decentralized exchange hands that job to smart contracts on a blockchain: you connect your own wallet directly, sign to confirm, and the contract swaps one token for another, with your coins in your own hands the whole time.
Most decentralized exchanges have no order book; they quote prices from liquidity pools instead. A pool holds two tokens, the price comes from the ratio of the two amounts, and the more you buy, the bigger the price impact. On top of the pool's trading fee, each trade pays the blockchain's network fee (gas). You set a slippage tolerance when you trade, and if the execution is too far from the quote, the trade fails and is reverted.
Decentralized doesn't mean risk-free: contracts can have bugs, fake tokens and phishing sites are everywhere, and granting an approval to a malicious contract lets it move your coins out. There's no customer service to reverse a trade, so mistakes usually can't be undone.
Example
You want to swap 1,000 USDT for ETH. Your wallet first asks you to sign an approval letting the contract use the 1,000 USDT, then a second signature for the swap. The contract gives you ETH at the pool's ratio at that moment, minus the pool's fee (illustrative 0.3%, or 3 USDT), and you pay a gas fee on top.
Common mistake
Thinking every token you can find on a decentralized exchange is genuine. Anyone can create a token and a pool, and names and logos can be copied, so check the contract address rather than going by the name.
Learn “decentralized exchange (DEX)” in an animated lesson
Common questions about decentralized exchange (DEX)
What's the difference between a decentralized and a centralized exchange?
A centralized exchange holds your assets for you and matches trades on an order book. On a decentralized exchange, smart contracts carry out the swaps and your assets stay in your own wallet, but if something goes wrong, nobody can reverse it for you.
What fees do you pay to trade on a decentralized exchange?
Usually two: the pool's trading fee (which goes to the liquidity providers) and the blockchain's network fee (gas). For large trades, add the hidden cost of price impact.
Related terms
See how “decentralized exchange (DEX)” works for yourself with an animation you can drag and play.
Go to “Decentralized Exchanges and Liquidity Pools”