A production-grade distributed system that automatically evaluates contestant-submitted trading exchanges β from secure sandboxing to real-time load testing to live scoring.
A contestant uploads their trading exchange code (C++, Rust, or Go). The platform:
- Sandboxes it in Docker with 6 security layers β no network, read-only filesystem, all capabilities dropped
- Attacks it with 500 concurrent goroutines sending 5,000 orders per second
- Measures every single order with nanosecond precision β p50, p90, p99 latency
- Scores it on a 100-point composite formula
- Streams live rankings to a React leaderboard via Server-Sent Events
[Contestant]
|
| POST /submit (C++/Rust/Go code)
v
[Submission API :8080]
|
v
[Sandbox Runner :8085] 6 Security Layers:
| Docker build + run -> NetworkMode: none
| -> ReadonlyRootfs: true
| -> CapDrop: ALL
| -> Seccomp whitelist
| -> PidsLimit: 100
| -> Non-root user
v
[Contestant Exchange :random]
^
| 5,000 orders/second
| 500 goroutines x 10 OPS
|
[Bot Coordinator :8081]
|
| BotResults (batched)
v
[Telemetry Ingester :8082]
| p50 / p90 / p99
| InfluxDB write
v
[Scoring Engine :8083]
| composite score
| Redis ZADD
| SSE broadcast
v
[React Leaderboard :3000]
live rankings, no refresh
- Docker Desktop (running)
- Go 1.22+
- Node.js 20+
docker run -d --name iicpc-redis -p 6379:6379 redis:7-alpine redis-server --appendonly yes
docker run -d --name iicpc-influxdb -p 8086:8086 \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_USERNAME=admin \
-e DOCKER_INFLUXDB_INIT_PASSWORD=adminpassword123 \
-e DOCKER_INFLUXDB_INIT_ORG=iicpc \
-e DOCKER_INFLUXDB_INIT_BUCKET=telemetry \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=iicpc-token-2026 \
influxdb:2.7# Terminal 1
cd services/scoring-engine && go run cmd/main.go
# Terminal 2
cd services/telemetry-ingester && go run cmd/main.go
# Terminal 3
cd services/bot-coordinator && go run cmd/main.go
# Terminal 4
cd services/submission-api && go run cmd/main.gocd frontend/leaderboard && npm start| Component | Weight | Metric | Perfect Score |
|---|---|---|---|
| β‘ Latency | 40% | p99 response time | < 1ms = 40 pts |
| π Throughput | 35% | Transactions/sec | > 10k TPS = 35 pts |
| β Correctness | 25% | Order success rate | > 99.9% = 25 pts |
At 5,000 orders/second, a p99 latency of 500ms means 50 orders every second take half a second. In live trading, those are missed opportunities worth real money. Average latency hides this problem. p99 exposes it.
p99 < 1ms -> 40 pts HFT-grade
p99 < 5ms -> 30-40 Excellent
p99 < 10ms -> 20-30 Good
p99 < 50ms -> 10-20 Acceptable
p99 >= 50ms -> 0 pts Too slow
Every contestant container runs with 6 independent security layers:
Layer 1: NetworkMode: none
-> zero network interfaces
-> cannot access internet, other containers, or our databases
Layer 2: ReadonlyRootfs: true
-> filesystem is read-only
-> only 10MB writable tmpfs at /tmp
Layer 3: CapDrop: ALL
-> all Linux capabilities dropped
-> no raw sockets, no process tracing, no kernel modules
Layer 4: Seccomp whitelist
-> ~200 safe syscalls allowed
-> ptrace, kexec_load, mount blocked
Layer 5: PidsLimit: 100
-> prevents fork bombs
Layer 6: USER contestant (UID 1000)
-> non-root execution
Defense in depth β if one layer fails, five remain.
500 goroutines x 10 OPS = 5,000 total orders/second
Order mix (realistic market simulation):
70% Limit Orders β providing liquidity
20% Market Orders β taking liquidity
10% Cancels β position management
Each bot:
- Independent goroutine (no shared state)
- Own PRNG (no lock contention)
- Persistent HTTP connection pool
- Nanosecond timestamps on every order
- Non-blocking result channel writes
# Upload contestant code
curl -X POST http://localhost:8080/submit \
-F "code=@exchange.cpp" \
-F "contestant_id=alice" \
-F "language=cpp"
# Track pipeline progress
curl http://localhost:8080/submission/abc123
# Health check
curl http://localhost:8080/health# Launch bot fleet manually
curl -X POST http://localhost:8081/start \
-H "Content-Type: application/json" \
-d '{
"submission_id": "abc123",
"target_url": "http://localhost:8000",
"bot_count": 500,
"orders_per_second": 10,
"duration_seconds": 60
}'
# Live fleet stats
curl http://localhost:8081/status# Get p50/p90/p99 metrics
curl http://localhost:8082/metrics/abc123# Score a submission
curl -X POST http://localhost:8083/score \
-H "Content-Type: application/json" \
-d '{
"submission_id": "abc123",
"contestant_id": "alice",
"p50_ms": 0.8,
"p90_ms": 1.5,
"p99_ms": 3.2,
"tps": 8500,
"success_rate": 0.97
}'
# View leaderboard
curl http://localhost:8083/leaderboard| Rank | Contestant | p99 | TPS | Score | Grade |
|---|---|---|---|---|---|
| 1 | alice_hft | 0.9ms | 15,000 | 100.0 | A+ |
| 2 | diana_sys | 2.9ms | 11,000 | 95.0 | A+ |
| 3 | bob_algo | 4.8ms | 7,500 | 83.8 | B |
| 4 | charlie_quant | 9.2ms | 3,200 | 63.5 | C |
| 5 | eve_dev | 45.0ms | 800 | 38.0 | F |
| Choice | Technology | Why |
|---|---|---|
| Language | Go 1.26 | Goroutines for 500 concurrent bots with ~5MB total memory |
| Sandbox | Docker CLI via exec | SDK v24 has distribution package conflicts; exec gives identical functionality with zero deps |
| Metrics DB | InfluxDB 2.7 | Purpose-built time-series, native percentile queries, nanosecond precision |
| Leaderboard | Redis Sorted Set | O(log N) auto-sorted ZADD β designed exactly for rankings |
| Live Updates | Server-Sent Events | Unidirectional stream, simpler than WebSocket, proxy-friendly |
| Deployment | Docker Compose | Reproducible one-command startup, zero extra tooling |
iicpc-platform/
βββ services/
β βββ submission-api/ # Upload + 5-stage pipeline orchestrator
β βββ sandbox-runner/ # Docker security layer
β βββ bot-coordinator/ # 500-goroutine load generator
β βββ telemetry-ingester/ # Latency measurement + InfluxDB
β βββ scoring-engine/ # Composite scoring + Redis + SSE
βββ frontend/
β βββ leaderboard/ # React 18 + TypeScript live dashboard
βββ infra/
β βββ docker/
β βββ docker-compose.yml # One-command deployment (IaC)
β βββ dockerfiles/ # C++/Rust/Go contestant templates
β βββ seccomp/default.json # Linux syscall whitelist
βββ test/
β βββ mock-exchange/ # Simulated exchange for testing
βββ docs/
βββ architecture.md # Full system design document
Built for IICPC Summer Hackathon 2026 Β· May 9 to June 10
Distributed Systems Β· High-Performance Computing Β· Financial Technology