Terminal App · Polymarket BTC Trading Bot
A terminal-based trading application for Polymarket's BTC Up/Down markets. It connects live Chainlink BTC pricing, Gamma market metadata, and the Polymarket CLOB to place, track, settle, and close short-horizon UP/DOWN positions across 5-minute, 15-minute, and 4-hour windows — with simulation mode, real-time PnL, technical indicators, and configurable automatic trading strategies.

Polymarket BTC Trading Bot is a production-oriented trading console built for Polymarket's recurring BTC price-direction markets. Each market resolves on whether Bitcoin closes above or below a Price to Beat (PTB) at the end of a fixed time window. The bot continuously discovers the active and upcoming windows, streams live BTC from Chainlink RTDS, fetches official market data from Gamma, and routes orders through the Polymarket CLOB (Central Limit Order Book) API.
The application is designed for operators who want full situational awareness without leaving the terminal. A Textual TUI presents live BTC price, PTB, delta, UP/DOWN buy prices, wallet balance, session PnL, outcome history, EMA/RSI context, and bias alerts — while exposing one-click controls for direction, stake size, arming, auto-betting, immediate entry, next-window entry, and bulk position closure.
Trading can run in SIMULATION mode (paper fills, no capital at risk) or LIVE mode (real USDC market orders). Every bet is tracked from placement through settlement or early exit. Beyond manual control, an automatic trading strategy layer evaluates market structure, indicators, recent outcome bias, and risk parameters to select and execute an appropriate strategy profile each cycle — enabling hands-off operation when AUTO BET is armed.
Multi-source feeds and official market metadata for accurate window discovery and pricing.
Trade BTC Up/Down on 5m, 15m, and 4h windows with runtime interval switching.
Automatic slug resolution, token ID mapping (yes = UP, no = DOWN), and outcome price display.
WebSocket RTDS stream for real-time price and PTB capture near window open.
Gamma official PTB → Chainlink REST → RTDS WebSocket fallback.
Batch and per-token buy/sell pricing; order book fallback for best ask/bid.
EMA (9, 21, 50, 200, 250) and RSI (14, 21) aligned to the active market timeframe.
From paper trading to signed live market orders on the Polymarket CLOB.
FAK (fill available) or FOK (all-or-nothing) order types.
Full order flow without sending live transactions; separate PnL ledger.
Signed market orders with fill resolution, balance diagnostics, and error persistence.
Immediate entry on the current open window (repeatable; bypasses arm slot lock).
Pre-position on the upcoming window before it opens.
Continuous betting every window until HOLD or target profit is hit.
One-shot auto bet on the next window (~15 seconds before open by default).
Sell all open positions by share quantity; LIVE mode requires double confirmation.
Hard stop for all automated betting activity.
$1, $2, $5, $10, $20, $50 USDC.
Optional streak profit target ($5–$50 or custom) that disarms AUTO BET when reached.
Independent session PnL, streak state, and persistent JSON history in data/.
Rolling record of recent UP/DOWN results for bias analysis.
BTC price, PTB, delta, countdown, UP/DOWN prices, wallet line, PnL periods, history strip.
Configurable thresholds on recent 100- and 30-window UP/DOWN skew with visual banners and optional sound.
Provisional Chainlink settlement with later Gamma verification and correction logging.
Color-coded trade, fill, settlement, and error messages.
Keyboard shortcuts (U/D, 1–6, B, N, H, Enter, A, X, P, Q) and mouse-friendly buttons.
Optional visual pulse on active control states.
Optional audio feedback on button presses and bias warnings.
Separated config, auth, feeds, market data, execution, state, and UI layers for maintainability.
The adaptive strategy engine runs each polling cycle when AUTO BET or ARM NEXT is active. It scores market structure and operator parameters, then selects the best-matching strategy profile for the upcoming window.
Time to window open
Timing aggressiveness, entry delay
BTC vs PTB delta
Directional conviction, mean-reversion vs momentum
UP/DOWN book prices
Implied probability, edge vs fair value
EMA stack alignment
Trend filter (bullish / bearish / neutral)
RSI extremes
Overbought/oversold fade or continuation
Recent outcome bias
Contrarian or momentum bias adjustment
Stake & target profit
Risk budget and exit discipline
Market interval & mode
Volatility regime; simulation vs live parameter set
Short EMAs above long EMAs, delta aligned with trend, RSI 45–65
Bet with trend (UP in uptrend, DOWN in downtrend) at full stake.
RSI extreme (>70 or <30) and stretched delta vs PTB
Fade overcrowded side; reduced size on 5m, full size on 4h.
≤15s to window open, tight spread, neutral RSI
Directional bet on default side or book-implied lean.
Recent 30-window skew exceeds alert threshold
Bet against dominant historical outcome when book price offers edge.
Skew + live delta + EMA agree
Bet with dominant regime when structure confirms.
Wide spread, missing PTB, or conflicting signals
Skip window; preserve capital and streak.
Streak PnL within 80% of target profit
Halve stake size; favor higher-probability book side.
4h vs 5m structure
4h: trend-weighted; 5m: delta + microstructure weighted.
After each settled window, the engine updates win rate by profile, interval, and bias bucket — drifting selection weights toward profiles with positive expectancy under the current market structure.
Live terminal dashboard and session demo — BTC context, controls, and order flow in one view.

Terminal dashboard

Live session demo
Polymarket BTC Trading Bot is a Python console application for operators who want full situational awareness, simulation before live deployment, and adaptive strategy selection on Polymarket BTC Up/Down markets.