Lux Proposals
← All proposals
LP-0007Finalatscloborderbookfixmatching-engine

LP-007: CLOB Matching Engine

Abstract

The Lux CLOB is a high-performance central limit order book matching engine that operates as an SEC-registered Alternative Trading System. It supports equities, options, futures, and digital assets with sub-microsecond matching latency.

Implementations

| Engine | Language | Latency | Use Case |
|--------|----------|---------|----------|
| Pure Go | Go | ~1µs | Default, portable |
| CGO/C++ | C++ via CGO | ~200ns | Production HFT |
| MLX | Go + Metal | ~500ns | Mac Studio acceleration |
| FPGA | VHDL + Go | ~50ns | Colocation |
| On-chain | EVM precompile | ~1ms | LP-9020 (consensus-bound) |

Architecture


┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│  FIX Gateway │     │  REST/WS API │     │  NATS Cluster │
│  (port 9878) │     │  (port 8085) │     │  (multi-node) │
└──────┬───────┘     └──────┬───────┘     └──────┬───────┘
       │                    │                    │
       └────────────┬───────┘────────────────────┘
                    │
              ┌─────┴─────┐
              │  Matching  │
              │  Engine    │
              │            │
              │ Order Book │
              │ Price-Time │
              │ Priority   │
              └─────┬──────┘
                    │
         ┌──────────┼──────────┐
         │          │          │
    ┌────┴───┐ ┌────┴───┐ ┌───┴────┐
    │ Market │ │ Trade  │ │ Risk   │
    │ Data   │ │ Report │ │ Engine │
    └────────┘ └────────┘ └────────┘

Order Types

FIX Protocol

The engine accepts orders via FIX 4.4 over TCP or ZeroMQ:

Multi-Node Consensus

For distributed deployments, the engine uses NATS JetStream for order replication across nodes. Leader election via Raft ensures exactly-once execution.

Price Feeds

Aggregated from multiple sources:

References

Lux Research Papers

External Standards