Course 03 · Lesson 05

Crypto Exchanges - CEX vs DEX

~9 min readLesson 05/7Free

Buying and trading cryptocurrency requires access to an exchange - a platform where buyers and sellers come together to trade. But in crypto, there are two fundamentally different types of exchange: centralised exchanges that work much like traditional financial platforms, and decentralised exchanges that operate through blockchain smart contracts without any company controlling the trades. The distinction between them is not just technical - it has profound implications for custody, access, cost, and risk. This lesson explains both, how they work, and when each is the appropriate choice.

What Is a Crypto Exchange?

An exchange is a marketplace where buyers and sellers of cryptocurrency come together and trade. The exchange provides the infrastructure - price discovery, order matching, liquidity, and settlement - that makes trading possible. The fundamental difference between CEXs and DEXs is who controls this infrastructure and who holds the assets during trading.

Centralised Exchanges - CEX

A Centralised Exchange (CEX) is a company - a traditional corporate entity with employees, offices, and legal registration - that operates a crypto trading platform. When you deposit crypto to a CEX, you transfer custody of your assets to the exchange. The exchange holds your crypto in its own wallets and gives you an internal account balance.

MAJOR CENTRALISED EXCHANGES

Binance:
• Largest by global volume.
• Wide token selection.
• Regulatory challenges in multiple jurisdictions.

Coinbase:
• US-based, publicly listed company.
• Most regulated major exchange.
• Preferred by institutional traders.
• Lower token selection than Binance.

Kraken:
• Long-established, strong reputation.
• Good regulatory compliance record.
• Lower volume than Binance/Coinbase.

OKX:
• Large global exchange.
• Extensive derivatives offering.

Bybit:
• Popular for derivatives trading.
• Growing spot market.

CEX advantages: familiar interface, high liquidity, fiat on-ramps (buy crypto with bank card or transfer), customer support, regulatory compliance in major jurisdictions, and strong protection against user error (wrong address sends are recoverable internally).

CEX risks: counterparty risk is the defining concern. FTX collapsed in November 2022 - the world's third largest exchange at the time - and customers lost approximately $8 billion of assets. Celsius, Voyager, and BlockFi followed in the same year. When a CEX fails, customers' assets may be lost, frozen, or recovered only partially after lengthy legal processes. The golden rule: "Not your keys, not your coins."

Decentralised Exchanges - DEX

A Decentralised Exchange (DEX) operates through smart contracts on a blockchain - no company controls it, no single entity holds custody of assets, and trading happens directly from users' wallets. The most widely used DEXs operate on Ethereum and its Layer 2 networks.

On a DEX, you never give up custody of your assets. You connect your wallet, approve a transaction, and the smart contract executes the trade - moving tokens directly between wallets. If the DEX is hacked, it is the smart contract that is attacked - your wallet and its other assets are not at risk (unless you gave the contract unlimited approval).

How DEXs Work - AMMs

Most DEXs use an Automated Market Maker (AMM) rather than a traditional Order Book. An AMM uses a mathematical formula to determine prices based on the ratio of two tokens in a Liquidity Pool.

HOW AMM PRICING WORKS

Uniswap ETH/USDC pool example:
• Pool holds: 1,000 ETH + $2,000,000 USDC.
• Implied ETH price: $2,000.
• Formula: x × y = k (constant product).
• 1,000 × 2,000,000 = 2,000,000,000 = k.

User buys 10 ETH:
• Pool must still satisfy: x × y = k.
• New ETH in pool: 990.
• New USDC needed: 2,000,000,000 ÷ 990 = $2,020,202.
• USDC added by buyer: $20,202.
• Effective price paid per ETH: $2,020.20.

• Result: The price shifted. Large trades move the price more than small ones. This price impact is called slippage.

Choosing Between CEX and DEX

CEX vs DEX - WHEN TO USE EACH

Use CEX when:
• Buying crypto with fiat currency (bank card, bank transfer).
• Trading high volume with minimal slippage and tight spreads.
• Trading mainstream tokens with deep liquidity.
• You want customer support if something goes wrong.
• You are not comfortable managing your own wallet.

Use DEX when:
• Trading newer tokens not yet listed on CEXs.
• You want to maintain self-custody at all times.
• Accessing DeFi protocols directly.
• Privacy is a priority (no KYC required).
• Trading on Layer 2 networks for extremely low fees.

Risks unique to each:
• CEX: Counterparty risk (exchange bankruptcy).
• DEX: Smart contract code bugs, slippage on thin liquidity pools, impermanent loss for liquidity providers.

KEY TAKEAWAYS
CEXs are companies holding customer funds in custody - convenient but carry counterparty risk (FTX, Celsius examples).
DEXs operate through smart contracts - users maintain custody, no company can fail with your funds, but smart contract risk applies.
AMMs use liquidity pools and mathematical formulas to determine prices - no order book needed, but large trades cause slippage.
Use CEX for fiat on-ramps, mainstream tokens, and high liquidity trading. Use DEX for new tokens, self-custody, and DeFi integration.
"Not your keys, not your coins" - the fundamental principle for managing CEX counterparty risk.