poly5m-v4 — Split-window momentum BTC scalper

Buy-both-sides Gabagool on 5-min BTC. Picks up cheap YES + NO at $0.49 or less, locks profit when pair stays below $0.98. CLOB v2 / pUSD, polls books every 2s from 10s to 260s.

Version v1.3.0 · One-time payment · Source code download
Strategy typeScalping
AssetBTC
Timeframe5m
Market typeCrypto binary
Minimum capital$30
Dependencies@polymarket/clob-client, ws, ethers

What it does

poly5m-v4 (a.k.a. "Gabagool") makes no directional prediction. It accumulates YES shares when YES is cheap and NO shares when NO is cheap. When the average pair-cost falls below $0.98, the position is locked-in profitable regardless of which side wins.

Profit formula:

pnl = min(qty_YES, qty_NO) × $1.00 − (cost_YES + cost_NO)

The edge

In any 5-minute candle, BTC oscillates fast. When BTC rallies briefly, Up gets expensive and Down gets cheap. When BTC sells off, the reverse. A patient buy-both-sides strategy lifts whichever side just got discounted. With a $0.98 pair-cost cap, the bot collects $0.02+ of locked-in margin per matched share at resolution.

This is the same idea as poly15m-v4, just running on faster 5-minute candles with tighter pair-cost tolerance (5-min books are thinner so the achievable margin is smaller).

How it works

  1. Identify the active 5-minute BTC candle (Up + Down token IDs from Gamma API)
  2. Poll orderbooks every 2 seconds (POLL_INTERVAL_MS = 2000) starting 10s after open
  3. Buy condition: best ask on either side ≤ MAX_BUY_PRICE ($0.49) AND ask size ≥ MIN_ASK_SIZE (5)
  4. Pair-cost check: only buy if avg_YES + avg_NO would stay below PAIR_COST_TARGET ($0.98). Hard limit PAIR_COST_HARD_LIMIT ($0.995)
  5. Size: 20% of balance per side, hard cap MAX_BET_PER_SIDE ($15)
  6. Cooldown: 3 seconds between buys on the same side (BUY_COOLDOWN_MS)
  7. Stop buying 40 seconds before resolution (ENTRY_END_SEC = 260)
  8. Hold to resolution verified via Gamma API on Chainlink RTDS
  9. CLOB v2 / pUSD: trades against the V2 collateral (not USDC.e)

Trades all hours (SKIP_HOURS_UTC empty).

Sample output

[25/05/2026, 14:30:32] Polymarket WS connected [25/05/2026, 14:31:01] BUY (FOK) 15sh Up @ $0.47 ($7.07 incl fee) [25/05/2026, 14:32:18] BUY (FOK) 15sh Down @ $0.48 ($7.21 incl fee) [25/05/2026, 14:32:18] Pair locked: avg $0.470 + $0.480 = $0.950 (5¢ margin) [25/05/2026, 14:35:01] Resolved Down WIN | +$15.00 - $14.28 = +$0.72 | Bal: $30.72

Design targets

Locked-in margin per matched share: at $0.98 pair cost, $0.02 profit per share. With 15 matched shares per locked pair = $0.30 gross, minus fees on both buys leaves $0.10-$0.20 net per cycle. The strategy banks on volume: ~10-20% of 5-min candles produce a complete locked pair, giving roughly $5-$15 of daily profit per $30 of capital.

Worst case is one-sided fill. The unmatched side resolves to $1.00 or $0.00 with roughly 50/50 odds at $0.47 entry, giving $0.06 expected per share even when no pair locks. So even partial fills carry positive expectation.

FAQ

Why CLOB v2 / pUSD?

After the V2 migration, the 5-minute BTC markets resolve in pUSD. v4 uses @polymarket/clob-client-v2 so collateral, balance queries, and order placement all use the new asset. Pair with redeem-convert-auto to wrap any USDC.e payouts from older markets.

How is this different from poly15m-v4?

Same Gabagool idea on faster candles. 5-min has tighter pair-cost tolerance ($0.98 vs $0.95) because 5-min books offer less margin. Both can run on the same wallet.

What's included

  • poly5m/poly5m-v4.js
  • poly5m/bot-monitor.js (Telegram alerts)
  • poly5m/scripts/v4-run.sh (auto-restart wrapper)
  • polymarket-limits.js
  • README with pair-cost tuning and one-sided-position handling notes

Configuration

FlagDefaultDescription
--asset BTCBTCAsset to trade (BTC supported at launch).
--livePlace real orders. Default is dry-run.
--sim-balance 3030Starting balance in dry-run mode (USD).