Back to all work
— Project 11
Quant trading · ML research

Polymarket Bot

BTC 5-min Up/Down trading system

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
RustTokioPolymarket CLOBHyperliquid WSSGD logisticNext.js
— Chapter 01
System shape

How the system fits together.

Click any block to read about it
Fig. 01 — Polymarket Bot architecture
— Chapter 02
Decisions and outcomes

The calls that shaped it.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

— Aside
The interesting work isn't the stack. It's the boundaries.
— Chapter 03
How it runs

What it runs on.

Core
Rust · Tokiorust_decimalrusqlitetracing
Markets
Polymarket CLOBalloy · EIP-712Hyperliquid WS
Dashboard
AxumNext.js