A technical breakdown of how distinct-baguette trades Polymarket crypto UP/DOWN bucket markets. Three automated strategies running 24/7 across BTC, ETH, SOL, and XRP.
Polymarket's crypto UP/DOWN markets are binary contracts that resolve based on whether an asset's price is above or below a strike price at expiry. Each market has two tokens:
New markets open every 5 minutes, 15 minutes, and 1 hour across four assets. Because UP + DOWN must resolve to exactly $1.00, any pricing that sums to less creates a risk-free arbitrage opportunity. Any pricing that deviates from fair value creates a directional opportunity.
The momentum strategy exploits the latency between Binance spot prices and Polymarket contract pricing. When BTC moves sharply on Binance, Polymarket's UP/DOWN tokens take seconds to reprice. The bot detects the move via a real-time Binance aggTrade WebSocket feed and enters a Polymarket position before the market adjusts.
Signal detection uses a configurable lookback window and minimum delta threshold. When the price move exceeds the threshold, the bot fires an order on the corresponding UP or DOWN token.
Two-sided quoting on both UP and DOWN tokens. The bot posts resting limit orders on both sides of the spread and profits from the bid-ask gap. The key edge is Binance preemptive cancel: the bot monitors the real-time Binance price feed and cancels resting orders before an adverse price move results in a toxic fill.
When the Binance feed signals a sharp BTC move, the bot cancels its exposed side (e.g., cancels resting UP bids if BTC is about to dump) in sub-second, then re-quotes once the move settles. This dramatically reduces adverse selection — the #1 killer of market-making strategies.
The spread capture strategy exploits a fundamental constraint: UP + DOWN tokens must resolve to exactly $1.00. When the combined bid prices sum to less than $1.00 (e.g., UP bid at $0.48 + DOWN bid at $0.49 = $0.97), the bot buys both sides at the bid for a guaranteed $0.03 profit at resolution, regardless of which direction the asset moves.
This is a risk-neutral strategy — the bot profits at resolution no matter the outcome. Each instance monitors one asset/window combination, checking every tick whether the combined price falls below the spread threshold. Run multiple instances to cover all markets.
The bot is a single Rust binary that runs as a systemd service on a Linux VPS. Event-driven architecture — the evaluation loop wakes on each Binance aggTrade, not on a fixed timer.
Binance WebSocket (aggTrade)
│
├─→ Signal Engine (lookback, delta threshold)
│ │
│ ├─→ Momentum Strategy ──→ Polymarket CLOB
│ ├─→ Market Making ──────→ Polymarket CLOB
│ └─→ Spread Capture ─────→ Polymarket CLOB
│
└─→ Preemptive Cancel (adverse move detection)
└─→ Cancel resting orders before toxic filldry_run: true to simulate every trade without placing real orders. All configs ship with dry-run enabled by default — flip one flag to go live.Technical details behind each component. Click to expand.