Polymarket Bot
A Rust trading system for Polymarket’s BTC 5-minute Up/Down markets. It streams 1-minute OHLCV from Hyperliquid as the resolution proxy, gates entries on orderbook microstructure, and shares feature and model code between the lab harness and the live runner so research changes carry into execution unchanged. It currently runs in paper mode while fees, fills, tick semantics, and replay-price ambiguity are modeled more tightly.
- Role
- Solo Engineer · Research + Build
- Period
- 2026
- Status
- Production
How the system fits together.
The calls that shaped it.
- 01
Shared lab ↔ live code
Several online-ML strategies on one shared feature pipeline, with model state persisted per coin so experiments restart without losing learning history — research changes carry into execution unchanged.
- 02
A 9-crate Rust workspace
Core types/math, data feeds (Kraken + Hyperliquid), strategies (momentum-meanreversion, market-making, scalper, copy-trading, arb + MlSignalTrader), a ~37-strategy lab, an ML feature crate, paper+live execution, backtest, and an Axum dashboard API.
- 03
Diagnosed 4,403 live predictions
A deep analysis found the real failure modes — stale z-score normalization clipping signal, overfitting at 1.7–3.3 samples/feature, sigmoid saturation at 0.52–0.56 — with concrete fixes (rolling-window stats, L2 bump, Platt rescaling, fractional-Kelly) committed back as fix-target #1.
- 04
Grounded in token mechanics
Settlement math from actual share mechanics — a $25 ticket at 0.30 returns +$58.33 on win versus −$25 on loss — with entry gates requiring model conf ≥ 0.53, ask ≤ 0.55, and microstructure agreement before a dollar goes on the book.
- 05
Honest about the gaps
Settlement, share count, and gate evaluation are reproducible; fees, partial fills, tick effects, and replay pricing are documented as known gaps — so it stays in paper mode until they’re modeled tightly.
The interesting work isn't the stack. It's the boundaries.