Start

Architecture

HyperDex is a hybrid off-chain/on-chain system. The division of responsibilities is strict: everything that can be done off-chain is done off-chain (pricing, competition, selection), and everything that must be trustless is done on-chain (signature verification, atomic token transfer, fee collection).

                  OFF-CHAIN                          ON-CHAIN (Soroban)
  ┌──────────────────────────────────────┐   ┌──────────────────────────────────────┐
  │            HyperDex Backend          │   │  pool_registry                       │
  │  • WebSocket hub for makers          │   │    └─ maker registry + signing keys   │
  │  • Auction orchestration             │   │  quote_verifier                      │
  │  • Best-bid selection                │   │    └─ sig verify + orchestration     │
  │  • REST API for frontend             │   │  maker_pool (one per maker)          │
  └──────────────┬───────────────────────┘   │    └─ token inventory + swap exec     │
                 │ RFQ broadcast (WS)        │  fee_distributor                     │
  ┌──────────────▼───────────────────────┐   │    └─ fee accumulation + withdrawal  │
  │          Maker SDK (N makers)        │   └──────────────────────────────────────┘
  │  • Prices swap using oracle          │            ▲
  │  • Signs Quote struct (ed25519)      │────────────┘  taker submits signed quote
  │  • Posts bid to backend              │           quote_verifier.execute_quote()
  └──────────────────────────────────────┘

Why this split?

Putting pricing on-chain would mean every price update costs gas and is publicly visible — giving arbitrageurs a free look at market intent. Keeping pricing off-chain means makers can react to real-world market conditions in milliseconds, with no gas cost, while the on-chain layer only sees the final signed commitment.

The on-chain contracts do exactly one thing: verify that a registered maker cryptographically committed to a price, then atomically execute it. There is no room for manipulation between the quote and the settlement.

Component Summary

ComponentLocationWhy it exists
BackendOff-chain serverCoordinates the auction: broadcasts RFQs to makers, collects bids, selects best, serves result to frontend
Maker SDKOff-chain (each maker)Prices swaps using oracle data, signs quotes with ed25519, submits bids to backend
FrontendBrowserTaker UI — connects Freighter wallet, starts auctions, shows results, submits signed quote on-chain
pool_registrySoroban contractStores which addresses are registered makers and what their hot signing keys are
quote_verifierSoroban contractTaker calls this — verifies ed25519 signature, checks expiry, calls the maker_pool and fee_distributor
maker_poolSoroban contract (one per maker)Custodies that maker’s token inventory; executes the atomic token swap on instruction from quote_verifier
maker_pool_factorySoroban contractDeploys a dedicated maker_pool per maker at registration (deterministic salt)
fee_distributorSoroban contractAccumulates protocol fees per token; admin-controlled withdrawal to treasury
HyperDex | Trade Without Limits