Research note
N / 261123

Why I Wouldn't Build a Polymarket Trading Bot from Scratch

A year of research and engineering showed why reliable Polymarket automation depends on data, decisions, execution, recovery, and latency—not strategy alone.

Have you ever spotted an opportunity but failed to get filled?

If you have traded short-duration markets on Polymarket, you may know the feeling.

You spot a price that looks attractive and decide to place an order. By the time you finish evaluating the market, constructing and signing the order, and submitting it, the price has moved. Worse, someone else may already have been filled. You are left chasing the price—or unable to get in at all.

This is not simply a matter of being “a little too slow.”

When many participants watch the same market and compete for similar opportunities, there is an entire chain between observing a market event and getting an order into the trading system. Data arrival, processing, strategy decisions, order construction, signing, and submission all matter.

So if you are thinking about building your own Polymarket trading bot, I want to start with one piece of advice: do not underestimate how difficult it is.

We started out just wanting to research strategies

We did not initially set out to build a sophisticated trading infrastructure. We simply wanted to research strategies for Polymarket BTC 5-minute Up/Down markets.

Our first approach was straightforward: use Binance market data as a reference and poll REST endpoints periodically—sometimes every five seconds, sometimes every fifteen seconds. That was enough to understand the market and test some early ideas.

But as the research became more serious, one thing became clear: the strategy is only one part of a trading bot, and it may not even be the hardest part.

Once you start thinking about real trading, the questions multiply. Is the market data fresh enough? Has a subscription silently disconnected? Can the system recover after a disconnect? Is the local order-book state correct? Are events being lost or processed twice? Does the strategy run in time? Are risk checks completed before an order is sent? Can the system reliably sign, submit, process responses, and recover from errors?

Writing the strategy does not make these problems disappear.

Building a bot means much more than writing a strategy

A trading bot intended to run reliably over time has to deal with several layers:

  • Real-time data ingestion: Connect to market and order-book feeds, maintain subscriptions, and handle disconnects, reconnections, and data recovery.
  • Parsing and state management: Turn incoming events into usable state while handling out-of-order, duplicated, missing, or inconsistent updates.
  • Scheduling and strategy computation: Trigger decisions at the right time while managing task scheduling and resource contention.
  • Risk controls: Check balances, positions, order status, duplicate actions, and trading constraints.
  • Order execution: Construct and sign orders, generate authentication data, submit requests, and handle fills, partial fills, rejections, and timeouts.
  • Long-running reliability: Persist state, monitor failures, handle process restarts, and avoid placing duplicate orders after recovery.

None of these pieces is particularly mysterious on its own. The difficult part is making them work together as one reliable chain.

Building a program that “runs” is one thing. Building a system that continues to behave correctly through fast markets, network jitter, service failures, and long periods of operation is another.

Outsourcing does not automatically solve the real problem

Outsourcing can certainly save time, but there is an important distinction that is easy to overlook: the feature you ask someone to build may not be the same as the standard a real trading system needs to meet.

If the requirement is simply “listen for a price and place an order when a condition is met,” a developer may be able to deliver a working demo quickly. But does it react in time when the market moves rapidly? What are its P95 and P99 latencies? How does it recover from a disconnect? Can duplicate events trigger duplicate orders? How does it confirm the actual order state after a timeout?

If these questions are not specified up front—and measured during acceptance testing—the final deliverable may be little more than a functional prototype.

This does not mean outsourced developers are incapable. The incentives and expectations may simply be different: one side delivers the agreed feature, while the other expects infrastructure that can support real trading.

“The feature works” does not mean “the trading system is production-ready.”

If you do outsource the work, put data freshness, end-to-end latency, P95/P99 targets, reconnect recovery, error handling, idempotency, logging, and monitoring into the requirements and acceptance criteria. Do not make “can it place an order?” the only test.

Copy-trading bots face the same problem: another wallet’s profit is not yours

Another common idea is to find a wallet with a good track record and simply copy its trades.

The problem is that what you copy is usually the trading direction—not the other trader’s execution price.

Imagine a wallet buys at 0.45. After the trade notification is emitted, your system still has to receive the signal, parse the wallet activity, identify the corresponding market, read the order book, decide whether to copy, calculate the size, construct and sign an order, and finally submit it.

By the time that process is complete, the price may already be 0.50. You may have called the direction correctly and still entered at a very different price.

Copy trading is also affected by order-book depth, liquidity, order size, partial fills, queue priority, and exit timing. The leading wallet getting filled does not mean your order will fill at the same price. And even if the original trader eventually makes a profit, the follower is not guaranteed the same result.

A copy-trading bot is therefore not just “watch an address and duplicate its orders.” It still needs a reliable data, decision, and execution system.

It took us a year to work through these problems

As our research progressed, our attention shifted from strategy logic alone to the entire trading pipeline.

We moved progressively from periodic REST polling to real-time subscriptions, and revisited event processing, order-book state management, scheduling, order construction, and execution. The process involved extensive iteration and repeated restructuring.

One important decision was to move the core hot path into a native Rust execution layer. The goal was not to chase a language label. It was to reduce cross-language scheduling, state movement, and unnecessary jitter in the critical path. Python can still handle orchestration, configuration, and work outside the hot path. The parts where timing matters most are kept in a more direct execution path.

We also did not want to simply claim that the system was fast. We measured the critical local path.

Local hot-path measurements

The following measurements were taken on a Windows machine using the current source with a Rust Release build. A real-time Binance dual @trade subscription served as the trigger. The measured chain included strategy computation, action reservation, order signing, and a POST request sent to a local mock CLOB receiver.

Segment P50 P95 P99
Rust receives a unique @trade event → Python decision thread gets the event 0.274 ms 0.750 ms 0.831 ms
Full strategy computation 0.064 ms 0.102 ms 0.112 ms
Runtime checks and action-identity computation 0.013 ms 0.019 ms 0.021 ms
In-memory action reservation + enqueue to the SQLite background queue 0.010 ms 0.013 ms 0.014 ms
Rust order construction 0.001 ms 0.001 ms 0.002 ms
Rust order signing 0.065 ms 0.083 ms 0.091 ms
Request serialization and L2 authentication headers 0.007 ms 0.011 ms 0.020 ms
Decision thread gets the event → POST begins 0.177 ms 0.248 ms 0.267 ms

When the main steps were chained together, the local end-to-end hot path produced the following results across 74 real Binance event samples:

Full local chain P50 P95 P99 Maximum
Rust receives event → begins sending POST 0.544 ms 1.032 ms 1.618 ms 1.636 ms

There is an important limitation: these are not end-to-end live Polymarket order latencies. The POST request was sent to a local mock receiver. The test did not measure network transmission from a production server to Polymarket’s CLOB, CLOB receipt and processing, order-fill responses, or taker delay in a live trade.

There is another measurement detail worth noting. The Rust receive timestamp in the combined test had only 1 ms precision, so the tail measurements include roughly 1 ms of timestamp quantization error. More precise segment measurements put the P99 of pure code computation at around 0.27 ms. The current local hot path is approximately 0.5 ms at P50, 1.0 ms at P95, and around 1–1.6 ms at P99.

The point of these numbers is not to claim that “being fast guarantees profit.” It is to understand where time is actually spent inside the system. In our local measurements, most of the variation comes from event wake-up and thread scheduling rather than strategy computation itself. In live trading, the network route from the server to the CLOB, CLOB response time, and taker delay remain separate factors that must be measured.

Speed does not guarantee a fill, either. Order-book depth, liquidity, price movement, queue priority, and venue rules all affect whether you get filled—and at what price.

We eventually began turning that work into infrastructure

Over the past year, we gradually built infrastructure for Polymarket automated trading. Strategies will change, and markets will change, but the underlying capabilities—real-time data, state management, scheduling, risk controls, and execution—remain necessary regardless of which strategy is running.

That is the direction Polynexus has continued to develop.

PairFlow is one strategy package within the Polynexus ecosystem; it is not the underlying platform itself. With the infrastructure already in place, we can also build and customize systems around different strategy requirements. Researchers do not have to start from scratch every time with market-data ingestion, event processing, order signing, and failure recovery.

We do not believe everyone should avoid writing their own code. If your goal is learning, testing an idea, or building a small experiment, developing it yourself can be extremely valuable. The thing to be careful about is mistaking a strategy prototype for a complete system capable of supporting real trading.

A final thought

If you are considering building a Polymarket trading bot, my advice is to first decide what you are actually trying to solve.

If strategy research is what interests you most, spend your time studying the market, analyzing data, and validating ideas. If you expect the system to participate in live trading reliably over time, do not underestimate the work required underneath it.

It took us a year to gradually understand this path and turn many of the infrastructure lessons into the Polynexus architecture.

I hope others can avoid some of the detours we had to take.

Strategies are worth researching. Rebuilding the infrastructure from scratch may not be worth your time.

After all, the market does not wait.

When everyone is competing for the same opportunity, how quickly you can see it, calculate, and submit an order may matter more than you think.


This article discusses trading-system research and engineering. It is not financial advice. Speed, replay results, and software functionality do not guarantee future returns or live fills.

Further reading: From Signal to Automated Execution · A Trading Bot Is More Than a Signal Strategy · Order-Book Jumps, TWAP, and Execution

Project code and public documentation: PolyNexus on GitHub