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
Parts 2 and 3 covered settlement and order access.
Part 4 is the layer that makes a live bot look broken even when the signal is fine: data shape, inventory, and platform product changes sitting around the 5-minute loop.
1. The CLOB Is Not Your Source of Truth for Everything
A 5m engine still needs four records that can disagree:
| Record | Where it lives | Failure mode |
|---|---|---|
| In-flight order | your process | double-send / lost scratch |
| CLOB ack / user channel | matching engine | tradeID vs hash confusion |
| Position / PnL | Data API + indexer | resolved market still shows open |
| Market metadata | Gamma | wrong slot, stale tick size |
August–September work on Data API and Gamma was mostly this problem:
- faster native serving for positions and PnL
-
/v1/approvalsadded - resolved markets incorrectly showing open
- PnL price bugs
- price-history moved onto a new serving layer after slowdowns
- clearer Gamma 503s and degraded search
- Bridge API pagination
If your dashboard uses cached Gamma plus an old trade poller, you will “debug the strategy” for a data bug.
2. What I Log So Ops Bugs Don’t Look Like Alpha Decay
Every slot should write:
market_id
window_seconds # 60 for current 5m
twap_open
twap_now
twap_ts
p_up
fill_px
client_order_id
trade_id
resolution_src # rtds_twap | gamma
position_qty
data_api_qty
When position_qty != data_api_qty, stop trading that slot.
Do not retune P(up) because the indexer lagged.
Public verification endpoints I use for the account itself:
curl "https://gamma-api.polymarket.com/public-profile?address=0x12b712029efeee7efc4066e98e4e1b6beb8b1b0b"
curl "https://data-api.polymarket.com/trades?user=0x12b712029efeee7efc4066e98e4e1b6beb8b1b0b&limit=1000"
3. Combos Changed Capital, Not the 5m Thesis
Combos are a separate product surface:
- multi-leg positions
- Collateral Return live for combo market makers
- combo status fields showing up in unified SDK models
- public profiles / portfolio now expose combo positions
That matters if you share collateral across products.
It does not mean a BTC 5m TWAP bot should start buying geopolitics bundles.
Expected tech side for specialists:
- isolate 5m crypto capital
- do not let combo inventory freeze funds the 5m loop thinks are free
- read protocol / combo status fields instead of assuming every market is a plain binary
If you never trade Combos, still parse the new status fields so a market object does not crash the discovery loop.
4. Tick Size, Discovery, and Automated Listings
Tick size is per market and can change while live. Read it. Do not hardcode 0.01.
Gamma discovery for btc-updown-5m-* still sits in src/markets.ts.
Automated market deployment has already caused temporary price-history and book weirdness this summer. Treat discovery as:
- find active BTC 5m slot
- read resolution source
- read tick size
- confirm TWAP window
- only then arm the engine
A newly deployed 5m market that still looks like the July 30s announcement is a rules bug, not a signal.
5. Infra You Should Expect to Keep Moving
These are not strategy ideas. They still hit a live bot:
- async matching / commit pipeline
- indexer rollout and PnL accuracy
- 503 shedding with
Retry-After - Beacon deposit wallets for some account types
- passkeys for Magic login users
- unified DeFi API gateway gathering balances, open orders, notifications, builder keys
Expected next breakage is rarely “TWAP disappeared.”
It is “the field I parsed moved, or the endpoint started paginating.”
Pin SDK versions. Keep adapters thin.
6. What Not to Mix Into a 5m CLOB Bot
Perps has its own September rules: concurrent websocket posts, HTTP overload shedding, OI reward threshold changes.
That stack is useful context and a terrible copy-paste source.
Keep:
crypto 5m adapter
combo adapter # only if you trade it
perps adapter # isolated
shared risk logger
One process can host them. One set of constants cannot.
7. Ops Checklist
- [ ] Positions reconciled every slot, not once a day
- [ ] Data API ≠ CLOB mismatch trips a halt
- [ ] Tick size read live
- [ ] Combo / protocol fields parsed safely
- [ ] Price-history never used as settlement
- [ ] Gamma 503s backed off
- [ ] 5m capital ring-fenced from combo/perps
- [ ] Changelog watched separately from strategy notes
8. What Part 5 Covers
The last post maps this whole stack onto the live abrownfox001 engine:
- what I already changed for TWAP60
- what I expect to change next in
twapFeed.ts,clob.ts, and ops logs - what stays private
- what I will not build just because the platform shipped it
Links
- Repo: https://github.com/abrownfox0/abrownfox001-twap60-prediction-trigger-system
- Video: https://www.youtube.com/watch?v=XzhugRL6BV4
- Live activity: https://polymarket.com/@abrownfox001?tab=activity
Not financial advice. Data bugs can mimic strategy decay. Log both.
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 #TradingBot #DataAPI #BTC #AlgoTrading #TWAP #PredictionMarkets
Top comments (0)