Mach Five
An automated market maker for MLB moneylines on Polymarket US, plus the research pipeline that decides when it should quote.
- Timeline
- August 2026 – present
- Status
- active
- Stack
- Python, Polymarket US API, The Odds API, MLB Stats API, WebSockets, launchd
- Links
Every MLB game on Polymarket US is one binary market: home wins or away wins, with the two prices summing to $1. Mach Five treats Pinnacle’s de-vigged moneyline as fair value, rests a post-only buy order on each side a half-spread away from it, and captures the spread whenever both sides fill, regardless of who wins the game. A skew rule shifts and resizes both quotes after one side fills so inventory is driven back to flat.
The interesting part is the guard. Quotes only rest once both starting lineups are confirmed and Pinnacle has digested them, and they are pulled within seconds on one-sided trade bursts, fair-value divergence, data-feed silence, game delays, or the approach of first pitch. Recorded data showed that quoting into pending lineups loses about 1.6¢ per share to informed flow, while quoting after them earns the spread.
The repo is three programs:
- recorder – a 24/7 daemon that records Pinnacle fair value, order books, the live trade tape, and lineup-posting events into one JSONL file per game.
- replay – offline analysis of those recordings: market quality by time-to-pitch, a paper-trading sweep over quote-start strategies at both optimistic and pessimistic queue-position bounds, and fill markout tables that act as the adverse-selection detector.
- mach_five – the live quoting loop (quotes, skew, guard, order layer). It refuses to run without an explicit live flag because it places real orders with real dollars.
Supporting modules each own one concern: odds feed, devig, venue discovery, order placement, confirmed-lineup detection, guard decisions, and a paper book for simulated maker fills. Every module has a matching offline check script with canned payloads and injected transports, so the test suite never touches the network or places a real order.