A DEX, short for decentralized exchange, is a crypto trading platform that runs on smart contracts instead of a company’s private servers — you trade directly from your own wallet, without creating an account or handing custody of your funds to anyone else. That last part is the real distinction: using a DEX means connecting a crypto defi wallet you actually control, rather than depositing money with an exchange the way a centralized platform works. This page walks through what a DEX actually is, how a trade executes behind the scenes, how it differs from a centralized exchange in practice, and the wallet-security habits that matter specifically because you’re the one holding the keys.

What a DEX actually is
On a centralized exchange (CEX), you create an account, deposit funds, and the exchange itself holds custody of that money until you withdraw it. The exchange runs a private order book and matches your buy or sell order against someone else’s, off-chain, on its own servers. A DEX skips all of that: there’s no account to create and no company holding your funds. Instead, you connect a wallet you already control to a website that talks directly to smart contracts living on a public blockchain, and the trade settles on-chain, visible to anyone.
This “non-custodial” structure is the single biggest thing that separates a DEX vs. CEX, and it cuts both ways. Nobody can freeze your account or lose your funds in an exchange-side hack, because the exchange never held them. But it also means there’s no customer support line to call if you make a mistake — a wrong address, an approved malicious contract, or a bad trade settles permanently, with no company standing behind it to reverse anything. (A short reference for any unfamiliar term on this page, and every other, lives in the glossary.)
How a trade actually executes (AMMs and liquidity pools)
Most modern DEXs don’t use an order book at all. Instead they use an Automated Market Maker (AMM) model built around liquidity pools — smart contracts that hold reserves of two tokens (say, ETH and USDC) supplied by other users called liquidity providers. An algorithm maintains a mathematical relationship between the two reserves, and when you trade, you’re swapping directly against that pool’s reserves, not against a specific other person’s order.
The price you get shifts as your trade changes the pool’s ratio of the two tokens — a small trade against a large, deep pool barely moves the price, but a large trade against a smaller pool can shift it noticeably before your trade even finishes executing. This effect, called slippage, is why DEX interfaces show you an estimated price impact before you confirm a trade. Liquidity providers earn a share of the trading fees generated by the pool in exchange for supplying the reserves that make trading possible in the first place — though supplying a pool carries its own separate risk (impermanent loss) that’s outside the scope of this particular page.

DEX vs. CEX: the real trade-offs
Neither structure is simply “better” — they trade different things for different benefits. A CEX generally offers deeper liquidity, faster execution, and lower slippage on large orders, because it’s matching against a much bigger aggregated order book and often provides its own market-making. A DEX offers self-custody and permissionless access — nobody can lock you out or require identity verification — but liquidity is only as deep as what’s actually been deposited into that specific pool, and execution quality varies a lot between a major, well-funded pool and a small, thinly traded one.
The wallet-security side of using a DEX
Because you’re interacting directly with smart contracts, using a DEX introduces a wallet-security consideration that simply doesn’t exist on a CEX: token approvals. Before a DEX’s smart contract can swap a token out of your wallet, you have to explicitly grant it permission to move that token. If that contract is malicious, or gets compromised after you approved it, an unlimited approval can let it drain the approved token from your wallet without asking again. This is a genuinely different risk model from a CEX account, where the exchange (not a smart contract you approved) controls custody, and it’s exactly why the wallet you connect to a DEX, and how carefully you manage what it’s approved to do, matters as much as the trade itself.

Risks worth understanding before using one
Beyond token approvals, a few risks are specific to DEX usage and worth knowing before connecting a wallet. Because deploying a token or a front-end on a DEX generally requires no permission or listing review, fake interfaces that mimic a real DEX’s design are a documented phishing vector — typing a DEX’s URL directly rather than clicking a link from an unverified source is a standard precaution. Smart contract risk is also real: even a well-intentioned DEX’s code can contain a bug or be exploited, and unlike a CEX hack, there’s typically no company positioned to make affected users whole afterward. None of this means a DEX is inherently unsafe to use — it means the risk model is different from a CEX, and worth understanding on its own terms rather than assuming the two are interchangeable.
A concrete example: what actually happens during a swap
Walking through an actual trade end to end makes the pieces above easier to hold together. Say you want to swap one token for another on a DEX. First, you connect a self-custody wallet to the DEX’s website — no account, no deposit, just a connection that lets the site see your wallet address and propose transactions for you to sign. Next, if you haven’t already approved the token you’re trading away for use with this specific contract, you’ll be asked to sign a token-approval transaction first, specifying (or leaving unlimited, if you don’t change the default) how much of that token the contract can access.
Once that’s in place, you enter the amount you want to trade and the interface shows an estimated output amount, along with the expected price impact based on the pool’s current depth. When you confirm, your wallet asks you to sign the actual swap transaction, which is then broadcast to the network. The transaction gets picked up by the blockchain, executes against the liquidity pool’s smart contract exactly as written, and settles on-chain within seconds to a couple of minutes depending on network conditions and the gas fee paid. There’s no further step and no company account to check afterward — the trade is done the moment it’s confirmed on-chain, visible in the pool’s public transaction history to anyone who looks.

Common misconceptions about DEXs
- “A DEX is always cheaper than a CEX.” Not necessarily — a DEX trade includes a network gas fee on top of any pool trading fee, and on a congested network that gas fee alone can exceed what a CEX would charge for the same trade.
- “Non-custodial means risk-free.” Self-custody removes exchange-custody risk specifically, but it adds smart-contract and token-approval risk that doesn’t exist on a CEX account at all.
- “Every DEX pool has the same liquidity depth.” Liquidity varies enormously pool to pool, even for the same token, depending entirely on how much has actually been deposited by liquidity providers.
- “A DEX interface being open-source or well-known means every pool on it is safe to trade.” The DEX’s own code can be legitimate while a specific token’s pool on it is still a low-liquidity or even fraudulent listing — the platform and any individual pool on it are separate things to evaluate.
How to evaluate a DEX before connecting a wallet
- Verify the URL directly. Type it in rather than clicking a link from a search ad, social post, or DM.
- Check the pool’s depth before a large trade. A shallow pool means more slippage than the interface’s headline price might suggest.
- Grant the smallest approval that works. Avoid unlimited approvals where a specific trade amount would do.
- Review and revoke old approvals periodically. A contract you approved months ago and forgot about is still a live risk.
- Understand there’s no recourse. A settled on-chain trade or a drained approval generally can’t be reversed by anyone.
