DEX (decentralized exchange)
A DEX is an exchange built on smart contracts: no accounts, no registration, no custody of your funds. You swap tokens straight from your own wallet, and the price comes from a liquidity pool rather than an order book.
How it works
A pool holds two assets, deposited by other users. The contract keeps their product constant: buying one token takes it out of the pool and puts the other in, the ratio shifts, and that shift is the new price.
So the price depends on trade size relative to the pool. In a deep pool a thousand-dollar swap barely moves the rate; in a shallow one the same thousand moves it by whole percent.
Your funds stay yours throughout: the contract is granted the right to take tokens for exactly this operation. Nobody can freeze an account or refuse a withdrawal, and equally nobody can help when you get something wrong.
DEX or exchange
What actually differs when swapping the same amount.
| Custody | yours / the exchange's |
| Identity check | none / KYC |
| Swap fee | 0.05–1% + gas |
| New tokens | immediately / after listing |
On major pairs an exchange is usually cheaper once gas is counted; a DEX wins where a token is not listed yet, or where not handing over custody matters.
Where the risk sits
- Impostor tokensCreating a token with any name and logo costs nothing. Verify the contract address, not the name in a list.
- Slippage in a thin poolA large trade in a small pool fills well below the screen price. Cap your tolerance instead of raising it.
- Sandwich attacksBots see your trade before it executes and profit from it whenever your slippage tolerance is set wide.
- A contract bugMoney in a pool is protected by code alone. A contract exploit is neither insured nor reversible.