Skip to main content

Exchange Architecture

QFEX operates as a perpetual futures exchange. Order matching, position management, margin calculations and liquidations are performed by QFEX’s offchain exchange infrastructure, while supported stablecoin deposits and withdrawals are executed through public blockchain networks. This architecture is designed to combine blockchain-native funding rails with the latency, throughput and order functionality required by professional market participants. QFEX operates a Central Limit Order Book (“CLOB”). Displayed and, where enabled, private orders participate in the same matching engine, risk controls and settlement process. Public order-book data shows displayed liquidity only; it does not reveal every executable order.

Execution priority

For immediate limit/market orders, dark: true makes only private counterparties eligible; GTC limits can take both visibility classes regardless of dark. Eligible resting orders are then ranked by price, display priority and time:
  1. The best executable price takes priority, regardless of visibility. An incoming buy executes against lower asks first; an incoming sell executes against higher bids first.
  2. At the same price, displayed orders take priority over private orders, even when a private order arrived earlier.
  3. Within each price and visibility class, orders execute in their existing queue order. The applicable speed bump determines when an incoming request reaches the matching engine.
For example, an ordinary buy that can pay USD 100.10 executes against a private ask at USD 100.05 before a displayed ask at USD 100.10. At USD 100.10, displayed asks execute before private asks. A book containing only displayed orders therefore retains price-time priority. Ordinary aggressive orders access both displayed and private liquidity automatically. A private-only immediate order makes displayed orders ineligible, even at equal or better prices. It takes the best eligible private prices within its limit, where applicable, and the normal price bands, with time priority at the same price. It can execute at, inside or outside the displayed touch, or without a displayed quote; it never falls back to displayed liquidity. Display priority does not override post-only instructions. If an incoming displayed or private ALO would trade against an eligible resting private order, the incoming ALO is cancelled without a trade. The existing order remains, subject to the normal self-trade-prevention and passive-cleanup rules. The exchange code is written primarily in Rust and runs in Availability Zone apne1-az4 in the AWS Tokyo region (ap-northeast-1). Both market data and order entry access is via GUI and API (websockets), with equal access on all terms for all clients.

Displayed and executable liquidity

The exchange’s canonical order book and trade records contain both displayed and private liquidity. Private orders and executions participate in funding calculations, impact bid and ask prices, mark-price inputs, margin, exposure, fees, positions, liquidations, settlement, volume and candles in the same way as otherwise equivalent displayed orders and executions. Visibility does not create a separate economic book or exclude an execution from accounting. Private resting quantities are removed from public best-bid/offer, level-2 and aggregated-depth publications. At a price containing both displayed and private orders, only displayed quantity is published. Private-only levels do not count towards a public depth limit. Executions against displayed resting orders are public. A regular taker also produces a public print against a private resting order. Private-on-private executions stay off the public tape. All executions remain in counterparty fills, settlement and the relevant economic calculations. Private-only matching does not use the displayed BBO as an execution constraint and does not promise price improvement. Selecting private-only matching changes counterparty eligibility, not the full-book inputs used for funding, mark prices or other economic calculations.

Emergency Exit

QFEX separates its trading infrastructure from its custody and withdrawal rails. In normal operation, order matching, positions, margin calculations and liquidations are handled by QFEX’s infrastructure, while client stablecoins are held with US regulated custodians and withdrawals are paid over supported public blockchain networks. If the trading system becomes unavailable, or QFEX determines that normal trading cannot safely continue, QFEX may enter an Emergency Exit state. In this state, new order entry can be disabled, open positions can be closed or settled using the latest valid Mark Price under the Trading Rulebook, and client balances can be reconciled for withdrawal. The purpose of the Emergency Exit is to ensure that a failure of the matching or trading infrastructure does not require normal trading operations to continue before client collateral can be returned.

Speed Bump Implementation

QFEX implements a 500-millisecond speed bump on all limit orders to protect against latency arbitrage and create a level playing field for all participants. When a limit order is received, it is held in a queue before being sent to the order book. This delay applies uniformly regardless of the participant’s technological sophistication or network connectivity. The speed bump applies to all non-ALO orders including new submissions and modifications, but not to any other request. This implementation reduces advantages gained through technological superiority alone and encourages broader market participation, typically leading to improved liquidity and more efficient price discovery. It is in line with standard industry practice to create a fair market place, and encourage the provision of liquidity. Visibility does not provide a speed-bump exemption. Private immediate orders are evaluated when they reach the matching engine after the applicable delay, not necessarily when the API receives them. Private ALO orders follow the same delay treatment as displayed ALO orders.

Self-trade Prevention

Traders may not self-trade on QFEX. In the event of two otherwise eligible orders from the same trader matching, the passive order will be canceled. This applies across displayed and private liquidity. A private-only immediate order does not consume or cancel displayed orders through self-trade prevention because those orders are not eligible counterparties for that instruction.