Not financial, legal, or tax advice. DEX trading carries smart contract and market risk.

A decentralized exchange, or DEX, lets people trade crypto directly from their own wallets using smart contracts, without a company holding funds or matching trades on their behalf. It's one of the core applications of decentralized finance. The Ethereum Foundation covers how these venues fit into the wider DeFi picture.

Definition

A DEX runs on smart contracts that execute trades automatically according to fixed rules, rather than a centralized company operating an order book and holding customer funds.

The property that makes this genuinely different is that you never deposit anything. On a centralized exchange, trading means first sending your funds to the company, which then updates its internal database as you trade; the blockchain sees a deposit and, eventually, a withdrawal. On a DEX, your assets stay in your wallet until the moment of the trade, and the swap happens in a single transaction that either completes or does not. There is no account, no balance held by anyone, and nothing to withdraw afterward.

DEX vs. CEX

A centralized exchange (CEX) holds your funds in custody and matches trades internally, similar to a traditional brokerage. A DEX lets you retain control of your own keys throughout, trading directly from your wallet, which removes counterparty risk but shifts responsibility for security onto you.

The trade is a clean swap of one risk for another rather than a reduction. A CEX can fail, freeze withdrawals, get hacked, or spend your deposits, and FTX demonstrated all of those at once. A DEX cannot do any of that, because it never has your funds. In exchange, a DEX will faithfully execute whatever you sign, including a swap into a worthless token or an approval that drains you later, and there is nobody to call afterward.

Each also has practical advantages the other cannot match. A CEX converts actual dollars into crypto, which a DEX cannot do at all, and it offers support, recovery, and a familiar interface. A DEX lists anything immediately, without permission, which is both its great virtue and the reason most scam tokens live there.

AMMs

Most DEXs use an automated market maker (AMM) model, pricing trades algorithmically against liquidity pools rather than matching individual buy and sell orders directly.

Two consequences of that model show up on every trade and are worth knowing by name. Slippage is the gap between the price you are quoted and the price you get, and it grows with the size of your trade relative to the pool, because your own buying moves the price as it executes. Every DEX lets you set a tolerance, and setting it too high is an invitation.

The second is front-running, usually called MEV. Your pending transaction is publicly visible before it confirms, so bots can see a large buy coming, purchase ahead of it, and sell into it, pocketing the difference you paid. It is not a bug being fixed; it is a structural feature of a public queue, and it is the reason a generous slippage tolerance is expensive rather than convenient.

Pros and cons

DEXs offer more control and typically less onboarding friction, but can have less intuitive interfaces, variable liquidity, and expose users directly to smart contract risk. Centralized exchanges offer more convenience and support but require trusting the platform with custody.

Worth adding that "decentralized" is doing less work in that word than it appears. Most DEXs have a website, run by a company, that can be taken down or geo-blocked, and many have admin keys and governance that can change fees or pause contracts. The underlying contracts usually keep running regardless, and knowledgeable users can interact with them directly, but the everyday experience depends on infrastructure someone owns.

Safety

Because trades happen directly from your own wallet, following the same security practices that apply everywhere in crypto, like verifying contract addresses and being cautious with approvals, matters just as much on a DEX as anywhere else.

Two specifics account for most DEX losses, and neither is exotic. The first is buying the wrong token: anyone can create a token called USDC, and a DEX will happily list it, so the ticker means nothing and only the contract address does. Verify it against the project's official source, never a search result or a link in a chat.

The second is approvals. Swapping a token requires granting the DEX permission to move it, which persists after the trade and is frequently unlimited by default. That standing permission is the single most exploited thing in DeFi, since a compromised or malicious contract does not need your keys when it already has your consent. Grant only what is needed, and revoke what you no longer use.

Reaching the right site matters as much as reading the right contract. Fake front-ends for well-known DEXs are a standing business, promoted through search advertisements and looking pixel-identical to the real thing, and they differ in exactly one respect: the contract your approval goes to. Bookmark the venues you use and navigate from the bookmark, because the moment you are relying on a search result you have made the attacker's job trivial.

When to use which

The realistic answer for most people is both, for different jobs. A centralized exchange is where fiat becomes crypto, and there is no alternative for that first step; it is also a reasonable place to trade major assets with deep liquidity and to leave a working balance you can afford to lose. A DEX is where you go for assets no centralized venue lists, for trading without handing over custody, and for anything where you would rather carry your own risk than someone else's.

What is not sensible is treating either as a place to keep savings. Funds on a CEX are exposed to that company's solvency, and funds parked in DeFi are exposed to every contract they touch. Both are venues to pass through, and anything you would be upset to lose belongs in a wallet you control, doing nothing at all.