Quick answer

A DEX, or decentralized exchange, is a trading platform built from smart contracts that lets people swap tokens directly from their own wallets. There is no account to open and no deposit to a company. You connect a wallet, choose the tokens, approve the trade, and the contract executes it on the blockchain.

So what is a DEX in practice? It is a piece of public code that holds pools of tokens and follows fixed rules for pricing swaps. That gives users control over their funds and access to a wide range of tokens, but it also hands them the job of checking every detail themselves.

What is a DEX compared with a centralized exchange?

A centralized exchange is a company. It holds customer funds, keeps an internal order book, matches buyers with sellers on its own servers and only touches the blockchain when users deposit or withdraw. A decentralized exchange works the other way around: trades happen on-chain, and funds stay in your wallet until the moment of the swap.

  • Custody. On a DEX you keep your keys. On a centralized platform the provider controls them while funds sit in your account.

  • Access. A DEX is usually open to anyone with a compatible wallet. Centralized platforms typically require registration and identity checks.

  • Listings. Anyone can create a pool for any token on most DEXs, which means more choice and also far more scam tokens.

  • Support. A smart contract cannot refund a mistaken trade. There is no help desk that can reverse a transaction.

DEXs are one of the core building blocks of decentralized finance.

How prices form on a DEX

Most DEXs do not use an order book. They use an automated market maker (AMM), a contract that holds two or more tokens in a liquidity pool and calculates the price from their ratio.

The best-known design is the constant product formula: the pool keeps the product of its two token balances constant. When you buy token A with token B, you add B to the pool and remove A. A becomes scarcer in the pool, so its price rises with each unit you take. Larger trades therefore get a worse average price than small ones.

A simple example with hypothetical numbers: imagine a pool with 100 units of token A and 10,000 units of token B, so 1 A costs about 100 B. If you buy 10 A, the pool must keep 100 times 10,000, or 1,000,000, constant. With 90 A left, it needs about 11,111 B, so you pay roughly 1,111 B, an average of about 111 B per A instead of 100. That gap is price impact, and it shrinks as the pool gets deeper.

Prices on a DEX stay close to the wider market because arbitrage traders buy wherever a token is cheap and sell where it is expensive, pushing pools back into line. Some DEXs also use order books or concentrated liquidity, but the AMM principle is the one most users meet first.

Five-step flow from a connected wallet to a signed token approval, a liquidity pool, a coin swap and a completed checklist, the path of a DEX trade

Where DEX liquidity comes from

The tokens in a pool are supplied by liquidity providers. They deposit pairs of tokens and in return earn a share of the trading fees each swap pays. DEX liquidity is therefore only as deep as the capital that providers are willing to commit, and it can leave quickly.

Providing liquidity has its own risks, most notably impermanent loss, which happens when the prices of the pooled tokens move apart. Our beginner guide to liquidity pools covers both sides in detail, including how fees and impermanent loss interact.

How to swap on a DEX step by step

A typical swap on a DEX looks like this:

  1. Connect your wallet and make sure it is on the right network. A DEX on one chain cannot see your tokens on another.

  2. Keep some native coin for fees. Every on-chain trading action, including approvals, costs gas paid in the network's native asset.

  3. Select the tokens by verified contract address, not just by name or ticker.

  4. Approve the token. The first time you sell a token, the wallet asks you to let the contract spend it. Prefer a limited amount over an unlimited approval.

  5. Set slippage tolerance. This is the maximum price change you accept between submitting and executing. If the price moves further, the trade fails instead of filling badly.

  6. Review and confirm the final amounts, fees and route in your wallet, then wait for the transaction to confirm.

Slippage deserves extra attention. Setting it too high on a thin pool invites bad fills and front-running bots. Read what slippage is in DeFi before your first trade.

Risks of on-chain trading and what to check

The freedom of a DEX comes with risks that centralized platforms partly filter out. Before each swap, check:

  • Token authenticity. Scammers create look-alike tokens with the same name. Compare the contract address with the project's official sources, as explained in how to check a token before swapping.

  • Liquidity depth. A shallow pool means high price impact and difficulty selling later.

  • Approvals. Unlimited approvals to a compromised contract can drain a wallet. Review and revoke old ones.

  • Smart contract risk. Audits reduce but never remove the chance of bugs or exploits.

  • Phishing front ends. Fake websites copy real DEX interfaces. Use bookmarked links.

  • Market risk. Many DEX-listed tokens are highly volatile. Do your own research before buying anything.

DEX or instant exchange?

Knowing what is a DEX and how it prices trades makes it easier to decide when to use one. A DEX is a good fit when you want self-custody, access to tokens on a specific chain and full control over trade settings. It is less convenient when you need to move between different blockchains, since a DEX usually works within one network. In that case an instant exchange such as SimpleSwap can swap coins across many networks with fixed or floating rates, without an account for a basic exchange, while you still receive the result in your own wallet.

FAQ

Do I need an account to use a DEX?

No. You only need a compatible self-custody wallet with the tokens you want to trade and enough native coin to pay network fees.

Why did my DEX swap fail?

Common reasons are slippage tolerance set too low for a fast-moving price, not enough native coin for gas, or a missing token approval.

Are DEXs safer than centralized exchanges?

They remove custody risk from a company but add smart contract, scam token and user-error risks. Neither model is safe by default.

What fees do I pay on a DEX?

Usually a pool trading fee that goes to liquidity providers plus the blockchain network fee. Price impact and slippage are additional hidden costs.

Can I swap between different blockchains on a DEX?

Most DEXs work within a single network. Moving between chains requires a bridge, a cross-chain aggregator or an exchange that supports both networks.