Skip to content
All work

Trading systems · 2026

Private

Polyedge

An autonomous market maker that is built to prove itself wrong.

  • 1,423real market windows replayed for one verdict
  • 93%reward-estimate accuracy after the accounting rewrite
  • 30k+lines of TypeScript

Overview

A market-making and prediction engine for Polymarket, running as a singleton booted inside the Next.js server process and controlled through its own dashboard. Every bot defaults to paper mode. The interesting part is not the trading logic — it is the measurement apparatus built around it, which has killed more of my own strategies than it has kept.

The hard part

Making a simulation admit it is lying

Paper trading flatters you. My paper runs said one strategy earned +$12 a window; the same window traded live lost $16.44. Closing that gap became the actual project. Journals now record the order book at the moment of every decision, so a fill can be audited after the fact instead of assumed. Estimates are scored only against what actually rested on the book, and every number carries a provenance label — measured-live, measured-paper, derived, or modelled — because pooling those four is how you fool yourself. After an accounting rewrite the reward estimator went from capturing 14–21% of what the exchange actually paid to 93%.

What it does

  • Paper-first engine: every bot ships with dryRun defaulted on, and live mode is gated behind an accounting reconciliation that must balance against the exchange
  • Circuit breakers on position drift, cancel refusals, loss streaks and single-trade anomalies
  • Relayed on-chain auto-redemption of resolved positions, after finding and working around an SDK bug that hid closed markets
  • Tape-replay harness that re-runs a strategy against thousands of real recorded market windows
  • A written accuracy protocol, added after four avoidable analysis failures, that the system and I both follow

What it proves

  • Building the instrument before trusting the reading
  • Reconciling a live financial system against an external source of truth
  • Killing my own work when the evidence says to
  • Long-running process design, on-chain integration, and failure containment

Stack

  • TypeScript
  • Next.js 16
  • Polymarket CLOB
  • ethers
  • viem
  • WebSockets
  • PM2
  • Linux VPS

Related