Skip to content本文へ移動

On-Chain vs Off-Chain Orderbooks · Trading Architecture · 1/4

Centralized Exchange Architecture

Before you can appreciate what decentralized perp exchanges are doing differently, you need to understand what they're competing against. Centralized exchanges (CEXs) like Binance, Bybit, and OKX have spent years optimizing one thing: speed.

The Matching Engine

At the heart of every CEX is a matching engine — a piece of software that takes incoming buy and sell orders and matches them according to price-time priority. The best bid meets the best ask, and a trade happens.

Modern CEX matching engines are engineering marvels:

This speed creates a specific market structure. Market makers can update quotes thousands of times per second, keeping spreads tight. High-frequency traders can arbitrage tiny price discrepancies across markets. The result is deep, liquid order books with penny-wide spreads on major pairs.

The Order Book Model

A CEX order book is a simple data structure:

Bids (buy orders) sorted by price descending:

Asks (sell orders) sorted by price ascending:

The spread ($60,000 to $60,001 = $1) represents the cost of immediate execution. Tighter spreads mean lower trading costs. CEXs achieve the tightest spreads because their speed allows market makers to quote aggressively — they can update or cancel quotes instantly if the market moves.

Custody: The Fundamental Tradeoff

Here's the catch: to trade on a CEX, you must deposit your funds into the exchange's wallets. Your crypto is no longer yours in any meaningful sense — it's an IOU. The exchange controls the private keys.

This creates several risks:

  1. Exchange insolvency: When FTX collapsed in November 2022, customer withdrawals were frozen and customers waited years for repayment through bankruptcy. This wasn't a smart contract bug — it was a trusted intermediary misusing customer funds.
  2. Withdrawal restrictions: Exchanges can freeze withdrawals at any time. During market stress, when you most need to access your funds, the exchange may lock them.
  3. Regulatory seizure: Governments can order exchanges to freeze specific accounts. Your funds are subject to the jurisdiction where the exchange operates.
  4. Hacks: Centralized exchanges are honeypots. Mt. Gox (2014), Bitfinex (2016), FTX (2022) — the history is littered with examples.

The Opacity Problem

CEX order books operate in a black box. You see the orders displayed on the frontend, but you have no way to verify:

When FTX collapsed, we learned that Alameda Research had a secret exemption from the liquidation engine — allowing it to hold positions that would have been liquidated for any other user. This kind of insider advantage is undetectable on a CEX.

What CEXs Do Well

Despite the risks, CEXs remain dominant for several reasons:

The question for DEXs isn't whether they can perfectly replicate a CEX — it's whether they can get close enough on performance while offering something a CEX fundamentally cannot: trustless, transparent, self-custodial trading.

チェーン上の板とチェーン外の板 · 取引所のしくみ · 1/4

中央集権型取引所のしくみ

分散型の無期限先物取引所が何を変えようとしているのかを知るには、まず競争相手を知る必要があります。Binance、Bybit、OKX のような中央集権型取引所(CEX)は、何年もかけて1つのことを磨いてきました。速さです。

マッチングエンジン

どの CEX にも、中心にマッチングエンジンがあります。届いた買い注文と売り注文を、価格優先・時間優先の順で突き合わせるソフトウェアです。一番高い買い注文と一番安い売り注文が出会うと、売買が成立します。

今の CEX のマッチングエンジンは、技術の粋を集めたものです。

この速さが、特有の市場の形を生みます。マーケットメイカーは1秒に何千回も気配を出し直せるので、スプレッドが狭く保たれます。高頻度取引をする人は、市場の間のわずかな価格差で裁定取引ができます。その結果、主要な銘柄では板が厚く流動性が高くなり、スプレッドはごくわずかになります。

板のしくみ

CEX の注文板(order book)は、単純なデータ構造です。

買い注文(bid) 価格の高い順:

売り注文(ask) 価格の安い順:

スプレッド($60,000 から $60,001 までの $1)は、すぐに約定させるためのコストです。スプレッドが狭いほど、売買のコストは下がります。CEX のスプレッドが一番狭いのは、速さのおかげです。市場が動いてもすぐに気配を直したり取り消したりできるので、マーケットメイカーは強気の気配を出せます。

預かり: 根本のトレードオフ

ここに落とし穴があります。CEX で売買するには、資金を取引所のウォレットに預けなければなりません。その暗号資産は、実質的にはもうあなたのものではありません。借用証書のようなものです。秘密鍵を持つのは取引所です。

ここから、いくつかのリスクが生まれます。

  1. 取引所の破綻: 2022年11月に FTX が破綻したとき、顧客の出金は止められました。顧客は破産手続きを通じて、返金を何年も待ちました。スマートコントラクトの不具合ではありません。信頼されていた仲介者が、顧客の資金を不正に使ったのです。
  2. 出金の制限: 取引所はいつでも出金を止められます。市場が荒れて一番資金が必要なときに、取引所が資金を凍結するかもしれません。
  3. 当局による差し押さえ: 政府は取引所に、特定の口座の凍結を命じられます。資金は、取引所がある国や地域の法律に従います。
  4. ハッキング: 中央集権型取引所は、攻撃者にとって格好の標的です。Mt. Gox(2014年)、Bitfinex(2016年)、FTX(2022年)と、例は数えきれません。

中が見えない問題

CEX の板は、中の見えない箱の中で動いています。画面に並ぶ注文は見えますが、次のことを確かめる手段はありません。

FTX が破綻したとき、Alameda Research が清算の仕組みから密かに除外されていたことがわかりました。ほかの利用者なら清算されていたポジションを、持ち続けられたのです。こうした内部の者だけの優遇は、CEX では外から見抜けません。

CEX が得意なこと

こうしたリスクがあっても、CEX が主流であり続けているのには理由があります。

DEX にとっての問いは、CEX をそっくり再現できるかではありません。性能で十分に近づきつつ、CEX には根本的にできないものを差し出せるかです。それは、誰も信頼しなくてよく、中が見え、資金を自分で持ったままできる売買です。