Crypto Exchange — Detailed#
flowchart TB
subgraph Apps
WEB
APP([Mobile])
API[Pro / FIX API]
end
subgraph Edge
CDN
GW
WAF
RL[Rate limit]
end
subgraph Trade[Trading]
ME[Matching Engine<br/>per market]
OB[(Order book)]
EVT[[Event log]]
RISK[Pre-trade risk]
end
subgraph Custody[Custody]
HOT[Hot wallet]
WARM[Warm wallet multi-sig]
COLD[Cold wallet / HSM]
SWEEP([Sweeper jobs])
end
subgraph Chain[Chains]
BTC[Bitcoin node]
ETH[Ethereum node]
EVM[Other EVM]
SOL[Solana]
CONF[Confirmation watchers]
MEMP[Mempool monitor]
end
subgraph Ledger
LED[(Internal ledger<br/>double-entry)]
BAL[Balance projection]
DEP[Deposits]
WD[Withdrawals]
end
subgraph Risk[Risk & Compliance]
KYC[KYC / KYB]
AML[AML monitoring]
SAN[Sanctions screening]
TRAV[Travel rule]
LIM[Withdrawal limits]
end
subgraph Mkt[Market Data]
L1[L1/L2 feeds]
WSF([WS feeds to clients])
HIST[(Historical OHLCV)]
end
subgraph Ops
OBSV[Metrics / traces]
RUNB[Runbooks]
SOC[24x7 SOC]
end
Apps --> CDN --> GW --> RL --> Trade
Trade --> Ledger
Ledger --> Custody
Custody --> Chain
Risk --- Apps
Risk --- Custody
Mkt --- Trade
classDef client fill:#dbeafe,stroke:#1e40af,stroke-width:1px,color:#0f172a;
classDef edge fill:#cffafe,stroke:#0e7490,stroke-width:1px,color:#0f172a;
classDef service fill:#fef3c7,stroke:#92400e,stroke-width:1px,color:#0f172a;
classDef datastore fill:#fee2e2,stroke:#991b1b,stroke-width:1px,color:#0f172a;
classDef cache fill:#fed7aa,stroke:#9a3412,stroke-width:1px,color:#0f172a;
classDef queue fill:#ede9fe,stroke:#5b21b6,stroke-width:1px,color:#0f172a;
classDef compute fill:#d1fae5,stroke:#065f46,stroke-width:1px,color:#0f172a;
classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1px,color:#0f172a;
classDef external fill:#fce7f3,stroke:#9d174d,stroke-width:1px,color:#0f172a;
classDef obs fill:#f3e8ff,stroke:#6b21a8,stroke-width:1px,color:#0f172a;
class APP,WSF client;
class API,RL,ME,RISK,HOT,WARM,COLD,BTC,ETH,EVM,SOL,CONF,MEMP,BAL,DEP,WD,KYC,SAN,TRAV,LIM,L1,RUNB,SOC service;
class OB,LED,HIST datastore;
class EVT queue;
class SWEEP compute;
class AML,OBSV obs;
Deposits & withdrawals#
- Each user gets unique deposit addresses per chain.
- Watcher confirms N blocks → credit internal ledger.
- Withdrawal: sign tx from hot wallet; if exceeds threshold, route to warm/cold multi-sig.
Custody best practices#
- 95%+ assets cold; rotate keys; geographically separate signers.
- Hot wallet sized to expected withdrawal flow only.
Matching#
- Same as stock exchange but with crypto pairs.
- Often higher tx volume, lower per-order latency requirements.
Glossary & fundamentals#
Concepts referenced in this design. Each row links to its canonical page; the tag column shows whether it is a high-level (HLD) or low-level (LLD) concept.
| Tag | Concept | What it is | Page |
|---|---|---|---|
HLD |
CDN | edge caching for static assets | cdn |
HLD |
LSM vs B-Tree engines | WAL, memtable, SSTables, compaction | storage-engines-lsm-btree |
HLD |
Observability | metrics, logs, traces, SLOs | observability |