Skip to main content
Important: We do not provide financial advice or custody funds. All transactions occur on third-party platforms.

Decentralized Exchange (DEX)

In simple terms

A decentralized exchange is like a digital marketplace where you can trade cryptocurrencies directly with other people, without needing a middleman company to manage the transaction. Instead of trusting a bank or platform, the trades happen automatically through computer code.

Definition

A peer-to-peer exchange without a central authority.

In depth

A DEX is a peer-to-peer trading protocol built on a blockchain that enables users to swap tokens directly from their wallets using smart contracts, eliminating the need for a centralized custodian. Users retain control of their private keys and funds throughout the transaction, with trades executed and settled on-chain according to predetermined algorithmic rules, often facilitated by automated market makers (AMMs) that use liquidity pools rather than traditional order books. Validators on the underlying blockchain network confirm transactions and maintain consensus on the exchange state, ensuring transparency and immutability of all trades.

How does Decentralized Exchange (DEX) work?

Custody stays with the trader, and trades settle through smart contracts. Most decentralized exchanges use an automated market maker: liquidity providers deposit a pair of assets into a pool, and a formula, commonly reserve A multiplied by reserve B equals a constant, derives the price from the ratio of what is in the pool. To swap, a trader connects a wallet, sends an approval letting the contract spend the token, then sends the swap. The contract takes the input, deducts a fee for providers, and pays out what the formula gives. Larger trades shift the ratio more, so the rate is worse.

An example

A pool holds 100 units of Token A and 10,000 of Token B, so the constant is 1,000,000 and the implied rate is 100 B per A. A trader swaps in 1 A. Reserves become 101 A, so B must fall to 1,000,000 divided by 101, about 9,901, and the trader receives roughly 99 B before fees, under 100 because the trade itself moved the ratio.

Figures are illustrative only.

What beginners get wrong

  • Price impact, not the swap fee, is what makes large trades in shallow pools expensive, and the interface usually shows it in small type next to the quote.
  • Anyone can open a pool for a token that copies a real project's name and logo, so the contract address is the only reliable thing to check.
  • Gas is charged for the attempt, not the outcome. A swap that reverts because slippage moved past the limit still costs the network fee.
  • Supplying liquidity exposes a position to impermanent loss, meaning the pool share can end up worth less than simply holding the two assets separately.

Related terms

Part of

How do you buy cryptocurrency safely? — the subject page for buying crypto, with all 15 of its definitions in one place.

Educational only — not financial advice.