Open Source · Live Benchmark Arena for Matching Engines

Build the
exchange that
breaks exchanges.

QuanTime is an open-source distributed benchmarking platform that stress-tests trading matching engines. Upload an order-matching engine; QuanTime containerizes it under strict isolation, bombards it with a distributed bot fleet, and scores it live on latency, throughput, and correctness. It is a crash-test lab for exchange software, not a trading bot.

// Throughput
~24K ord/s
single bot-fleet replica, docker compose
// Latency
p50 0.25ms
p99 ~35ms · 0% transport errors
// Components
4 core
sandbox · bot fleet · telemetry · board
// License
Open Source
public repo on GitHub
01 / Pipeline

How it works.

QuanTime runs every engine through the same five-stage pipeline: Upload, Isolate, Load, Measure, Rank. The same harness, the same bot fleet, the same scenario for every submission, so results are comparable and reproducible.

~ / quantime / pipeline.md
read-only
01# QUANTIME PIPELINE
02$ Upload a matching engine, get a live score on speed, throughput, and correctness.
03 
04upload → push a .tar.gz with a Dockerfile (or use the bundled sample engine).
05isolate → QuanTime builds it into a hardened sibling container: 256m, 1 CPU, cap-drop ALL, read-only.
06load → a distributed bot fleet bombards it with limit / market / cancel orders at peak volume.
07measure → every interaction is captured: exact p50 / p90 / p99, TPS, and correctness diffs.
08rank → a composite score streams to a live leaderboard over WebSocket.
09 
10# SCORE
11score = 0.40·speed + 0.40·throughput + 0.20·correctness
12 
13$ echo "performance data is the only source of truth."
14
02 / Architecture

Four subsystems.
One contract.

QuanTime is a set of decoupled Go microservices that talk over NATS and persist to TimescaleDB and Redis. Each subsystem does one job and does it under load.

// 01 · ingestion dockercgroupscap-drop

Submission & Sandboxing

QuanTime accepts a tar/zip upload of your engine with a path-traversal guard and Dockerfile validation, then builds and runs it as a hardened sibling container. Every submission gets an identical, fair hardware budget.

  • --memory 256m, --cpus 1, --pids-limit
  • --cap-drop ALL, --read-only, no-new-privileges
  • isolated bridge network, no host access
  • upload validation + path-traversal guard
// 02 · load natsgoroutinesk8s-hpa

Distributed Bot Fleet

A NATS-driven goroutine pool generates realistic market traffic against your engine: sustained, burst, and adversarial profiles of limit, market, and cancel orders, all reproducible from a deterministic seed.

  • deterministic xoshiro256** RNG for repeatable runs
  • sustained / burst / adversarial traffic profiles
  • limit, market, and cancel order flow
  • scale via compose --scale botfleet=N or a k8s HPA
// 03 · telemetry timescalepgx1hz

Telemetry & Validation

Every interaction between the bot fleet and your engine is ingested into a TimescaleDB hypertable using pgx CopyFrom batching, then aggregated into exact percentiles, no sampling, no approximation.

  • EXACT percentile_cont p50 / p90 / p99 + TPS
  • pgx CopyFrom batched ingest, durable on disk
  • live 1Hz snapshots while the run is in flight
  • 480,480 telemetry rows per ~20s run
// 04 · ranking postgresrediswebsocket

Real-Time Leaderboard

Scores land in Postgres as the source of truth, are cached hot in a Redis sorted set, and stream to the browser over a live WebSocket so rankings update the instant a run finishes.

  • Postgres source-of-truth for run history
  • Redis ZSET hot cache for instant ranking
  • live WebSocket stream to the console
  • composite score: 0.4 speed + 0.4 tps + 0.2 correctness
03 / Why QuanTime

What sets it apart.

Plenty of tools fire orders at an endpoint. QuanTime checks whether your engine is actually correct, reviews your code privately, and accepts any language behind a Dockerfile.

// 01 · correctness

Independent correctness oracle

A separate reference order book replays a deterministic 10-order scenario (crossing, partial fills, market order, cancel, sweep) through both your engine and the oracle, then diffs fills order-by-order. A broken engine scores 50, not 100, and the unit tests prove it.

price-time priorityfill accuracyorder-by-order diff
// 02 · ai analyzer

Multi-agent AI code analyzer

A multi-agent static reviewer (security, performance, correctness) reads a submission and returns a structured report. The LLM backend is pluggable — Google Gemini by default, with OpenAI and Anthropic Claude selectable. You bring your own API key; it is stored only in your browser and never persisted server-side.

geminiopenaiclaudebring-your-own-key
// 03 · any language

Multi-language engines

Because submissions are containerized, the engine language is up to you. QuanTime ships example engines in Go, C++, and Python, plus a real-world order book, proving it accepts any language behind a Dockerfile + POST /submit.

goc++pythondockerfile + POST /submit
04 / Quickstart

Get started.

QuanTime runs end-to-end on your laptop with Docker. Bring it up, open the console, and benchmark the bundled sample engine or your own.

~ / quantime / quickstart.sh
bash
01# 1. clone & bring the whole platform up
02$ git clone https://github.com/Lagmator22/quantime
03$ cd quantime && docker compose up --build
04 
05# 2. open the console
06$ open http://localhost:8080/platform/console.html
07 
08# 3. click "Use the sample engine" (or upload your own .tar.gz
09# with a Dockerfile), then "Launch benchmark"
10$ # watch live metrics, score, and leaderboard
11 
12# scale the bot fleet horizontally when you need more load
13$ docker compose up --scale botfleet=4
05 / Verified results

Measured, not promised.

Every number below comes from a real run on a laptop with a single bot-fleet replica via docker compose. No marketing math, just what the telemetry recorded.

// throughput
~24,000

orders per second, single bot-fleet replica.

// latency p50
0.25ms

median acknowledgment time under load.

// latency p99
~35ms

tail latency across the run.

// transport errors
0%

zero transport errors over the run.

// telemetry rows
480,480

captured per ~20-second run.

// percentiles
EXACT

percentile_cont p50 / p90 / p99, no sampling.

// score weights
.4·.4·.2

speed, throughput, correctness composite.

// correctness
ORACLE

independent reference book, fill-by-fill diff.

06 / Tech stack

Built on solid metal.

Go microservices over NATS JetStream, exact analytics in TimescaleDB, hot rankings in Redis, fronted by Caddy. Reproducible infra and CI that takes correctness seriously.

// runtime

Services & data

Decoupled Go microservices communicate over NATS JetStream and persist to TimescaleDB and Redis, all behind a Caddy reverse proxy.

gonats-jetstreamtimescaledbrediscaddydocker
// infrastructure

Infra as code

A verified docker-compose stack runs the whole platform, with Kubernetes manifests and Terraform for scaling beyond a single machine.

docker-composekubernetesterraformk8s-hpa
// quality

CI & testing

CI runs build, vet, and tests with the Go race detector on every change, and the correctness oracle is unit-tested to catch a broken engine.

go buildgo vetgo test -raceoracle tests
07 / Sample preview

Real-time scoring,
sample data.

A preview of the live leaderboard using seeded sample entries. Run the platform locally to see your own engine scored and ranked here in real time over WebSocket.

// sample.run · top 8 · preview

streaming
# Engine p50 p99 TPS err Score
// orders processed
0orders
// active bot fleet
0workers
// orderbook · ETHX-USD · L5
08 / FAQ

Common questions.

Everything you need to know about what QuanTime is, who it is for, how scoring and correctness work, how submitted code is isolated, and how it scales.

What is QuanTime?

QuanTime is an open-source distributed benchmarking and hosting platform that stress-tests trading matching engines. You upload an order-matching engine; QuanTime containerizes it under strict isolation, bombards it with a distributed bot fleet, and scores it live on latency, throughput, and correctness.

Is it a trading bot? Does it make money?

No. QuanTime does not trade and does not make money. It is a test and benchmark arena, a crash-test lab for exchange software. It generates synthetic order flow purely to measure how a matching engine behaves under load, never to take positions in a real market.

Who is it for?

QuanTime is built for the people who build matching engines: quant and HFT developers, exchange and trading-infrastructure engineers, and anyone writing an order book who wants objective, reproducible numbers on how their engine performs under realistic stress.

How do I benchmark my engine?

Package your matching engine with a Dockerfile and send it to the platform with POST /submit, or upload the .tar.gz directly in the console. QuanTime builds it, isolates it, runs the bot fleet against it, and shows you the live score. You can also start from the bundled sample engine.

How is the score computed?

The composite score is a weighted sum: 0.40 × speed + 0.40 × throughput + 0.20 × correctness. Speed and throughput come from the exact percentile and TPS telemetry, and correctness comes from the independent oracle, so an engine has to be fast, sustained, and correct to rank well.

How does it validate correctness?

An independent reference order book replays a deterministic 10-order scenario (crossing, partial fills, a market order, a cancel, and a sweep) through both your engine and the oracle, then diffs the fills order-by-order. The result feeds the correctness term of the composite score. The oracle is unit-tested to catch a broken engine, which scores 50 instead of 100.

How is submitted code isolated?

Each submission runs as a hardened sibling container with --memory 256m, --cpus 1, a pid limit, --cap-drop ALL, --read-only, and no-new-privileges, on an isolated bridge network with no host access. Uploads are validated with a path-traversal guard and Dockerfile checks before anything is built.

Can it scale, and is it open source?

Yes to both. The bot fleet scales horizontally with docker compose up --scale botfleet=N or a Kubernetes HPA, and the project ships docker-compose, Kubernetes manifests, and Terraform. QuanTime is open source, with the full public repository on GitHub.

// get started

Benchmark your engine
and let the data rank it.

Bring QuanTime up with one command, upload your matching engine, and watch live latency, throughput, correctness, and score, all on your own machine.