PolyEdge
Browse documentation

Arbitrage Bot

The Arbitrage Bot works the current Polymarket BTC up/down market, accumulating hedged YES+NO inventory. It reads the live order book on Binance BTC/USDT to gauge short-term buy vs sell pressure (order-book imbalance, “OBI”) and uses that to time a cheap entry on each leg — buying Up (YES) while pressure is bullish and Down (NO) while bearish. One outcome resolves to $1, so every matched YES+NO pair pays out $1 and the edge is the spread between what the pair cost to assemble and that $1.

  • Binance order-book-imbalance (OBI) entry timing
  • Builds hedged YES+NO pairs that redeem at $1
  • Dynamic per-trade sizing (inventory, price, PnL feedback)
  • OBI-flip and profit-take rebalancing, held to resolution
  • Auto-rolls to each new BTC up/down window
  • Per-window spend cap

The strategy

In a binary market exactly one outcome resolves to $1, so a complete set — one YES and one NO — always pays $1. Assembling that set for less than $1 is locked-in profit. The trick is getting each leg cheaply. Each Binance depth update is reduced to a single OBI value from −100 (heavy selling) to +100 (heavy buying), weighted toward the top of the book; its rolling average gives a directional read:

avg OBI > up threshold ⇒ buy YES  ·  avg OBI < down threshold ⇒ buy NO

The bot leans into the favoured leg first, then buys the opposite leg to hedge when pressure reverses (or to bank a move once price has run past your profit delta) — accumulating matched pairs as the window plays out. Because it only ever buys, both legs are held to the window's resolution, where the winning side redeems at $1. Trading pauses when price leaves the configured band (the market is effectively decided), and sizing is dynamic so the two legs stay roughly balanced.

Settings

SettingDefaultWhat it does
baseOrderSize5Base shares per leg, before dynamic multipliers.
maxTotalExposureUsd250Halt new entries once this window's spend is reached.
obiTrendUpThreshold80Avg OBI above this times a YES (Up) leg.
obiTrendDownThreshold-80Avg OBI below this times a NO (Down) leg.
holdObiThreshold20Keep adding to a leg while OBI still favours it by this much.
obiWindowSize1Rolling window (samples) the OBI average is taken over.
profitDelta0.04Rebalance to the other leg once price moves this far past entry ($).
tradingRangeMin0.15Below this, treat the market as decided (no entries).
tradingRangeMax0.85Above this, treat the market as decided (no entries).
takerPriceSlack0.1Added over the ask so taker buys cross and fill ($).
intervalMinutes5BTC up/down window length in minutes.
pollIntervalSeconds5Heartbeat / status persistence cadence.
Shared market data
All users share one Binance OBI stream and one Polymarket order-book stream for the current window; per-user thresholds are applied on top. The bot auto-rolls to each new BTC up/down market and resets its per-window inventory.
Not instantaneous arbitrage
The two legs are bought at different moments, not simultaneously, so a leg carries directional risk until it is paired and the locked edge depends on the prices the OBI timing gets you — it is not a guaranteed risk-free set. Entries are taker orders (fill-and-kill) and cross the spread. Add a wallet key in Settings and start with small sizes.