start learning →
beginner12 min read

How crypto exchanges work: order books, custody, CEX vs DEX

A crypto exchange matches buyers and sellers, holds their money and coins, and keeps an internal ledger of who owns what. Here is how order books, fees, custody, decentralised exchanges and proof of reserves actually work.

key takeaways
  1. A centralised exchange matches orders in a private order book and records most trades on its own internal ledger, not on the blockchain.
  2. When you leave coins on a centralised exchange, it holds the private keys and you have a claim against it, which is why exchange failures have caused large customer losses.
  3. A large market order walks through the order book and fills at progressively worse prices; limit orders control price but may not fill.
  4. Decentralised exchanges let you trade from your own wallet through smart contracts, often using liquidity pools priced by a formula, with smart-contract risk instead of custody risk.
  5. Proof of reserves shows an exchange held certain assets at one moment; without a matching check of liabilities it does not prove solvency.

A crypto exchange is a marketplace that matches people who want to buy a coin with people who want to sell it. A centralised exchange (CEX) runs that marketplace as a company: it holds customers' money and coins, matches orders in its own order book, and records most trades on an internal database rather than on the blockchain. A decentralised exchange (DEX) does the matching through smart contracts, so you trade directly from your own wallet and nobody holds your coins for you.

Knowing how the machinery works explains most of what goes wrong for users: why a large order gets a worse price than the screen showed, why withdrawals can be frozen, why an exchange can fail with customer coins missing, and why "proof of reserves" is less reassuring than it sounds.

Risk warning: crypto assets are highly volatile. Coins held on an exchange are generally not covered by deposit protection or investor compensation schemes, and crypto transactions usually cannot be reversed. You can lose all of the money you put in.

The two parts of a centralised exchange

Every centralised exchange is really two businesses joined together.

  1. A trading venue. A matching engine that takes orders, ranks them and pairs buyers with sellers.
  2. A custodian. A firm that holds customers' fiat money and crypto, keeps a ledger of balances, and processes deposits and withdrawals.

The trading venue is what you see on screen. The custodian is what matters most when things go wrong.

How the order book works

The order book is a live list of all the limit orders waiting to be filled. Bids (buy orders) are listed from the highest price down; asks (sell orders) are listed from the lowest price up. The gap between the best bid and the best ask is the spread.

When you place a limit order, you name a price. If nobody is willing to trade at that price yet, the order joins the book and waits. When you place a market order, you accept whatever prices are available, and the matching engine fills you against the best waiting orders on the other side.

Matching engines generally use price-time priority: the best price is filled first, and among orders at the same price, the one that arrived first is filled first.

Worked example: a market order walking the book

Illustrative numbers only. The ask side of a BTC/USDT order book shows:

  • 0.5 BTC offered at 60,000
  • 0.8 BTC offered at 60,010
  • 1.2 BTC offered at 60,030

You send a market order to buy 2 BTC. The engine fills:

  1. 0.5 BTC at 60,000 = 30,000 USDT
  2. 0.8 BTC at 60,010 = 48,008 USDT
  3. the remaining 0.7 BTC at 60,030 = 42,021 USDT

Total cost: 120,029 USDT for 2 BTC, an average price of about 60,014.5. The screen showed 60,000, but your order was too big for the best level alone. That difference is price impact, a form of slippage. On a thinly traded coin, or at a quiet hour, the levels can be much further apart. Our guide to crypto order books and liquidity goes deeper into depth and slippage on large orders.

Had you used a limit order at 60,010 instead, you would have bought 1.3 BTC immediately and the remaining 0.7 BTC would have waited in the book until someone sold at 60,010 or lower, or until you cancelled it. The order types guide covers the trade-off between price control and certainty of execution.

Maker and taker fees

Most exchanges charge different fees depending on whether your order adds liquidity to the book or removes it.

  • Maker: a limit order that rests in the book and is filled later. It "makes" liquidity. Maker fees are usually lower.
  • Taker: a market order, or a limit order priced to fill immediately. It "takes" liquidity. Taker fees are usually higher.

Fees are normally a percentage of the trade value, and many exchanges lower them for high-volume traders or for paying in the exchange's own token.

Worked example: the fee on that order

Continuing the example, assume a taker fee of 0.10%. The market order cost 120,029 USDT, so the fee is about 120.03 USDT. Add the price impact of about 29 USDT compared with buying all 2 BTC at 60,000, and the real cost of entering the trade was close to 150 USDT before you sell again and pay a second fee. When comparing venues, add fees and spread together, as the how to compare trading costs guide does for forex.

Simple "buy" buttons in exchange apps often show no explicit fee but include a wider spread in the price. That can cost more than the visible fee on the full trading screen.

Who your trades are with

On an exchange, your counterparty is another customer whose order was in the book, or a market maker: a firm that keeps quotes on both sides and earns the spread. Many exchanges pay or give fee discounts to market makers to keep their books tight.

That is different from a crypto CFD, where your contract is with the broker itself. If you trade bitcoin through a CFD, you never use an exchange order book directly, own no coins and have no custody question about the coins themselves; the crypto CFDs vs buying crypto guide compares the two.

Custody: where your coins actually are

When you deposit bitcoin to a centralised exchange, you send it to an address the exchange controls. The exchange credits your account on its internal ledger. From that moment, the coins on the blockchain belong to the exchange's wallet, and what you have is an entry in its database saying it owes you that amount.

Most exchanges use omnibus wallets: customers' coins are pooled in a small number of addresses rather than one per customer. A small share is kept in hot wallets, connected to the internet so withdrawals can be paid quickly; most is kept in cold storage, offline, which is safer from hackers but slower to move. Our guide to crypto wallets and custody explains keys, hot and cold wallets and self-custody in detail.

Trades happen on the ledger, not the blockchain

When you buy 1 BTC from another customer, no bitcoin moves on the blockchain. The exchange adjusts two balances in its own database. Only deposits and withdrawals touch the blockchain. This is why exchange trading is fast and cheap compared with on-chain transactions, and also why you must trust the exchange's records completely.

Why exchanges fail with customer coins missing

Because customer coins sit in the exchange's wallets, a dishonest or badly run exchange can lend them out, use them to fund its own trading, or lose them to a hack, while still showing customers their full balances. When enough customers try to withdraw at once, the gap is exposed. That is broadly what happened at FTX in November 2022, and at Mt. Gox years earlier. The documented details and lessons are in our guide to crypto exchange collapses.

In the EU, MiCA now requires authorised crypto-asset service providers that hold client assets to segregate them from their own and to have safeguarding arrangements. That lowers the risk; it does not remove it, and there is no compensation scheme for crypto. See MiCA regulation explained.

Deposits, withdrawals and networks

Withdrawals are where most user errors happen.

  • Choose the right network. Many coins and stablecoins exist on several blockchains. Sending USDT on one network to an address on another that the receiving platform does not support can lose the funds.
  • Memos and tags. Some coins, such as XRP, require a destination tag when sending to an exchange's shared address. Leaving it out can mean a long recovery process or a loss.
  • Withdrawal fees. Exchanges usually charge a flat fee per withdrawal to cover the network fee, sometimes more. See crypto gas fees explained.
  • Confirmations. Exchanges credit deposits only after a set number of blockchain confirmations, which can take minutes or longer.
  • Identity checks. Regulated exchanges must verify customers before they can trade or withdraw; that is KYC. In the EU, transfers now also carry sender and recipient information under the travel rule, covered in crypto KYC and the travel rule.

Exchanges can and do pause withdrawals for maintenance, network problems, suspected fraud or, in the worst cases, because they cannot pay. A pause is not always a sign of trouble, but a long or unexplained one is a red flag.

Decentralised exchanges

A decentralised exchange is a set of smart contracts on a blockchain such as Ethereum or Solana. You connect your own wallet, approve the contract to use a token, and trade. The DEX never holds your coins between trades, and there is usually no account or identity check.

There are two main designs.

  • On-chain order books. Work like a CEX order book but run on the blockchain. They need fast, cheap blockchains to be practical.
  • Automated market makers (AMMs). Instead of an order book, users deposit pairs of tokens into a liquidity pool, and a formula sets the price. The simplest formula keeps the product of the two balances constant.

Worked example: a trade against a liquidity pool

Illustrative numbers only, ignoring fees. A pool holds 100 ETH and 300,000 USDC, so the implied price is 3,000 USDC per ETH and the constant is 100 x 300,000 = 30,000,000.

You pay in 30,000 USDC. The pool now holds 330,000 USDC, so to keep the product at 30,000,000 it must hold 30,000,000 / 330,000 = about 90.909 ETH. You receive the difference: about 9.091 ETH.

Your average price was 30,000 / 9.091 = about 3,300 USDC per ETH, roughly 10% above the starting price. In a pool holding ten times as much of each token, the same trade would move the price by about 1%. Pool size, like order book depth, decides how much a trade costs. DEX interfaces show this as "price impact" and let you set a slippage tolerance that cancels the trade if the price moves too far.

DEX risks

Trading on a DEX swaps custody risk for different risks:

  • Smart-contract bugs and hacks. Code flaws have drained pools of large sums.
  • Malicious or fake tokens. Anyone can create a token and a pool; names and logos are easy to copy.
  • Token approvals. Approving a contract to spend your tokens can let a malicious contract drain them later.
  • Network fees and failed transactions. You pay gas on every trade, even if it fails.
  • Front-running. Bots can see pending trades and trade ahead of them.

The DeFi explained guide covers these risks in more depth.

Proof of reserves

After FTX collapsed in 2022, many exchanges began publishing proof of reserves: evidence that they control wallets holding at least as much of each asset as their customers' balances.

A common method has two parts. The exchange shows it controls certain blockchain addresses, for example by signing a message with their keys or moving funds on request, so anyone can check the balances. It also publishes a Merkle tree, a cryptographic summary of all customer balances, which lets each customer check that their own balance was included in the total.

What proof of reserves does not prove

  • Liabilities beyond customer balances. An exchange can hold 100% of customer coins and still owe large debts elsewhere. Solvency means assets exceed all liabilities, which needs an audit of the full balance sheet.
  • That the coins were not borrowed. Coins can be borrowed just before a snapshot and returned after it.
  • That the snapshot reflects today. It is a single moment. Positions can change the next day.
  • Who checked it. A report by an independent auditor that examines liabilities carries more weight than a self-published dashboard.

Proof of reserves is better than nothing and a useful screen, but it is not proof that your coins are safe.

How a CEX and a DEX compare

  • Custody: CEX holds your keys while coins are on it; DEX leaves them in your wallet.
  • Account and ID: CEX requires an account and identity checks; DEX usually needs only a wallet.
  • Fiat money: CEX lets you deposit and withdraw euros or dollars; DEX usually deals only in tokens.
  • Speed and cost: CEX trades are instant internal ledger updates; DEX trades are blockchain transactions with network fees.
  • What can go wrong: CEX risks are insolvency, fraud, hacks of its wallets and frozen withdrawals; DEX risks are bugs, scam tokens, approvals and your own mistakes.
  • Help when things go wrong: a regulated CEX has complaints procedures; on a DEX there is usually nobody to call.

Neither is safe in absolute terms. Most people use a centralised exchange for buying with fiat money and decide separately how much, if anything, to keep there.

Choosing and checking an exchange

Before depositing anything:

  1. Check the licence. In the EU, a provider offering crypto services needs MiCA authorisation. Check the national regulator's register and ESMA's register, and make sure the website matches the entry. Our guide on how to check a broker licence shows the method, and regulator registers lists where to look.
  2. Check the legal entity. Many exchanges operate several companies in different countries. Find out which one you would contract with.
  3. Read the custody terms. Does it segregate client assets? Does it lend them out, for example for "earn" products?
  4. Look at the real cost. Compare maker and taker fees, the spread on simple buy screens, and withdrawal fees.
  5. Test withdrawals with a small amount before moving larger sums.
  6. Decide how much to leave there. Many people keep only what they actively trade on an exchange.

Common mistakes

  • Treating an exchange balance like a bank deposit. It is a claim on the exchange and is not covered by deposit protection schemes.
  • Using market orders on thin coins. Price impact can be far larger than the fee.
  • Sending on the wrong network or without a memo. Always check the network and tag, and send a small test first.
  • Using the simple "buy" button without checking the spread.
  • Approving unlimited token spending on a DEX and forgetting about it.
  • Trusting a proof of reserves dashboard as proof of solvency.
  • Using an exchange that is not authorised where you live because it offers higher leverage or more coins.

Frequently asked questions

Do I own the coins in my exchange account?

You have a claim against the exchange for them. The coins themselves sit in wallets the exchange controls, usually pooled with other customers' coins. Only when you withdraw to a wallet whose keys you hold do you control them directly.

Why did my order fill at a worse price than shown?

The price on screen is usually the best available level. If your order was larger than the size offered at that level, it filled at the next levels as well, or the price moved before your order arrived. Limit orders cap the price you pay but may not fill.

What is the difference between maker and taker fees?

A maker order rests in the order book and adds liquidity; a taker order fills immediately against existing orders and removes liquidity. Takers usually pay the higher fee.

Is a decentralised exchange safer than a centralised one?

It removes the risk of the exchange losing or misusing your coins, but adds smart-contract, scam-token and user-error risks, and there is usually nobody to help if something goes wrong. Neither type is safe.

Does proof of reserves mean an exchange is solvent?

No. It shows that the exchange controlled certain assets at a moment in time. Solvency also depends on all its liabilities, which a reserves snapshot does not show.

Do crypto CFD traders use exchanges?

Not directly. A crypto CFD is a contract with your broker that tracks a price, often derived from exchange prices. You never hold coins or use an exchange order book yourself.

Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning