Compare

CEX vs DEX

A centralized exchange (CEX) is a company that holds customer assets and matches trades. A decentralized exchange (DEX) is a set of smart contracts that users trade against from their own wallets.

  • Beginner
  • 3 min read
  • Updated
Watch in 60 seconds

CEX vs DEX

0:56 · captioned

1/4Who stands in the middle

CEX

Centralized: run by a company

  • Holds deposited assets
  • Usually an order book

DEX

Decentralized: run by smart contracts

  • Assets stay in the user's wallet
  • Most often liquidity pools
  • The difference: who stands in the middle

A CEX is a company that holds assets and matches trades. A DEX is code that swaps assets directly from a user's wallet.

0:00 / 0:56

Transcript
  1. Who stands in the middle
  2. A CEX is a company that holds customer assets and matches trades.
  3. A DEX is a set of smart contracts, programs on a blockchain, that users trade against from their own wallets.
  4. On a CEX: inside the company's records
  5. Depositing to a CEX hands control of the assets to the company. The balance is a record in its database.
  6. On a DEX: a blockchain transaction
  7. On a DEX, assets stay in a wallet the user controls and move only when the user signs a transaction.
  8. A mistaken transaction is final. No company or support desk can reverse it.
  9. Different risks, not a safe side
  10. A CEX concentrates risk in a company.
  11. A DEX moves the risk to code and to the user.
  12. The word decentralized describes the trading mechanism. The website used to reach it is run by someone.
  13. Neither type is the safe one. The risks are different in kind.

Educational explainer with hypothetical data. Not financial advice.

CEX

A centralized exchange: a company runs the platform, holds deposited assets and keeps the record of who owns what.

Read the full page

DEX

A decentralized exchange: smart contracts on a blockchain carry out trades directly between users' wallets and pools of assets.

Read the full page
CEX compared with DEX
AspectCEXDEX
Run byA companySmart contracts on a blockchain
Who holds the assetsThe exchange, after a depositThe user's own wallet, until the moment of the trade
How trades are matchedAn order book kept by the exchangeMost often liquidity pools; some use on-chain order books
AccessAn account, usually with identity checksA wallet; no account with a company
CostsTrading fees and withdrawal feesA swap fee plus the blockchain's network fee
Ordinary money (fiat)Often supported through bank transfers or cardsGenerally crypto to crypto only
Help when something goes wrongCustomer support existsNobody can reverse a transaction
Characteristic riskThe company fails, is hacked or freezes withdrawalsContract bugs, fake tokens and user mistakes

The idea in one picture

CEX vs DEX

CENTRALISED EXCHANGE

A company runs the market and holds customer funds.

  • Account, usually with identity checks
  • Order book matching
  • Custodial: the exchange holds the keys
  • Risk: the company itself

DECENTRALISED EXCHANGE

Smart contracts run the market. Users keep their keys.

  • Wallet connection, no account
  • Often liquidity pools instead of an order book
  • Non-custodial
  • Risk: contract bugs, bad approvals, fake tokens

Both kinds of exchange let people swap one crypto asset for another. They differ in who stands in the middle. On a centralized exchange it is a company. On a decentralized exchange it is program code running on a blockchain.

In plain words

A CEX is like a bank branch with a currency desk. You hand over your money, staff look after it, and there is a counter to complain at. If the bank closes its doors, your money is inside.

A DEX is like a vending machine in the street. No staff, no opening hours, and nobody holds your money for you. If you press the wrong button, there is no one to ask for a refund.

When the distinction matters

Custody

Where the assets are during a trade

ON A CEX

The trade happens inside the company's records.

  1. DepositAssets move on-chain to the exchange's wallets.
  2. TradeThe exchange updates balances in its own database.
  3. WithdrawThe exchange sends assets on-chain, if it approves the request.

ON A DEX

The trade is a blockchain transaction.

  1. BeforeAssets sit in the user's own wallet.
  2. SwapOne signed transaction exchanges them through a contract.
  3. AfterThe new assets are in the same wallet.
On a CEX, a balance is the company's promise. On a DEX, a balance is an entry on a public blockchain.

Depositing to a CEX hands control of the assets to the company. The balance on screen is a record in the company’s database, a claim on the exchange. This is counterparty risk: exchanges have been hacked, have paused withdrawals and have gone bankrupt.

On a DEX, assets stay in a wallet the user controls and move only when the user signs a transaction. The comparison is the same one made in Custodial vs Non-Custodial.

How a price is formed

A CEX usually runs an order book, a list of buy and sell orders at different prices. Most DEXs use liquidity pools, where a formula sets the price from the amounts of two assets in a pool. In a small pool, a large swap moves the price noticeably, an effect called price impact.

Costs

A CEX charges a trading fee and usually a fee to withdraw. A DEX swap pays a fee to the pool and a network fee to the blockchain, which varies with congestion and does not depend on the size of the trade. Either can be the cheaper route. It depends on the amount, the network and the depth of the market.

What can be listed

A CEX decides which assets it lists. On most DEXs anyone can create a pool for any token, with no review. That openness includes worthless tokens and deliberate imitations of well-known ones.

Responsibility

A CEX can reset a password and can also freeze an account. On a DEX there is no company account to reset or freeze, but the project’s admin keys or a token issuer may still hold special powers. A mistaken transaction is final.

Common confusion

  • “Decentralized” describes the trading mechanism, not everything around it. The website used to reach a DEX is run by someone, and the project may have a team with special powers over the contracts.
  • A DEX is not anonymous. Transactions are recorded on a public blockchain and can be traced between addresses.
  • A CEX balance is not on-chain. Trades inside an exchange do not appear on the blockchain. Only deposits and withdrawals do.

What it does NOT mean

  • Neither type is the safe one. A CEX concentrates risk in a company. A DEX moves the risk to code and to the user. The risks are different in kind, and both have caused large losses.
  • Regulated does not mean protected. Rules for crypto exchanges differ widely between jurisdictions, and deposit protection of the kind banks offer generally does not apply.
  • Audited does not mean free of bugs. A code review lowers smart contract risk. It does not remove it.

Key takeaway

A CEX is a company that holds assets and matches trades in its own records. A DEX is code that swaps assets directly from a user’s wallet. The first asks for trust in an institution, the second for trust in software and in one’s own care.

Sources and further reading