React to the book
A WebSocket book update triggered “hot eval” instead of waiting for another polling cycle. The per-market re-evaluation gate moved from 50 ms to 5 ms; that was a code setting, not measured end-to-end latency.
An automated Python bot I built for Polymarket’s five-minute crypto markets.
It captured the market’s opening reference, followed live BTC prices and both outcome order books, and looked for a brief disagreement between direction and price.
The hard part was not choosing Up or Down. It was deciding whether the mismatch was real, whether enough shares were available and whether an order could reach the book before the quote changed.
Python · WebSockets · Chainlink RTDS · Binance · Polymarket CLOB · AWS Lightsail
The branches overlapped, testing different entry prices, timing windows and execution paths.
The first version waited until expiry was close and bought the side that looked likely to win. Those contracts were expensive, so correct direction often left little upside. Its early oracle source also updated roughly every 27 seconds, which was too coarse for a five-minute market.
I switched to mid-priced contracts between $0.40 and $0.72 with 11–15 seconds remaining. The goal was more upside per winning trade, but earlier and cheaper entries also had more time to reverse.
This branch widened the entry window and required a larger gap between BTC and the market’s opening reference. Live order-book messages could trigger the decision immediately. I also moved the runner to an AWS Lightsail VPS in Dublin and kept the execution path warm.
“Ultra-cheap” explored contracts priced from $0.01 to $0.20, first with maker orders below the ask and later with a taker leg. A small group of cheap BTC winners drove the run-up, but later cheap-entry results did not repeat it.
The work focused on removing avoidable waits before an order reached the CLOB API.
A WebSocket book update triggered “hot eval” instead of waiting for another polling cycle. The per-market re-evaluation gate moved from 50 ms to 5 ms; that was a code setting, not measured end-to-end latency.
I moved execution to an AWS Lightsail VPS in Dublin to reduce the expected network path to the venue. I did not run a controlled comparison between regions, so the location alone cannot be credited with the result.
I added HTTP/2 and coincurve signing, preloaded token metadata and cached it. When metadata was missing, independent requests ran in parallel instead of one after another. This reduced repeated work; the archived timings below measure the whole preparation and response window.
The archived timer began at metadata preparation and stopped when the API answered. It measured order preparation plus the POST response—not the earlier signal, a confirmed fill or settlement.
Median preparation plus API response across 52 complete records. The p95 was 298.0 ms.
Median preparation plus API response across 22 complete records. The p95 was 289.2 ms.
These figures come from complete May 3 records. Of the responses, 51 of 52 StratB orders and all 22 UC orders were resting rather than immediately matched. A quick API acknowledgement is not a fill and does not demonstrate a profitable strategy.
The balance rose sharply, then the strategy failed to hold up.
$19.98 → $210.22Initial trading collateral → observed liquid peak
−$13.70Lifetime settled trading cash P&L
The observed liquid balance rose from $19.98 to $210.22, mainly on a small group of low-priced BTC winners. That did not establish a repeatable edge: the complete settled cash record ended at −$13.70.
Two changes then overlapped. Polymarket moved to CLOB V2 on April 28, while the bot’s May 2 patches removed paper-state entry and capital guards and replaced the simulator with a no-op. The bot traded more, and the next 17 markets entered below $0.10 all lost. The timing shows deterioration, but it cannot isolate one change as the cause.
The interactive chart is a reconstruction using the project’s original $18 starting assumption. It is useful for following the sequence of markets, but it is not the observed wallet-cash series shown above.
Loading the ledger…
| # | Asset | Window | Entry | Cost | Payout | PnL | Result |
|---|