What is a DEX? How decentralized exchanges really work
A DEX lets you swap crypto straight from your own wallet, with no company in the middle. That gives you more control, and it means no one is there to catch a mistake. Here's how it really works.
The short answer
A DEX, or decentralized exchange, is an app that runs on a blockchain. Instead of a company matching buyers and sellers, a program called a smart contract does the swap.
You connect your own wallet, pick two tokens, and swap. The coins never sit with a company.
Uniswap, which launched on Ethereum in 2018, made this style popular. Many DEXs now run on Ethereum, Solana and other networks.
How it's different from a regular exchange
| Centralized exchange | DEX | |
|---|---|---|
| Who runs it | A company | Code on a blockchain |
| Who holds your coins | The company | You, in your wallet |
| Sign-up | Account and ID check | Connect a wallet |
| Pay with dollars | Usually yes | Usually no, crypto in and crypto out |
| Which tokens | Ones the company lists | Almost anything anyone creates |
| If something goes wrong | Support team | Usually no one |
That "almost anything" row matters. On a DEX, anyone can create a token and start trading it. That includes fake copies of real tokens.
How the swap actually works: liquidity pools
Most DEXs don't use an order book. They use a liquidity pool, a pot holding two tokens.
Here's a simple picture.
- A pool holds, say, ETH and USDC.
- People called liquidity providers put both tokens in the pool. They earn a small fee from each swap.
- When you swap USDC for ETH, you add USDC to the pool and take ETH out.
- A math formula sets the price based on how much of each token is left. Take ETH out, and ETH gets a bit pricier in that pool.
This is called an automated market maker, or AMM. No person sets the price. The formula does.
Price impact and slippage
Because your own swap moves the price in the pool, big swaps in small pools get worse prices. That's called price impact.
An illustration, in round numbers: in a deep pool, a $500 swap might move the price a tiny fraction. In a small pool holding only a few thousand dollars, the same $500 swap could move it by several percent against you. A math example, not a promise.
Price can also move between clicking "swap" and the swap going through. That gap is Slippage.
DEXs let you set a slippage limit. If price moves past it, the swap cancels. A tight limit protects you. A very loose one invites bots to take advantage (more below).
The costs of using a DEX
- Network fee. Every swap is a blockchain transaction. On Ethereum, that's Gas fees, which rise when the network is busy. Many people use cheaper networks built on top of Ethereum. See layer 2 explained.
- Swap fee. A small percent of each swap goes to the pool.
- Price impact. Bigger in small pools.
The risks to know
Fake tokens
Anyone can create a token called "USDC" or name it after a famous coin. It won't be the real one. Always check the token's contract address against the project's official site, not a search result or a message.
Token approvals
To swap a token, you first give the DEX permission to move it. That's called an approval. Some scam sites ask for unlimited approval, then drain your wallet later.
- Only connect your wallet to sites you've typed in yourself.
- Read what you're signing. If a message asks to approve "unlimited" spending on an unfamiliar site, stop.
- Check and remove old approvals from time to time with a token-approval checker.
Rug pulls
On a DEX, a token's creator can sometimes pull all the money out of the pool, leaving holders with a token no one can sell. See how to spot a rug pull.
Bots that trade around you
Some bots watch for pending swaps and trade just before and after them, pocketing the difference. It's sometimes called a "sandwich." A tight slippage limit helps.
Code bugs
Smart contracts can have bugs, and hacks of DeFi apps have cost users large sums. Older, widely used DEXs are generally better tested than brand-new ones, but none are risk-free.
The rule that covers most of it: your recovery words never go into any website, ever. A DEX never needs them. Any site that asks is a scam.
Who a DEX suits (and who it doesn't)
It can make sense if you already hold coins in your own wallet, understand network fees, and want a token that isn't on regular exchanges.
It's probably not the place to start if you're buying your first coin, or don't yet feel sure about wallets and addresses. A checked, regulated exchange is simpler. See crypto exchanges explained.
Many tokens that only trade on DEXs are new and tiny. Most new tokens lose nearly all their value. If you look at them at all, only use money you could afford to lose entirely, sized from your risk rules.
Thinking like a trader on a DEX
The same habits apply anywhere:
- Know your risk before you click. The position size calculator does the math.
- Count the costs: gas, swap fee and price impact can turn a small trade into a costly one.
- Prefer deep pools and well-known tokens while you learn.
- Practice reading the chart first. Our crypto chart guide covers it.
Try it today, with no money: open a DEX's swap screen without connecting a wallet. Enter a small and then a large amount for the same pair. Watch the "price impact" number change. That one number explains most of how pools work.
Questions
What is a DEX in crypto?
A decentralized exchange is an app on a blockchain that lets you swap tokens straight from your own wallet. Smart contracts do the swap, so no company holds your coins.
Is a DEX safer than a centralized exchange?
It removes the risk of a company losing your coins, but adds others: fake tokens, scam approvals, code bugs and no support team. Which is safer depends on how careful you are.
Do I need to verify my identity to use a DEX?
Usually not. You just connect a wallet. Some websites that front a DEX block certain countries or tokens, and you're still responsible for your taxes.
Why did I get a worse price than shown on a DEX?
Price impact and slippage. Your swap moves the price in the pool, and price can change before your swap goes through. Small pools and loose slippage settings make it worse.
Can I buy crypto with dollars on a DEX?
Usually not directly. DEXs swap one token for another. Most people buy their first coins on a regulated exchange, then move them to a wallet.
Want the next step? We'll walk you through it.
Four free lessons by email, one every few days — each with a 10-minute exercise on a real chart.
Send Me the Free Lessons 4 short emails · No spam · Unsubscribe anytimeOr see the whole method, step by step:
See What’s Inside the Course Try everything free first. Decide when you're ready. · Open the free chart tool (works in the TradingView phone app)One chart idea a day, in plain English. Follow along: