DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

TWAP60 Is the Number Polymarket Pays

GitHub: https://github.com/abrownfox0/abrownfox001-twap60-prediction-trigger-system

YouTube walkthrough: https://www.youtube.com/watch?v=XzhugRL6BV4

Part 1 explained why the engine specializes in BTC 5-minute markets.

Part 2 is the settlement target. If this layer is wrong, the signal, the scratches, and the public win-rate sample are all solving the wrong problem.

Live profile: @abrownfox001

1. What Changed

Polymarket short crypto Up/Down markets no longer resolve on a single snapshot.

They settle on Chainlink TWAP.

Market Official window now
BTC 5-minute 60-second TWAP
15-minute crypto 60-second TWAP
4-hour crypto 60-second TWAP

5-minute markets first used a 30-second window. Markets deployed since August 14, 2026 use 60 seconds. That is why the repo is named twap60-prediction-trigger-system.

The README still mentions 30s in older module notes. Live 5m production should treat 60s as the official series.

60 seconds is a lookback, not an update frequency. Reports can arrive more often than once a minute. The value inside each report is the average over the prior 60 seconds.

2. The Question the Bot Must Answer

Wrong:

Where will Binance print at the close?

Right:

Where will the official 60-second average sit versus the slot-open reference?

A 4-second wick can flip a snapshot market and barely move a 60s average.

A grind that holds through the lookback can decide settlement even if the last tick snaps back.

If you train on CEX last prices, you are forecasting a variable Polymarket no longer pays.

3. The Only Clean State

For each btc-updown-5m-* slot:

twap_open = 60s Chainlink TWAP at slot start
twap_now  = latest 60s Chainlink TWAP
t_left    = seconds remaining
Enter fullscreen mode Exit fullscreen mode

Everything else is auxiliary.

Useful extras:

  • CEX mid for lead-lag (cexFeed.ts)
  • flow / book imbalance
  • realized path volatility inside the slot

Not substitutes:

  • last Binance print
  • Coinbase close guess
  • leftover 30s TWAP on new 5m markets

Both the price-to-beat and the final score must come from the same 60s family. Mix windows and you invent false wins.

4. Open Pinning Is Half the Battle

Up wins if the end-window TWAP clears the open reference.

That means:

  1. Pin twap_open from the official 60s series at slot start
  2. Score the live path from that same series
  3. Resolve labels from that same series (or gamma as authoritative fallback)

Do not pin open from Binance mid and then “upgrade” only the close to TWAP. That is a third market nobody settles.

5. What the Feed Must Do

In the public repo this lives in src/twapFeed.ts.

Production requirements:

  • subscribe to Polymarket RTDS 60s TWAP (or SDK windowSeconds: 60)
  • exact filter such as {"symbol":"btc/usd"}
  • keep latest value + observation timestamp in memory
  • reconnect with backoff
  • refuse stale data
  • use exact decimal / bigint math

If the TWAP is stale, skip the slot. Do not invent a substitute from spot.

6. Why the 30s → 60s Move Matters

  • The official series got smoother
  • Fast spike features lost power
  • Open-reference mismatch became a silent killer
  • Scratch thresholds needed retuning
  • Snapshot and leftover 30s logic became research-only

This is not a cosmetic docs change. It changes what “direction” means.

7. Failure Modes at This Layer

  • Pinning twap_open from the wrong feed
  • Scoring 60s live while labeling on 30s or CEX close
  • Treating socket heartbeat as proof of freshness
  • Comparing a snapshot open to a TWAP close
  • Assuming update cadence equals lookback length

If the target is wrong, no entry trick saves the book.

8. What Part 3 Covers

Once the official series is pinned, the next problem is converting that path into a calibrated P(up) — and keeping CEX lead-lag from hijacking the model.

Links

Not financial advice. Always verify the live market’s official resolution source.

If you have more questions, please feel free to contact me at any time: https://t.me/abrownfox001

My Polymarket Activity: https://polymarket.com/@abrownfox001?tab=activity

#Polymarket #TWAP #Chainlink #BTC #TradingBot #AlgoTrading #PredictionMarkets
Enter fullscreen mode Exit fullscreen mode

Top comments (0)