Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🟡 POLYBIT 15 — Polymarket BTC 15-minute binary options bot

POLYBIT 15 trades Polymarket's Bitcoin "Up or Down" 15-minute binary markets — every quarter hour, Polymarket opens a fresh market that pays $1.00 per share if BTC's price ends the period higher (Up) or lower (Down), and $0.00 for the losing side. The bot watches the order book every second, enters when price and momentum line up, and manages the position through a 7-priority exit chain until the period resolves. A C# WinForms dashboard shows live P/L, open positions, and trade history, with a START/STOP button for the bot itself.

This is the flagship of a four-bot family — same engine, different primary asset: polyeth-15 (ETH) · polysol-15 (SOL) · polybit-15-pro (XRP).

🔑 Bring your own Polymarket API — nothing is bundled

The repo ships no credentials. Copy the template and plug in your own:

cp config.example.json config.json     # config.json is gitignored — it never leaves your machine

You need four values in the polymarket block:

Field What it is Where to get it
private_key Your Polygon wallet's private key (hex) The wallet you use with Polymarket (export from your wallet app)
api_key / api_secret / api_passphrase Polymarket CLOB L2 API credentials Derived from your wallet — create via Polymarket's API settings or py-clob-client's create_or_derive_api_creds()

Fund the wallet with USDC on Polygon before going live. Treat config.json like a wallet seed — anyone holding those values controls your funds.

Strategy

Entry — momentum-gated dip buying

  • Waits a few minutes into each 15-minute period (no blind opens), then buys the Up token when its ask is in the configured value zone (default ≤ $0.57).
  • A rolling linear regression on the Up ask predicts direction; when confidence (R²) clears the threshold, the bot may pay up to momentum_max_buy_price (default $0.62) — and momentum can override buy_up_only to take Down entries.
  • Skips entries in the final seconds and when the spread is too wide.

Exit — 7-priority chain, checked every tick

1. TIME HOLD     mid ≥ hold threshold, < 5 min left   → ride to $1.00 resolution
2. PROFIT LOCK   tiered partial sells (default 88¢ / 95¢) → bank profit, let rest run
3. TIME CUT      mid < 50¢ with > 10 min left          → cut a loser early
4. LATE CUT      mid underwater mid-period             → cut before it decays
5. FINAL EXIT    still underwater in the last minutes  → salvage vs $0 resolution
6. STOP LOSS     hard floor                            → sell all
7. RESOLVED      period ends                           → $1.00 or $0.00

All thresholds live in config.example.json — tune without recompiling.

Simulation first, live when ready

The bot defaults to simulation: it tracks every would-be trade in local JSON files using real market prices, but places no orders. Run it for days, read the P/L, tune, and only then:

polymarket-arbitrage-bot.exe --no-simulation      # real orders, real money

Architecture

src/main.rs       entry point, 15-min market discovery (BTC primary)
src/monitor.rs    1-second polling loop, period transitions
src/detector.rs   price detection + linear-regression momentum signal
src/trader.rs     buy execution, the 7-priority exit chain, resolution handling
src/simulation.rs simulated fills, P/L accounting, trade records
src/api.rs        Polymarket CLOB + Gamma API client (EIP-712 order signing)
src/config.rs     config loading, CLI flags (--simulation / --no-simulation)
src/bin/          research binaries: backtester, limit-order experiments, redeem/sell tests
dashboard/        C# WinForms dashboard (.NET 8)
docs/             architecture deep-dive + strategy design notes

Dashboard (dashboard/, .NET 8 WinForms): live stat cards (P/L, win rate, open positions), open/closed trade grids fed by a file watcher on the bot's output, bot process detection with a START/STOP button, and optional trade sounds (drop .wav files into a sounds/ folder next to the exe — silent if absent).

Build & run

cargo build --release                          # bot  → target/release/polymarket-arbitrage-bot.exe
cd dashboard && dotnet build -c Release        # dashboard (Windows)

Run the bot from the repo root (it reads config.json and writes its runtime files there). Launch the dashboard exe from dashboard/BtcDashboard/bin/Release/ — it finds the bot directory relative to the repo layout, or falls back to its working directory.

⚠️ Disclaimer

This is trading software for a real-money market. It can and will lose money; 15-minute binaries are fast and unforgiving. Nothing here is financial advice. Simulation results do not guarantee live results (slippage, fills, latency). Check whether Polymarket is legally accessible in your jurisdiction. Use at your own risk.

About

Polymarket BTC 15-minute binary options trading bot (Rust) + WinForms dashboard. Momentum entry, 7-priority exit chain, simulation mode. Bring your own Polymarket API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages