1
0 Comments

I Had to Rethink My Polymarket Trading Bot After the TWAP Upgrade

https://github.com/Benjam1nCup/Polymarket-trading-bot-python-V2

I've been building automated trading bots for Polymarket, and one of the most interesting parts of the process has been watching the market infrastructure change underneath the strategy.

One upgrade forced me to rethink a significant part of my bot architecture:

Polymarket's move to 60-second TWAP-based crypto settlement.

Before that, my approach was relatively simple.

I used fast external exchange feeds such as Coinbase and Binance to detect BTC movements before they were reflected on Polymarket.

In some situations, I observed Coinbase moving roughly 2–3 seconds ahead of Polymarket.

For a human trader, a few seconds may not seem important.

For an automated trading bot operating on short-duration markets, it can potentially be a meaningful signal.

That became one of the ideas behind my earlier bots.

Then the market structure changed.

You can view a real-time video of a currently active Polymarket momentum arbitrage bot at this link.

https://www.youtube.com/watch?v=0g81khaRjkE


The Old Approach

The basic idea was:

Coinbase / Binance
        ↓
   BTC movement
        ↓
Polymarket hasn't reacted
        ↓
    Trading signal

The bot was essentially looking for a timing difference.

If BTC moved quickly on an external exchange and Polymarket hadn't fully reacted yet, there could potentially be an opportunity.

It was simple to understand.

But it depended heavily on how Polymarket represented the underlying price.


Then TWAP Changed Everything

With the introduction of the 60-second TWAP mechanism, the strategy couldn't simply compare Coinbase's spot price against the Polymarket market anymore.

The settlement process became more time-dependent.

Conceptually:

External Exchange
       ↓
   Chainlink
       ↓
   60s TWAP
       ↓
Polymarket Outcome

This means a sudden BTC move on Coinbase doesn't necessarily mean the settlement-related price immediately jumps to the same level.

The new price information needs to become part of the TWAP.

That created a new question:

Can I use the fast Coinbase movement to anticipate how the TWAP will evolve?

That question became the foundation for my new approach.


Coinbase Didn't Become Useless

I didn't remove Coinbase from the system.

I changed its role.

Instead of treating Coinbase as the settlement price, I started treating it as an early signal.

During fast market movements, Coinbase can still react before the corresponding Chainlink/TWAP-related value fully reflects the movement.

In my observations, that difference can be around 2–3 seconds.

So now the architecture looks more like:

             Coinbase
                 ↓
          Early BTC Signal
                 ↓
          Momentum Engine
                 ↓
       ┌─────────┴─────────┐
       ↓                   ↓
 Chainlink / TWAP     Polymarket
       ↓              Order Book
       └─────────┬─────────┘
                 ↓
            Trade Decision

The important part is that Coinbase is not replacing the settlement mechanism.

It's providing information earlier.


From Arbitrage to Momentum

This also changed how I think about the strategy.

The old question was:

"Is Coinbase ahead of Polymarket?"

The new question is:

"If Coinbase is moving now, what could that movement mean for the TWAP and the Polymarket market?"

That's why I started thinking about it as a Momentum Arbitrage Bot.

The strategy combines several things:

  • Coinbase price movement
  • Chainlink/TWAP state
  • Polymarket pricing
  • order-book liquidity
  • distance from the strike
  • time remaining

The time component is especially important.

A $100 BTC move with 10 minutes remaining is not necessarily equivalent to the same move with 10 seconds remaining.

The bot needs to understand the state of the market, not just the BTC price.


What I Learned Building It

One of the biggest lessons for me has been:

A trading strategy isn't just code. It's a model of how the market actually works.

When the market mechanism changes, the strategy may need to change too.

It's tempting to optimize the old strategy:

faster WebSocket
better server
lower latency
faster execution

But sometimes the real problem isn't latency.

The underlying market structure has changed.

That's what happened with TWAP.

The interesting engineering problem became understanding the relationship between:

Fast external data
        +
Chainlink
        +
TWAP
        +
Polymarket
        +
Time

The Bot Architecture

The system I'm working toward is roughly:

Coinbase
   ↓
Price Feed
   ↓
Momentum Detection
   ↓
TWAP / Chainlink Analysis
   ↓
Polymarket Order Book
   ↓
Signal Engine
   ↓
Risk Engine
   ↓
Execution

Each component has a different responsibility.

Coinbase → fast market information

Momentum engine → detect short-term movement

TWAP analysis → understand settlement behavior

Polymarket → understand current market pricing and liquidity

Risk engine → decide whether the opportunity is worth taking

Execution → actually manage the order


What I'm Building Next

I'm turning this into a practical development series.

The next step is to start from the Coinbase feed itself and build the momentum engine.

I'll cover things like:

  • receiving BTC price updates
  • calculating short-term momentum
  • detecting sudden movements
  • comparing Coinbase movement with TWAP state
  • connecting the signal to Polymarket data
  • adding risk controls
  • and eventually connecting everything to execution

I'm deliberately starting with the data pipeline rather than jumping directly into trading logic.

Because in automated trading, bad data or incorrect assumptions can produce a very sophisticated bot that makes the wrong decisions extremely efficiently.


Open Source

I've also published a public repository with educational examples from my Polymarket trading-bot development:

Polymarket Trading Bot Python V2 — GitHub

The repository is mainly for learning and experimentation.

[Telegram — @BenjaminCup](https://t.me/BenjaminCup)

submitted this linkon September 14, 2026