CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Blockchain & Web3

⛓️ Blockchain & Web3 Β· C4 Architecture Β· Pro

Crypto Exchange Architecture

The main parts of a centralised crypto exchange: a matching engine, wallets split between hot and cold storage, deposits and withdrawals, and compliance checks.

More Blockchain & Web3 templates

C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.

Drawing diagram…

What this diagram shows

  • Most funds are kept in offline cold wallets
  • Withdrawals pass compliance and risk checks
  • The matching engine keeps its order book in memory

Prompt used

Crypto exchange: traders use web and mobile apps through an API gateway. The matching engine keeps the order book in memory and writes trades to a trade log. A ledger service tracks every user's balances. A wallet service manages hot wallets for daily withdrawals and cold wallets (offline, multi-signature) for most funds, and watches blockchain nodes for deposits. A compliance service does KYC, travel rule and sanctions screening for withdrawals.

Mermaid code
C4Container
title Crypto Exchange
Person(trader, "Trader", "Buys and sells crypto")
System_Boundary(ex, "Exchange") {
  Container(app, "Trading Apps", "React / React Native", "Charts and orders")
  Container(gw, "API Gateway", "Go", "REST and WebSocket")
  Container(me, "Matching Engine", "C++", "In-memory order book")
  Container(led, "Ledger Service", "Java", "User balances")
  Container(wal, "Wallet Service", "Go", "Deposits and withdrawals")
  Container(comp, "Compliance Service", "Python", "KYC and screening")
  ContainerDb(db, "Ledger DB", "PostgreSQL", "Balances and trades")
}
System_Ext(nodes, "Blockchain Nodes", "Bitcoin, Ethereum")
System_Ext(cold, "Cold Wallet", "Offline multi-signature")
Rel(trader, app, "Uses")
Rel(app, gw, "Orders and quotes")
Rel(gw, me, "Places orders")
Rel(me, led, "Settles trades")
Rel(led, db, "Reads/writes")
Rel(gw, wal, "Withdraw request")
Rel(wal, comp, "Screen withdrawal")
Rel(wal, nodes, "Broadcasts and watches")
Rel(wal, cold, "Refills hot wallet")

Inside this diagram

A C4 architecture diagram of Crypto Exchange with 1 person, 7 building blocks, 2 outside systems and 9 relationships.

People

  • Trader: Buys and sells crypto

Inside the system

  • Trading Apps (React / React Native): Charts and orders
  • API Gateway (Go): REST and WebSocket
  • Matching Engine (C++): In-memory order book
  • Ledger Service (Java): User balances
  • Wallet Service (Go): Deposits and withdrawals
  • Compliance Service (Python): KYC and screening

Databases and queues

  • Ledger DB (PostgreSQL): Balances and trades

Outside systems

  • Blockchain Nodes: Bitcoin, Ethereum
  • Cold Wallet: Offline multi-signature

Boundaries

  • Exchange

How they connect

  • Trader β†’ Trading Apps: Uses
  • Trading Apps β†’ API Gateway: Orders and quotes
  • API Gateway β†’ Matching Engine: Places orders
  • Matching Engine β†’ Ledger Service: Settles trades
  • Ledger Service β†’ Ledger DB: Reads/writes
  • API Gateway β†’ Wallet Service: Withdraw request
  • Wallet Service β†’ Compliance Service: Screen withdrawal
  • Wallet Service β†’ Blockchain Nodes: Broadcasts and watches
  • Wallet Service β†’ Cold Wallet: Refills hot wallet

Make your own diagram like this

Describe your own system in plain English and the AI C4 diagram generator draws it in seconds, in the same style as this template.

Related templates

SequenceBlockchain & Web3

Crypto Withdrawal Sequence

How an exchange processes a crypto withdrawal safely: balance hold, 2FA, risk and address screening, signing, broadcast and confirmations.

C4 ArchitectureProBlockchain & Web3

NFT Marketplace

How an NFT marketplace works: listings signed off-chain, metadata on IPFS, and sales settled by a marketplace smart contract.

FlowchartBlockchain & Web3

Smart Contract Upgrade Process

How a team safely upgrades a smart contract behind a proxy: audit, testnet rehearsal, multi-signature approval and a timelock before the change goes live.

State MachineBlockchain & Web3

Blockchain Transaction States

The states a blockchain transaction goes through from signing to final confirmation, including replacement and dropped transactions.

NetworkBlockchain & Web3

Hot and Cold Wallet Custody

How a custodian separates internet-connected hot wallets from offline cold storage, with signing hardware and an air-gapped transfer process.

DeploymentProBlockchain & Web3

Web3 dApp Deployment

Where a decentralised app's parts run: frontend on IPFS, contracts on a layer-2 chain, and supporting services like RPC providers and an indexer.