Lux Docs
Dex

Architecture

DEX engine architecture and components

Matching Engine

Price-time priority CLOB with:

  • Limit orders, market orders, stop orders
  • IOC (Immediate or Cancel), FOK (Fill or Kill), GTC (Good Till Cancel)
  • Post-only, reduce-only modes
  • Cross-margin and isolated margin

Settlement

On-chain settlement follows a strict D matches · C settles split:

  • The D-Chain (DEX VM) matches the order, emits a DFillReceipt, and a D-validator quorum BLS-signs the receipt root.
  • The C-Chain receipt-settlement precompile 0x9999 (Uniswap-V4 PoolManager ABI — receipt-settlement, not a matcher) verifies that certificate inline (BLS verify is deterministic → fork-safe), debits/credits balances, and marks the receipt consumed. Settlement is Block-STM-parallel with fine-grained per-account/asset/receipt keys (no global hot slots); the verify path never calls a live matcher.

The certificate kind (certType: BLS day-1 → Q / PQ / ZK) upgrades via an on-chain verifier registry with no ABI change. 0x9010 is deprecated (aliases to 0x9999, same namespace).

Normative spec: LP-9999.

Market Data

Real-time order book snapshots, trade history, and OHLCV candles via WebSocket.

On this page