What Is a DEX? How Decentralized Exchanges Work
A decentralized exchange, or DEX, lets people trade crypto directly from their own wallets without handing custody to a company. This guide explains how DEXs work, what an automated market maker is, and the trade-offs to understand before you use one.

If you have ever swapped one token for another without creating an account or uploading an ID, you have probably used a decentralized exchange. DEXs have become a core building block of decentralized finance (DeFi), and understanding them is a useful step for anyone learning how crypto markets work.
What a DEX actually is
A decentralized exchange is a marketplace for swapping crypto assets that runs on smart contracts rather than a central company. On a traditional or "centralized" exchange (often shortened to CEX), you deposit funds into the platform, and the company holds them for you while you trade. A DEX flips that model: you connect a self-custody wallet, and trades settle directly on the blockchain.
The key difference is custody. With a DEX, you keep control of your private keys the whole time, and the swap happens peer-to-contract rather than peer-to-company. Because the rules live in open-source code, anyone can inspect how a given exchange behaves.
“The real innovation of a DEX is not lower fees, but that no single party ever has to hold your coins for you.”
How swaps happen behind the scenes
Most early exchanges matched buyers and sellers through an order book. Many popular DEXs instead use a design called an automated market maker.
Automated market makers and liquidity pools
An automated market maker (AMM) replaces human counterparties with a pool of funds. Users called liquidity providers deposit pairs of tokens into a shared pool, and a mathematical formula sets the price based on the ratio of assets in that pool. When you swap, you trade against the pool rather than against another individual, and liquidity providers earn a share of the trading fees in return.
Wallets, gas, and settlement
To use a DEX, you connect a compatible wallet and approve the transaction. The network charges a fee, often called gas, to process it. Once confirmed, the swapped tokens arrive in your wallet with no company acting as a go-between. On-chain data indicates that activity is spread across many networks, so fees and speed can vary widely depending on which blockchain you use.
Benefits and risks to weigh
DEXs offer some clear advantages: self-custody, permissionless access, and transparency, since transactions are visible on a public ledger. Analysts say this openness is part of what makes DeFi appealing to builders.
There are real trade-offs too. Smart contracts can contain bugs, and a flawed contract may put funds at risk. Prices can move between the moment you submit a swap and when it settles, an effect known as slippage. Providing liquidity carries its own quirk, sometimes described as impermanent loss. And because you hold your own keys, a mistake is usually irreversible — there is no support desk to reverse a transaction.
None of this is investment advice. Learning to read a contract's details, start small, and double-check token addresses are habits that reports suggest help newcomers avoid common mistakes.
Key takeaways
- A DEX lets you swap crypto directly from your own wallet, without giving custody to a company.
- Many DEXs use an automated market maker and liquidity pools instead of a traditional order book.
- You pay network fees (gas), and prices can shift slightly through slippage before a trade settles.
- Benefits include self-custody and transparency; risks include smart-contract bugs and irreversible mistakes.
- Because you control your keys, careful habits matter more than they do on a centralized platform.
DeFi & Ethereum Editor
Elena leads our DeFi and Ethereum coverage. A former protocol analyst, she explains yield, governance and smart-contract risk without the jargon.



