What is this?

This is a HFT simulator I designed to try and show various developer configurables, and their effects on metrics (most importantly: latency).

• Infrastructure Controls: The left sidebar has toggles for HFT infra components: co-location, kernel bypass, NUMA tuning, FPGA acceleration, and NIC timestamping. Each setting impacts latency and performance metrics in real-time (preset multipliers).

• Live OCaml Strategy Engine: The strategy editor supports both simple parameter adjustment and advanced real OCaml compilation. In Advanced mode, your code is compiled server-side using js_of_ocaml and executed in an isolated WebWorker environment. Click the (?) inside the editor for more info

• HFT Tutor: An AI assistant specifically trained on this simulator's architecture and HFT concepts. Use the green sidebar on the right to ask questions about any component, strategy logic, or trading concepts you encounter. I recognize this is a very confusing dashboard, so please feel free to ask the LLM chatbot any questions about the setup (it has full context--it even has live access to the state of your run)

HFT Core Engine - Deterministic MVP

WebWorker • Seeded RNG • Event Log • tick → strategy → orders → venue → fills

Run State: IDLE
✓ Determinism OK
Worker: Ready
Hash:
Infrastructure Stack
Network Infrastructure
Co-location
Fiber Speed 10Gbps
Distance <1m
Impact: Feed latency ±200µs
CPU Performance
Cores Isolated 4-7
Kernel Bypass
NUMA Tuning
Impact: Processing jitter ±50µs
FPGA Acceleration
Feed Decode
Order Logic
Risk Checks
Impact: Sub-microsecond gains
Hardware Timestamps
NIC Timestamping
PTP Sync ±25ns
Clock Source GPS
Impact: Audit precision
HFT Tutor
Hi! I'm your HFT tutor. Ask me anything about this simulator or high-frequency trading!
I can explain how each component works, why infrastructure matters in real HFT, and help you understand your strategy performance. Try asking "Why does co-location matter?" or "Explain my P&L"
HFT Tutor is typing...
Events Processed
0
Current Tick
0
Total Orders
0
Total Fills
0
P&L
$0
Position
0
Price Feed
$100.00
Normal
Spread: 5¢
Strategy (OCaml)
Ready
Compiled: 0ms
Orders
0
Venue
Connected
Fills
0
Event Log (Deterministic) - Readable Format
Tick Event Type Key Data RNG State Checksum
Latency Waterfall (p50/p95/p99)
FEED
p99
p95
p50
12µs
STRATEGY
p99
p95
p50
23µs
ORDERS
p99
p95
p50
8µs
VENUE
p99
p95
p50
48µs
FILLS
p99
p95
p50
18µs
Bottleneck: VENUE (48µs p95) Total p95: 87µs
OCaml Strategy Editor
?
Function signature: let price_strategy mid_price position inventory = (bid_price, ask_price)
Key variables: base_spread, inventory_skew, bid_price, ask_price
Ready to compile. Click "Compile & Apply" to test your strategy.
OCaml Strategy Compilation

This editor lets you write OCaml trading strategies that actually affect your bot's behavior. Simple mode uses regex to extract your numeric values (like spread and skew) and plugs them into a pre-compiled strategy - it's instant but limited to tweaking numbers.

Advanced mode sends your entire OCaml code to our backend compiler service, which runs the full js_of_ocaml toolchain to produce real JavaScript that executes in an isolated WebWorker. This takes ~11 seconds but gives you complete control over the strategy logic.

Both modes affect the actual trading simulation - you're not just editing dummy code, you're programming a live market-making bot that processes real market ticks and generates P&L.

═══ LEADERBOARD ═══
Enter Name:
Your Score: 0pts