DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

Pin TWAP60 or Your 5m Bot Is Dating the Wrong Price

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

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

Live profile: https://polymarket.com/@abrownfox001

Part 1 mapped the platform changes.

Part 2 is the settlement layer those changes all sit on.

If a 5-minute crypto bot still aims at “Binance last at the bell,” the rest of the stack is irrelevant. Polymarket no longer pays that number.

1. The Rule That Is Live Now

Short crypto Up/Down markets resolve on Chainlink TWAP, not a snapshot.

Market Official window
5-minute crypto 60-second TWAP (30s → 60s on markets deployed since Aug 14)
15-minute crypto 60-second TWAP
4-hour crypto 60-second TWAP

Both the price-to-beat at slot open and the final settlement print should come from that same family.

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

2. Why This Was the First Tech Change That Mattered

Snapshot 5m books were a last-tick game. Research and trader complaints around those windows were the reason the venue moved.

TWAP does two things at once:

  1. Makes a one-second wick expensive
  2. Changes the state variable every serious bot must forecast

A 5m engine that only swapped a socket URL and kept CEX-close labels did not “upgrade to TWAP.” It kept the old problem and added a new feed.

3. The Only Clean Slot State

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

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

Useful extras:

  • CEX mid for lead-lag
  • flow / book
  • realized path vol

Not substitutes:

  • Binance last
  • Coinbase close guess
  • leftover 30s TWAP on new 5m markets
  • a homemade average of one exchange

If twap_open and twap_now are different families, the bot is trading a third market that does not exist.

4. What twapFeed.ts Has to Do in September 2026

The public repo’s feed module is the right shape. Production requirements are stricter than “socket connected.”

Minimum:

  • subscribe via Polymarket RTDS (public TWAP relay, no separate Chainlink creds required)
  • request the 60s series / windowSeconds: 60
  • exact filter such as {"symbol":"btc/usd"}
  • store value + observation timestamp
  • reconnect with backoff
  • ping / keepalive
  • refuse stale data
  • exact decimal / bigint math

RTDS going quiet is not “use spot until it comes back.”

It is “this slot has no official series.”

Gamma outcomePrices remains the scoring fallback after resolution. It is not a live path substitute.

5. The Silent Bug: Mixed Windows

This is the bug I still see in forks.

Open pin Live score / labels Result
Snapshot / CEX mid 60s TWAP Fake edge
30s TWAP 60s TWAP Contaminated research
60s TWAP CEX close Obsolete target
60s TWAP 60s TWAP The only coherent book

The 30s → 60s move on 5m markets made this worse, not better. Old notebooks still “work” while being wrong.

6. Expected Tech Change on This Layer

Not a rewrite of the whole bot. A hardening of the target:

  1. Confirm live market rules name the 60s stream
  2. Drop 30s as a production path for new 5m slots
  3. Log resolution_src on every completed market
  4. Shadow-compare official TWAP vs CEX last to measure disagreement
  5. Retune features that assumed a twitchier 30s series

The signal can stay private. The pin cannot.

7. How This Connects to abrownfox001

The live engine is still:

  • BTC 5m specialist
  • mid-band entries
  • scratch on decay
  • redeem the filtered book

That design only makes sense if the thing being forecast is the official TWAP path versus open.

That is why the repo is named twap60-prediction-trigger-system.

Part 3 leaves settlement and deals with the matching layer that changed in early September: taker delay 50ms → 150ms, plus volume-tier rate limits.

Links

Not financial advice. Always read 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)