Institutional-grade Alternative Trading System (ATS) with CLOB matching engine, multi-protocol gateway, pre/post-trade compliance, and regulatory reporting.
- CLOB Matching Engine — Central limit order book with price-time priority
- Multi-Protocol Gateway — HTTP/REST, FIX 4.4, WebSocket, JSON-RPC, ZAP
- Pre-Trade Compliance — 30+ jurisdictions, sanctions, PEP/EDD, offering-type gating
- Post-Trade Surveillance — Wash trading, structuring, velocity, price spike detection
- Regulatory Reporting — FINRA OATS, ATS-N, CAT, MiFID II
- Circuit Breakers — Automated market halts on anomalous activity
Clients
+----+----+----+----+
| | | | |
HTTP FIX WS RPC ZAP
| | | | |
+----+----+----+----+
|
[Gateway :8080]
|
+-------+-------+
| |
[Compliance] [Engine]
Pre-trade CLOB
| |
+-----+------+
|
[Surveillance]
Post-trade
|
[Reporting]
FINRA/SEC
# Build
go build -o cexd ./cmd/cexd/
# Run
CEX_JWT_SECRET=your-secret ./cexd
# Dev mode (no auth)
./cexd
| Method |
Path |
Description |
GET |
/api/v1/markets |
List active markets |
GET |
/api/v1/markets/{symbol} |
Market details |
GET |
/api/v1/markets/{symbol}/book |
Order book (?depth=20) |
| Method |
Path |
Description |
POST |
/api/v1/accounts/{id}/orders |
Submit order (compliance-gated) |
GET |
/api/v1/accounts/{id}/orders |
List orders |
GET |
/api/v1/accounts/{id}/orders/{oid} |
Get order |
DELETE |
/api/v1/accounts/{id}/orders/{oid} |
Cancel order |
| Method |
Path |
Description |
POST |
/api/v1/accounts/{id}/register |
Register with compliance |
GET |
/api/v1/accounts/{id}/status |
Compliance status |
| Method |
Path |
Description |
GET |
/api/v1/admin/reports/finra |
FINRA OATS reports |
GET |
/api/v1/admin/reports/ats |
ATS-N quarterly |
GET |
/api/v1/admin/surveillance/alerts |
Surveillance alerts |
POST |
/api/v1/admin/markets/{symbol}/halt |
Halt trading |
POST |
/api/v1/admin/markets/{symbol}/resume |
Resume trading |
| Type |
TIF |
Description |
limit |
GTC, IOC, FOK, DAY |
Limit at specified price |
market |
IOC, FOK |
Market at best available |
Every order passes through before reaching the matcher:
- Sanctions screening (blocked accounts)
- PEP screening (EDD + source of funds)
- Adverse media checks
- FATF high-risk country (enhanced KYC level 3)
- Per-jurisdiction, per-asset-class KYC minimums
- Offering-type gating (Reg D, Reg S, Reg A+, Reg CF)
- Per-account order size + daily limits
- Market halt status
| Detection |
Method |
| Wash trading |
Circular trade pattern analysis |
| Large trades |
Threshold-based alerts |
| Structuring |
Just-below-threshold detection |
| Velocity |
Rate-of-order monitoring |
| Price spikes |
Second-derivative (parabolic crash) |
| Env Var |
Default |
Description |
CEX_ADDR |
:8080 |
Listen address |
CEX_JWT_SECRET |
(none) |
JWT secret; empty = dev mode |
CEX_JWT_ISSUER |
https://hanzo.id |
Expected JWT issuer |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o cexd ./cmd/cexd/
docker build --platform linux/amd64 -t ghcr.io/luxfi/cex:latest .
Copyright 2024-2026, Lux Partners Limited. All rights reserved.