Posts

Polymarket Trading Bot Architecture: From Market Data to Order Execution

A Polymarket trading bot can start as a simple strategy connected to an API. For a prototype, that may be enough. But reliable automated trading requires much more than placing an order. The backend needs to handle: Market data Orderbook state Strategy Risk and position Execution Order management Reconciliation Monitoring At that point, the strategy is only one part of the system. You're building a trading system backend. The Architecture The system I'm building can be understood as nine main layers. 1. Market Data WebSocket / API ↓ Market Data Worker 2. Market State Market Data Worker ↓ Market / Orderbook State 3. Event Processing Market / Orderbook State ↓ Queue / Redis 4. Decision Making Queue / Redis ↓ Strategy Worker 5. Execution Strategy Worker ↓ Execution Intent ↓ Execution Worker 6. Order Management Execution Worker ↓ Order Management ↓ External Market 7. Reconciliation External Market ↓ Orders / Fills ↓ Reconciliation Worker 8. Persistence Reconciliation Worker ↓ Inter...

Polymarket Trading Bot Dominance: 14 of Top 20 Wallets Are Automated

A review of Polymarket's public leaderboard turned up a number worth sitting with: 14 of the 20 most profitable wallets on the platform are bots. Not assisted by bots. Not partially automated. Fully bot-run. If you're trading manually on Polymarket right now, you're competing against a leaderboard that's already three-quarters automated. This isn't a fringe statistic - it's the clearest evidence yet that Polymarket has quietly become a bot-dominated market, and the mechanics behind why are worth understanding whether you're building a Polymarket trading bot yourself or just trying to figure out if manual trading still makes sense. Where the edge is actually coming from The instinct is to assume these bots are winning because they're better at predicting outcomes. That's mostly not what's happening. Research on Polymarket arbitrage estimates that traders extracted roughly $40 million from the platform between April 2024 and April 2025 by exploi...

Why Every Polymarket Trading Bot Needs to Adapt to TWAP

When building a Polymarket trading bot, it's easy to focus on prediction models, latency, and order execution. However, platform infrastructure changes can have an even greater impact on a trading system than a new strategy. With Polymarket introducing TWAP (Time-Weighted Average Price) settlement for crypto Up/Down markets, I spent the last few days reviewing how my bot behaves near market resolution. Supporting TWAP wasn't simply replacing one price calculation-it required rethinking assumptions around settlement, execution timing, and trade evaluation. This update reminded me that trading bots aren't static software. They're living systems that must evolve alongside the markets they interact with. Over the coming weeks, I'll share a detailed technical breakdown covering the architecture changes, implementation decisions, and lessons learned while updating my Polymarket trading bot for the new TWAP model.

A Trend-Alignment Signal for Polymarket's BTC Up/Down Markets

Polymarket is a prediction market platform where every trade is public - you can see exactly what any wallet bought, at what price, and when. Some of these markets ask a simple question: will Bitcoin be higher or lower five minutes from now? Most bots trading these markets look at one signal at a time - momentum on a short timeframe, or comparing the market price to a live Bitcoin price feed. Traders in other markets, like leveraged futures, often do something different: they check whether multiple timeframes agree before trusting a move. A longer timeframe tells you the overall trend, a medium one confirms the current move still has room, and a short one times the entry. I wanted to see if that same idea - checking several timeframes before acting - could work for Polymarket's short Bitcoin markets. It mostly does, but only once you strip out the parts built for a different kind of trading. Why the full version doesn't transfer The original version of this idea comes fro...

Polymarket Trading Bot Strategies: Bayesian Edge

A prediction-market price is not a price. It's a probability the crowd agreed on a moment ago. The second real news arrives, that number is wrong - not forever, just for the few minutes it takes everyone else to finish the same math a Polymarket trading bot can run in milliseconds. When a market says an outcome trades at 38 cents, it's telling you the crowd's probability for that outcome is about 38%. On Polymarket, the price and the probability are the same object. Every price on the order book is a snapshot of a belief - and unlike a stock chart, the correct way to update that belief when new information arrives isn't a matter of opinion. It's a matter of math. That math is Bayes' theorem, written down in 1763: P(H|E) = P(E|H) × P(H) / P(E) Your prior P(H) is the current market price. The likelihood P(E|H) is how likely the news would be if the outcome were actually going to happen. P(E) is how likely the news was in general. The posterior P(H|E) is the up...

I Reverse-Engineered a Trader's Strategy From Public Polymarket Data

Polymarket is a prediction market platform where every trade is public - you can see exactly what any wallet bought, at what price, and when. I built a tool that takes that public history and works out what strategy a trader is actually using, then turns it into rules a bot can run on its own. Here's how it works, and the one finding that made this actually interesting instead of just a data-collection exercise. The pipeline collect → enrich → signals → analyse → report Collect pulls full trade history for a wallet from Polymarket's Data API (handles 100k+ fills via cursor pagination), plus market metadata for everything they traded. Enrich joins external context onto every single trade at the moment it happened: Binance and Coinbase OHLCV, the Chainlink ETH/USD oracle price on Polygon, order book spread and imbalance from the Polymarket CLOB, and how close the trade was to market close (I bucket this into early, mid, late, urgent phases). Signals computes candidate featur...

The Real Bottleneck in Polymarket Arbitrage Isn't Finding the Edge - It's Keeping It

Originally published on Substack: casatrick.substack.com/p/polymarket-arbitrage-bot-execution-speed Ask someone to explain a Polymarket arbitrage bot and they will describe the detection logic. YES and NO prices should sum to one dollar, and when they do not, buying both sides and redeeming the pair locks in the gap as profit. That explanation is correct, and on its own it is almost useless, because detecting the mispricing was never the hard problem. Every arbitrage bot watching Polymarket's public order books sees the same gap at roughly the same moment. The real problem is what happens in the few seconds after that. A pricing inefficiency on Polymarket does not sit still waiting to be captured. The moment it appears, every bot polling that market can see it, and the first execution to actually hit the order book starts consuming the exact liquidity the gap depended on. Miss the window and you are no longer capturing arbitrage, you are providing exit liquidity for whoever got ...