# Centralized vs Decentralized Exchanges

> Centralised exchanges hold your funds and match orders; decentralised exchanges trade from your wallet via smart contracts. Compare costs, safety and how each works.

Source: https://learn.tradelabsai.com/crypto/cex-vs-dex/  
Track: Crypto · Level: Beginner · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Centralized vs Decentralized Exchanges", https://learn.tradelabsai.com/crypto/cex-vs-dex/

Crypto trades on two very different kinds of venues. Centralised exchanges (CEXs) work like traditional brokers: you deposit funds, the exchange holds them and matches your orders in its own order book. Decentralised exchanges (DEXs) run on smart contracts: you trade directly from your own wallet, and the blockchain settles each trade. Each has strengths and risks, and many traders use both. Choosing the right venue affects costs, safety, access to tokens and how your orders are filled.

## Side by side

| Feature | Centralised exchange (CEX) | Decentralised exchange (DEX) |
|---|---|---|
| Custody | Exchange holds your assets | You keep your keys |
| Account | Sign up, identity checks | Connect a wallet |
| Matching | Central limit order book | Automated market maker pools or on chain order books |
| Speed | Very fast | Limited by blockchain speed |
| Fees | Trading fees, sometimes low | Swap fees plus network gas fees |
| Token selection | Listed tokens only | Almost any token |
| Leverage | Often available | Some perpetual DEXs offer it |
| Main risks | Exchange failure, hacks, frozen withdrawals | Smart contract bugs, scams, MEV |
| Examples | Coinbase, Kraken, Binance | Uniswap, Curve, Hyperliquid |

## How DEXs price trades: automated market makers

Many DEXs use automated market makers (AMMs). Instead of an order book, liquidity providers deposit two tokens into a pool, and a formula sets prices. Uniswap's classic design keeps the product of the two token amounts constant:

```
x × y = k
```

**Example: A swap on a constant product pool**
A pool holds 100 ETH and 300,000 USDC, so k = 30,000,000 and the price is 3,000 USDC per ETH. You buy ETH with 30,000 USDC. The pool now has 330,000 USDC, so ETH must fall to 30,000,000 / 330,000 ≈ 90.91 ETH. You receive about 9.09 ETH, an average price of about 3,300 USDC, 10% above the starting price, before fees. That difference is price impact. Larger pools mean less impact. See [Market Impact](https://learn.tradelabsai.com/orders/market-impact/).

Liquidity providers earn swap fees but face impermanent loss: if prices move a lot, they end up worse off than if they had simply held the two tokens. See [DeFi Basics](https://learn.tradelabsai.com/crypto/defi-basics/).

## Risks on centralised exchanges

- **Exchange failure:** FTX collapsed in November 2022 after customer funds were misused; customers waited years for partial recoveries.
- **Hacks:** Mt. Gox lost about 850,000 bitcoins in 2014; Bybit lost about $1.5 billion in ETH to hackers in February 2025.
- **Frozen withdrawals** during stress.
- **Regulatory actions** in some countries.

Proof of reserves reports help, but they do not always show liabilities fully. See [Market, Credit and Counterparty Risk](https://learn.tradelabsai.com/portfolio/counterparty-risk/).

## Risks on decentralised exchanges

- **Smart contract bugs and exploits.** See [Bridge and Smart Contract Risk](https://learn.tradelabsai.com/crypto/bridge-and-smart-contract-risk/).
- **Scam tokens and rug pulls:** anyone can create a token and a pool.
- **MEV and sandwich attacks:** bots can front run your trade. See [MEV](https://learn.tradelabsai.com/crypto/mev/).
- **Slippage** in thin pools.
- **Gas costs** on busy networks. See [Mempools and Gas](https://learn.tradelabsai.com/crypto/mempools-and-gas/).
- **Wallet security:** a malicious approval can drain your wallet.

## Practical tips

1. **Do not keep more on exchanges than you need** for trading.
2. **Use well established venues** with strong security records.
3. **On DEXs, set slippage limits** and check the token contract address.
4. **Revoke unused token approvals** in your wallet.
5. **Compare total costs:** spreads, fees, gas and price impact.

## Frequently asked questions

### What is the difference between a CEX and a DEX?

A CEX holds your funds and matches orders centrally; a DEX lets you trade directly from your wallet through smart contracts.

### Are DEXs safer than centralised exchanges?

They remove the risk of an exchange losing your funds, but add smart contract, scam and MEV risks. Neither is risk free.

### What is an automated market maker?

A smart contract that holds pools of tokens and sets prices with a formula, allowing trades without a traditional order book.

Next, learn the practicalities of buying and selling crypto in [Crypto Spot Trading](https://learn.tradelabsai.com/crypto/crypto-spot-trading/).

## Continue learning

- Next lesson: [Crypto Spot Trading](https://learn.tradelabsai.com/crypto/crypto-spot-trading/)
- Previous lesson: [Stablecoins](https://learn.tradelabsai.com/crypto/stablecoins/)
- Related: [Stablecoins](https://learn.tradelabsai.com/crypto/stablecoins/): Stablecoins are crypto tokens designed to hold a steady value, usually $1. Learn how fiat backed, crypto backed and algorithmic stablecoins work, and their risks.
- Related: [Crypto Spot Trading](https://learn.tradelabsai.com/crypto/crypto-spot-trading/): Spot trading means buying and selling actual crypto at current prices. Learn order types, pairs, fees, sizing, custody and how spot differs from derivatives.
- Related: [DeFi Basics](https://learn.tradelabsai.com/crypto/defi-basics/): DeFi offers trading, lending and borrowing through smart contracts instead of banks. Learn the building blocks, where yields come from and the risks.
- Related: [MEV](https://learn.tradelabsai.com/crypto/mev/): MEV is value extracted by reordering or inserting blockchain transactions. Learn sandwich attacks, arbitrage and liquidation MEV, and how to protect trades.
- Related: [Market, Credit and Counterparty Risk](https://learn.tradelabsai.com/portfolio/counterparty-risk/): Learn the difference between market risk, credit risk and counterparty risk, how each is measured and managed, and real cases from Lehman Brothers to FTX.
- Related: [Liquidity](https://learn.tradelabsai.com/markets/liquidity/): Liquidity is how easily you can trade without moving the price. Learn the signs of a liquid market, how illiquidity costs you and when liquidity disappears.
