Cube

What Is a Crypto Exchange?

Learn what a crypto exchange is, how CEXs and DEXs work, how trades are matched and settled, and where the main risks really come from.

What Is a Crypto Exchange? hero image

Introduction

A crypto exchange is a venue where people trade digital assets by converting one asset into another, matching buyers with sellers, or interacting with a pricing mechanism that stands in for a counterparty. That sounds straightforward, but the important question is not just what an exchange is. It is how the exchange makes trade possible. The answer determines who controls your assets, how prices are discovered, what kinds of orders you can place, what can fail under stress, and why centralized and decentralized exchanges feel so different even when both let you swap BTC, ETH, stablecoins, or tokens.

At bottom, an exchange solves a coordination problem. A buyer wants to acquire an asset at some acceptable price, a seller wants to exit at some acceptable price, and both need a mechanism that turns those intentions into an executed trade. In traditional markets, this problem is solved by market infrastructure like brokers, exchanges, and clearing systems. In crypto, the same economic problem exists, but the infrastructure is reassembled around blockchains, digital custody, and programmable settlement. That reassembly creates new possibilities (global access, always-on trading, self-custody in some designs) but it also creates new failure modes.

The key idea to keep in view is this: **an exchange is not just a website with prices on it. It is a system for custody, matching, pricing, and settlement. ** Once that clicks, the landscape becomes much easier to understand. Different crypto exchanges differ less in their branding than in how they answer four mechanical questions: Who holds the assets before the trade? How is the price determined? Where does the trade execute? And when is it final?

How does an exchange turn trading intent into a completed trade?

MechanismCounterpartyPrice sourceExecution immediacyTypical slippage causeBest for
Order-book exchangeResting human ordersBook depth and bids/offersDepends on matching availabilityInsufficient depth at priceLarge orders, advanced types
Automated market maker (AMM)Liquidity poolPool reserves formulaImmediate on swapPrice impact along pool curveInstant swaps and composability
Figure 227.1: Order-book vs AMM: quick comparison

The most basic function of an exchange is to turn trading intent into a completed asset transfer. If Alice wants to sell 1 BTC for dollars or for a stablecoin, and Bob wants to buy it, the exchange gives them a shared place to meet. But “meeting” can happen in two very different ways.

In an order-book exchange, Alice posts an offer and Bob accepts it, or Bob posts a bid and Alice accepts that. The exchange’s job is to maintain a live ledger of bids and offers, rank them, and match compatible orders according to rules. Coinbase’s exchange documentation describes a continuous order book using price-time priority: orders are ranked first by price and then, among equal prices, by arrival time. That tells you something important about price discovery. The market price is not chosen by the exchange operator in an arbitrary sense; it emerges from which standing orders are available and which incoming orders are willing to cross them.

In an automated market maker, or AMM, the exchange does not mainly wait for a human counterparty to post the other side. Instead, traders interact with a liquidity pool governed by a pricing rule. Uniswap’s documentation and whitepaper describe this as a noncustodial protocol where users swap against pooled liquidity. Here the exchange solves the coordination problem differently: instead of finding a specific seller for your buy, it offers a contract that can quote and execute a trade immediately so long as there is enough liquidity in the pool.

These are different mechanisms for the same underlying task. Both are trying to answer: how can someone trade now, at a price that reflects the market, without individually negotiating with strangers? The reason crypto exchanges split into these forms is that blockchains are good at some things and bad at others. Keeping a rich, rapidly updating order book fully on-chain can be expensive or slow on some networks. A pricing function embedded in a smart contract can be easier to execute transparently on-chain, but it changes the economics of liquidity and introduces different risks.

Custodial vs noncustodial exchanges: how custody changes your trading risks

ModelCustodySettlement locusMain trust pointMain riskBest for
Centralized exchangePlatform-controlled walletsOff-chain internal ledgerOperator solvency and controlsCustody and solvency riskHigh liquidity, advanced trading
Decentralized exchangeUser-held walletsOn-chain atomic settlementSmart contract correctnessSmart-contract bugs and MEVTransparency and user control
Figure 227.2: Custodial vs noncustodial exchanges

If you remember only one distinction, remember this one: **some exchanges take custody of your assets, and some do not. ** That single design choice changes almost everything else.

A typical centralized exchange, or CEX, is custodial. You deposit assets into wallets controlled by the platform. Internally, the exchange updates account balances in its own database when you trade. The trade may feel instantaneous because most of the action happens off-chain inside the exchange’s own system. Only deposits, withdrawals, and perhaps some treasury rebalancing touch the blockchain directly. This design is efficient. It allows deep order books, advanced order types, margin features, and high throughput. But it means the user is trusting the exchange not just to match trades honestly, but to safeguard assets, maintain solvency, and honor withdrawals.

That trust is not a theoretical issue. The collapse of Mt. Gox and the fraud case around FTX illustrate what can go wrong when a custodial exchange fails operationally or governance fails altogether. Mt. Gox became an early example of custodial risk at scale: if the exchange controls customer assets, weak security or internal dysfunction can become customer losses. The DOJ’s FTX case materials point in a different but related direction: a centralized exchange can fail not only from external attack, but from misuse of customer funds and internal control failures. The mechanism behind both episodes is the same. When users give up direct control of their assets, they gain convenience and trading performance, but they also take platform risk.

A decentralized exchange, or DEX, usually tries to remove that custody layer. In Uniswap’s model, users trade from their own wallets by calling smart contracts. The protocol is noncustodial in the ordinary sense that the user does not first hand over assets to a company account in order to trade. Settlement is tied directly to blockchain state changes. That reduces one kind of trust assumption: you are not asking an exchange operator to hold an omnibus pool of your funds and later return them. But this does not remove risk. It moves risk into different places; smart contract bugs, oracle design, transaction-ordering games, liquidity fragmentation, and the limits of on-chain execution.

So the right comparison is not “custodial bad, noncustodial good.” The deeper point is: **every exchange architecture chooses where trust and failure sit. ** CEXs concentrate trust in the operator and its controls. DEXs concentrate trust in code, blockchain execution, and protocol design.

How do order books and AMMs determine prices and match trades?

Once custody is clear, the next question is how the exchange turns orders into prices.

On a central limit order book, price discovery comes from the interaction of resting limit orders and incoming orders. Coinbase’s matching engine is a clean example. It runs a continuous first-come, first-serve order book, and orders execute in price-time priority. A trader can place a limit order saying, in effect, “I will buy 1 ETH at no more than this price,” or “I will sell 1 ETH at no less than this price.” These orders rest on the book if they are not immediately matched. When a new order arrives that crosses the spread, the engine executes against the best available resting order.

An important detail from Coinbase’s documentation helps reveal the underlying logic: trades happen at the resting order’s price, not the taker’s submitted price. This is sometimes called price improvement to the order on the book. Why does that matter? Because it shows what the order book is really doing. The taker is not dictating the final price merely by being aggressive; the taker is accepting the best available quote already posted by someone else. That preserves the priority and incentive structure of the book.

Imagine a simple trade. A seller has already posted an order to sell at 100. A buyer arrives willing to pay 102. If the trade executes immediately, it happens at 100, the resting price, not 102. The buyer was willing to pay more, but the market did not need that extra concession to clear the trade. This is not a cosmetic rule. It is part of how order books reward displayed liquidity and create stable expectations for market participants.

Order books also need rules for edge cases. Coinbase documents self-trade prevention, where two orders from the same user are not allowed to fill each other. The taker order’s self-trade-prevention instruction determines whether the system cancels one order, both orders, or decrements size. That may sound like an implementation detail, but it reflects a broader principle. Exchanges are not just passive ledgers. They encode market integrity rules that constrain how orders interact.

AMMs work differently. In Uniswap v3, the protocol still relies on a constant-product style market maker at its core, but liquidity can be concentrated into chosen price ranges. The essential mechanism is that the pool quotes prices as a function of its reserves and the active liquidity range. When a trader swaps into the pool, the trade itself changes the reserve balance, and the price moves along the rule implied by the pool.

This means the price is not found by searching a book of standing human offers. It is computed from the current state of the pool. The practical consequence is immediate execution without needing a directly matched counterparty, but also price impact that depends on pool depth. In an order book, the shape of the book determines slippage. In an AMM, the shape of the liquidity curve does.

How do buying ETH on a CEX and swapping on a DEX differ in practice?

Consider someone who wants to move from dollars into ETH.

On a custodial exchange, the process usually begins with a deposit. The user sends fiat or crypto to the platform, and the platform credits an internal account balance. Suppose the user enters a market order to buy ETH. The exchange’s matching engine receives that instruction and checks the order book for the best available asks. If there is enough liquidity near the current market, the order fills against existing sell orders. Some part might execute immediately, and any remainder behaves according to the order type and exchange rules. Internally, the exchange updates the buyer’s and sellers’ balances. No public blockchain necessarily records each internal fill. What feels like “settlement” to the user is often a database change backed by the exchange’s promise that withdrawals will later be honored.

Now compare a swap on Uniswap. The user connects a wallet that already holds a token, perhaps [USDC](https://scribe-topic-id.invalid/protocols.stablecoins.circle), and asks the protocol to swap it for ETH. There is no account deposit into a company-controlled omnibus wallet in the same sense. Instead, the smart contract reads the pool state, computes the quoted output based on the pool’s current reserves and active liquidity, and executes the transfer atomically on-chain if the user approves and the slippage constraints are met. Settlement and execution are fused together much more tightly. The transaction either lands on-chain according to the contract rules or it does not.

These experiences can feel similar at the interface level. In both cases, you click a button and receive ETH. But mechanically they are almost opposites. The CEX gives speed and flexibility by centralizing custody and internalizing settlement. The DEX gives direct on-chain execution by pushing the matching and settlement logic into smart contracts and blockchain state.

How do I read liquidity and order-book depth before I trade?

An exchange exists to make trade possible, but it becomes useful only when there is enough liquidity to trade without paying too much to do so. Liquidity is the capacity of the venue to absorb trades with limited price movement. Without it, quoted prices are decorative. The real price you get will move against you as soon as your order touches the market.

This is why large centralized exchanges often dominate in spot and derivatives volume. A literature review comparing CEXs and DEXs summarizes the basic tradeoff: DEXs emphasize user control and censorship resistance, while CEXs tend to offer higher liquidity and more advanced trading features. That does not mean every CEX is always more liquid than every DEX. It means the architecture of centralized exchanges has historically been better suited to aggregating large numbers of traders into deep books, especially for advanced products.

AMMs approach liquidity from another angle. Uniswap v3’s concentrated liquidity design is an attempt to use capital more efficiently by allowing liquidity providers to place capital only in price ranges where they expect trading to occur. The mechanism matters. If liquidity is spread uniformly across an enormous price domain, much of that capital sits idle most of the time. By concentrating it, LPs can make the active part of the curve denser, improving execution for traders near the current price. But this works only while the market price stays inside the selected range. When price leaves that range, the position becomes inactive and stops earning fees until rebalanced.

So liquidity is not just “how much money is in the system.” It depends on where that liquidity sits, how it is offered, and whether it remains available when markets move. In order books, this depends on market makers and posted depth at each price. In AMMs, this depends on pool design and LP behavior.

Why do DEX trades face MEV and transaction-ordering risk?

Once trading moves on-chain, another issue becomes central: transaction ordering. On many blockchains, especially general-purpose smart-contract chains, transactions are visible before they are finalized. That creates opportunities for actors to profit by inserting, reordering, or excluding trades. This broader phenomenon is often called maximal extractable value, or MEV.

Flashbots describes MEV as a source of negative externalities on Ethereum and builds tooling to mitigate some of those harms. For exchange users, the important part is not the institutional detail of Flashbots itself, but the mechanism. If your DEX trade appears in a public mempool before execution, another participant may be able to trade ahead of you, push the price, and let your own transaction complete at a worse rate. That is the economic logic behind common transaction-ordering attacks such as sandwiching.

This is a risk category that does not appear in the same way on a centralized off-chain order book. A CEX user faces venue integrity risk and custody risk, but not the same public-mempool execution game on each order. On a DEX, by contrast, execution fairness depends partly on blockchain ordering and block-building infrastructure. That is why exchange design and blockchain design are not separable. The exchange is only as fair, in some dimensions, as the transaction-inclusion process beneath it.

Not every chain exposes the same tradeoffs equally. Serum’s design on Solana, for example, shows that decentralized exchanges do not all have to be AMMs. Its documentation describes an on-chain central limit order book with price-time-priority matching. The point is not that one chain “solves” exchange design universally. It is that different performance envelopes make different market structures practical. Faster and cheaper chains can support more order-book-like behavior on-chain; more constrained environments often favor AMM designs.

What failure modes do centralized and decentralized exchanges commonly experience?

It is tempting to describe exchanges in idealized terms: CEXs provide efficiency; DEXs provide self-custody. But real systems fail in recurring ways, and those failure modes tell you what the architectures fundamentally depend on.

For custodial exchanges, the biggest recurring risks are asset custody, internal controls, and governance. A recent exchange-incident review covering 2009–2024 assembled 220 major incidents across CEXs and DEXs, with roughly $8.494 billion in total losses. For CEXs specifically, hot wallet or private-key compromise was reported as the most prevalent vector. That matches first principles. If a centralized exchange is promising redeemability for many users at once, its signing keys and treasury controls become extraordinarily valuable attack targets. Add leverage, opaque internal transfers, or poor segregation of duties, and the venue’s operational risks become systemic user risks.

For DEXs, the dominant failures shift. The same review finds that smart-contract and protocol-level exploits are among the most recurrent DEX vectors, alongside server or private-key hacks where administrative components exist. Again, this is what you would expect from the architecture. A DEX removes one trusted intermediary but replaces that discretion with code that must be correct under adversarial conditions. If the code governing pooled assets has a flaw, losses can be immediate and final.

This is why it is misleading to ask whether exchanges are “safe” in the abstract. The more precise question is: **safe against what, under which assumptions? ** A CEX may protect users from some on-chain execution risks while exposing them to custody and solvency risk. A DEX may protect users from exchange insolvency in the classic custodial sense while exposing them to smart contract risk, MEV, and chain-level congestion.

Why do regulators focus on crypto exchanges?

Even without relying on inaccessible regulatory text, the reason regulators focus on exchanges is conceptually straightforward. Exchanges are choke points where trading, custody, conversion, and user onboarding concentrate. When a platform holds customer assets, processes large transaction flows, and connects crypto markets to banking rails or stablecoin systems, failures there have outsized effects.

That is why the language of risk-based supervision, compliance, and virtual asset service providers repeatedly appears in global policy discussions about exchanges. The exact legal obligations vary by jurisdiction and by exchange model, but the underlying logic is practical rather than mysterious. Where there is concentrated custody, there is a need to examine reserves, controls, and misuse of funds. Where there is large-scale market access, there is concern about illicit finance, market abuse, and customer protection. And where systems are opaque, runs and contagion become more likely.

This does not mean every exchange should be thought of mainly through a regulatory lens. Mechanically, exchanges are market infrastructure first. But regulation keeps reappearing because exchange design creates concentrated points of trust, and concentrated trust tends to attract both users and oversight.

How should I weigh performance, trust‑minimization, and verifiability when choosing an exchange?

VenuePerformanceTrust levelVerifiabilityTypical tradeoff
Centralized exchangeHigh throughput, low latencyHigh operator trust requiredLimited on-chain evidenceSpeed at cost of custodial trust
Decentralized exchangeChain-limited throughput, higher feesMinimized operator trustFully on-chain settlementVerifiability at cost of speed/fees
HybridIntermediate performanceMixed trust assumptionsPartial on-chain settlementBalance of speed and transparency
Figure 227.3: Performance vs trust vs verifiability

At a high level, crypto exchange design is a three-way tradeoff between performance, trust minimization, and verifiability.

Centralized exchanges usually maximize performance. They can process large numbers of trades quickly, maintain sophisticated order types, and support market structures familiar from traditional finance. They do this by trusting an operator to custody assets and run the matching engine fairly. Users get speed and convenience, but must trust controls they cannot fully inspect from the blockchain alone.

Decentralized exchanges usually maximize verifiability and user-side control. The rules of the venue are embedded in smart contracts, settlement is visible on-chain, and users often keep direct control of assets until execution. But those gains come with costs: blockchain fees, ordering risk, limited expressiveness relative to the richest off-chain matching systems, and dependence on smart contract correctness.

hybrid forms exist, and the literature notes that the line can blur. Some systems keep order placement off-chain and settlement on-chain. Some use DAO governance but still rely on privileged administrative components. Some offer interfaces that feel decentralized while key parts of liquidity or routing remain operationally concentrated. So “CEX versus DEX” is a useful distinction, but not a complete one. The more reliable way to understand an exchange is to ask which parts of the trading stack are centralized and which are not.

Conclusion

A crypto exchange is best understood as a mechanism for custody, price formation, matching, and settlement in digital asset markets. Everything that matters follows from how those pieces are arranged.

If the venue is custodial and off-chain, you get speed, rich market structure, and dependence on the operator. If the venue is on-chain and noncustodial, you get direct settlement and transparency, but more exposure to smart contract design, blockchain ordering, and liquidity-curve mechanics. So the deepest question is not whether an exchange is “centralized” or “decentralized” as a slogan. It is where the system puts trust, where it puts risk, and how it turns a trade request into a final transfer of assets.

How do you improve your spot trade execution?

Improve execution by reading liquidity, choosing the right order type, and controlling slippage. On Cube Exchange you can fund your account and use limit or post-only orders to add liquidity, or use market orders when you need immediacy; follow the steps below to turn market-structure awareness into better fills on Cube.

  1. Fund your Cube account with fiat or a supported crypto transfer so you can place spot orders.
  2. Open the market page for the pair you want to trade and inspect the order book: note the best bid/ask, the spread, and cumulative size at the top few price levels to estimate likely slippage for your intended size.
  3. Choose an order type: place a limit or post-only order at your target price to be a maker (price improvement and lower fees), or use a market order only if you need an immediate fill and accept the spread.
  4. For larger orders, split the trade into multiple limit orders across nearby price levels or time-slice the order to reduce market impact, then review estimated fees and submit.

Frequently Asked Questions

How does the exchange’s custody model (custodial vs noncustodial) change the risks I face when trading?
+
Who holds assets before, during, and after a trade changes the whole risk profile: custodial (CEX) designs keep funds in exchange‑controlled wallets and internal ledgers, giving speed and rich features but exposing users to custody, solvency, and governance risk; noncustodial (DEX) designs keep users’ assets in their wallets and settle on‑chain, reducing operator custody risk but exposing users to smart‑contract bugs, on‑chain ordering/MEV, and liquidity‑curve limits.
Why do trades on order‑book exchanges often execute at the resting order’s price instead of the price I submitted as the taker?
+
On a limit order book the executed price is the resting order’s price, not the taker’s submitted aggressive price, because the matching engine fills against the best posted quote and preserves price‑time priority; this rewards displayed liquidity and prevents takers from unilaterally dictating execution prices.
How do automated market makers (AMMs) determine the price for a swap, and why do I sometimes get large slippage?
+
AMMs compute prices from the pool’s reserve balances and a fixed pricing rule, so each swap changes reserves and therefore the quoted price; that design gives immediate execution but causes price impact (slippage) that depends directly on pool depth and the AMM’s liquidity curve.
What is MEV and why does it make trading on DEXs riskier than trading on a centralized exchange?
+
Maximal Extractable Value (MEV) refers to profits extractable by reordering, inserting, or censoring visible pending transactions; on public mempool chains this enables sandwiching and similar attacks that can worsen execution for DEX traders, so on‑chain ordering and block‑building infrastructure materially affect fairness.
Why do centralized exchanges usually have better liquidity than decentralized exchanges?
+
Centralized exchanges historically concentrate many traders and market‑making activity off‑chain, which tends to produce deeper, more stable order books and richer product sets, so they often (though not always) provide higher immediate liquidity than many DEXs built on constrained on‑chain environments.
What actually tends to go wrong in practice with centralized versus decentralized exchanges?
+
Common CEX failures center on custody and internal controls (e.g., hot‑wallet/private‑key compromise, misuse of customer funds, governance failures), while common DEX failures center on smart‑contract or protocol exploits, plus ancillary admin or server key compromises — each architecture exposes different recurring vectors of loss.
Some platforms claim to be ‘hybrid’ or ‘decentralized’ — how can I tell which parts are truly centralized and which are not?
+
Hybrid or intermediate designs exist (e.g., off‑chain order placement with on‑chain settlement, or DAOs with privileged admin components), so the defining question is which layers are centralized: custody, matching, routing, or settlement — inspect which components are trust‑concentrated rather than relying on the ‘CEX/DEX’ label alone.
How does Uniswap v3’s concentrated liquidity change the experience and risks for liquidity providers?
+
In Uniswap v3 liquidity providers concentrate capital into chosen price ranges to increase capital efficiency, but when the market price moves outside a chosen range the position becomes inactive (turns into one asset, stops earning fees) and positions are non‑fungible, requiring periphery wrappers for auto‑compounding or fungible LP tokens.
Why do regulators focus so much attention on crypto exchanges specifically?
+
Regulators repeatedly target exchanges because they are choke points: platforms often hold concentrated custody, connect on‑ramps/off‑ramps and rails, and process large flows, so failures or misuse there can cause runs, contagion, illicit finance risks, and broad consumer harm.

Your Trades, Your Crypto