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.
CEX vs DEX
0:56 · captioned1/4Who stands in the middle
- The difference: who stands in the middle
2/4On a CEX: inside the company's records
- A balance is a claim on the exchange
3/4On a DEX: a blockchain transaction
- No support desk can reverse it
4/4Different risks, not a safe side
- The risks are different in kind
A CEX is a company that holds assets and matches trades. A DEX is code that swaps assets directly from a user's wallet.
Transcript
- Who stands in the middle
- A CEX is a company that holds customer assets and matches trades.
- A DEX is a set of smart contracts, programs on a blockchain, that users trade against from their own wallets.
- On a CEX: inside the company's records
- Depositing to a CEX hands control of the assets to the company. The balance is a record in its database.
- On a DEX: a blockchain transaction
- On a DEX, assets stay in a wallet the user controls and move only when the user signs a transaction.
- A mistaken transaction is final. No company or support desk can reverse it.
- Different risks, not a safe side
- A CEX concentrates risk in a company.
- A DEX moves the risk to code and to the user.
- The word decentralized describes the trading mechanism. The website used to reach it is run by someone.
- 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 pageDEX
A decentralized exchange: smart contracts on a blockchain carry out trades directly between users' wallets and pools of assets.
Read the full page| Aspect | CEX | DEX |
|---|---|---|
| Run by | A company | Smart contracts on a blockchain |
| Who holds the assets | The exchange, after a deposit | The user's own wallet, until the moment of the trade |
| How trades are matched | An order book kept by the exchange | Most often liquidity pools; some use on-chain order books |
| Access | An account, usually with identity checks | A wallet; no account with a company |
| Costs | Trading fees and withdrawal fees | A swap fee plus the blockchain's network fee |
| Ordinary money (fiat) | Often supported through bank transfers or cards | Generally crypto to crypto only |
| Help when something goes wrong | Customer support exists | Nobody can reverse a transaction |
| Characteristic risk | The company fails, is hacked or freezes withdrawals | Contract bugs, fake tokens and user mistakes |
The idea in one picture
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
ON A CEX
The trade happens inside the company's records.
- DepositAssets move on-chain to the exchange's wallets.
- TradeThe exchange updates balances in its own database.
- WithdrawThe exchange sends assets on-chain, if it approves the request.
ON A DEX
The trade is a blockchain transaction.
- BeforeAssets sit in the user's own wallet.
- SwapOne signed transaction exchanges them through a contract.
- AfterThe new assets are in the same wallet.
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
- Ethereum gas and fees: technical overview (opens in a new tab), ethereum.org. Gas fees are paid in ether and are tied to the computation performed
- How Uniswap Works (opens in a new tab), Uniswap Labs. Pools hold reserves of two tokens, prices follow a constant product formula, swap fees accrue to liquidity providers, and larger trades move the price more
- Trading and Exchanges: Market Microstructure for Practitioners, Larry Harris (2003). How order-driven exchanges work
- What the Public Needs to Know About FDIC Deposit Insurance and Crypto Companies (opens in a new tab), U.S. Federal Deposit Insurance Corporation. Deposit insurance does not protect against the failure of a non-bank crypto company such as an exchange