FundamentalsBeginner

What is a DEX? Decentralized vs Centralized Exchanges

How decentralized exchanges price trades with AMMs and order books, how they compare to centralized exchanges, and why aggregators get better rates.

ChainBridge ResearchUpdated 5 min read

On this page7 sections

Key takeaways

  • A DEX is a set of smart contracts that let you trade straight from your wallet: no deposit, no account, no custody.
  • Most DEXs are automated market makers: you trade against a pool whose price moves with every trade.
  • Centralized exchanges are faster and offer support; DEXs remove the risk of an exchange freezing or losing your funds.
  • Liquidity is spread across many pools, so aggregators search them for you. ChainBridge compares three aggregators and keeps the best net amount.

What is a decentralized exchange?

A decentralized exchange (DEX) is a trading venue run by smart contracts instead of a company. You connect your wallet, choose a pair and sign one transaction. The contract takes your tokens and sends the other token back in the same step.

That step is atomic: either both sides of the trade happen, or the transaction reverts and you keep your tokens (minus the gas spent). There is no deposit to make first, no balance held by an operator and no withdrawal queue.

Order book vs liquidity pool

A centralized exchange matches your order against other users' orders in a private order book, using funds you deposited earlier. An automated market maker (AMM) has no order book: you trade against a pool of tokens, and the price comes from the ratio of what is in it.

Centralized exchangeYoudeposit fundsExchange holds your balancesell 2,403sell 2,402sell 2,401buy 2,399buy 2,398buy 2,397Matching engine pairs buyers and sellersAMM decentralized exchangeYour wallet1 ETH in~2,398 USDC outPool contract (example reserves)ETH1,000USDC2,400,000price from x × y = kOne transaction, funds stay in your control
Left: a centralized exchange matches orders on funds it holds. Right: an AMM trades your tokens against a pool and returns the output in the same transaction.

In the example pool, the spot price is 2,400 USDC per ETH. Selling 1 ETH adds ETH to the pool and removes USDC, so you get slightly less than 2,400. The bigger the trade relative to the pool, the more the price moves: that is price impact, covered in Slippage explained.

Anyone can add tokens to a pool and earn a share of its trading fees. Those liquidity providers take on impermanent loss in exchange.

CEX vs DEX at a glance

Centralized and decentralized exchanges compared
AspectDEXCEX
CustodyYou keep your keys; funds leave your wallet only inside the tradeThe exchange holds your funds
AccountNone: connect a walletSign-up and identity checks
CostsPool fee, network gas, sometimes a front-end feeTrading fee, plus deposit and withdrawal fees
SpeedOne block: about 12 s on Ethereum, 1-2 s on most layer 2sMilliseconds, off-chain matching
Token choiceAny token with a pool, including scamsCurated list chosen by the exchange
Main risksContract bugs, malicious tokens, your own mistakesInsolvency, hacks, frozen withdrawals
If it goes wrongNo one can reverse a transactionSupport desk, but you depend on its goodwill

Many people use both: a centralized exchange to turn euros or dollars into crypto, and a DEX for everything after that.

Types of DEXs

Automated market makers

Traders swap against a pool of two (or more) tokens priced by a formula. Liquidity providers deposit the tokens and earn the trading fees. The most common design by far.

Examples: Uniswap, Curve, PancakeSwap, Balancer

Order-book DEXs

Buyers and sellers post limit orders that a protocol matches, usually on a dedicated chain. Familiar to traders and efficient for liquid markets, but they need active market makers.

Examples: Hyperliquid, dYdX

Request-for-quote (RFQ)

A professional market maker signs a firm price for your exact trade, and a contract settles it on-chain. Often the best price on large trades of major pairs.

Examples: Market makers behind 0x and other aggregators

Aggregators

They hold no liquidity of their own. They search many pools and market makers, split your order when that helps, and settle the whole route in one transaction.

Examples: 0x, KyberSwap, ParaSwap

Why aggregators get better rates

The same pair trades in dozens of pools across many DEXs, each with its own depth and fee. The best price for ETH to USDC may be in one pool, and for a large order a mix of three pools may beat any single one. Checking them by hand before every trade is not realistic.

An aggregator does that search for you and settles the resulting route in one transaction. ChainBridge goes one level up: it asks 0x, KyberSwap and ParaSwap in parallel, then keeps the quote that leaves you the most after fees and gas. Each of those aggregators does its own pool search and order splitting. See How DEX aggregators work for the details.

Risks to watch

  • Contract risk. A bug in a pool or router contract can lose funds. Prefer established protocols; ChainBridge only sends transactions to contracts on its allowlist.
  • Gas. Every swap pays a network fee. On Ethereum mainnet it can outweigh the trade on small amounts; on layer 2s it is usually cents.
  • MEV. Bots can trade around your swap in the public mempool. A tight slippage tolerance limits what they can take. See MEV protection.
  • Approvals. Approving a token lets a contract spend it later. Review old approvals on the approvals page.

Trying a DEX swap

  1. Connect your wallet

    ChainBridge never asks for your recovery phrase or keys. Connecting only shares your address.

  2. Pick the network and tokens

    Ethereum, Arbitrum, Base, Optimism, Polygon, BNB Chain, Avalanche and Linea are supported. Search by name, or paste a contract address to import a token.

  3. Read the quote

    Check the amount out, the minimum received, price impact and fees. The transaction is simulated before you sign.

  4. Sign and wait one block

    The tokens arrive in your wallet when the transaction confirms.

Put it into practice

Compare 0x, KyberSwap and ParaSwap in one quote, with every route checked before you sign.

Start swapping