Open-source Rust bot for automated sports betting and trading on Polymarket. Trade NFL, NBA, football, tennis, and any binary-outcome sports market using trailing strategies, limit orders, and hedging—with simulation and live modes. Built for polymarket-sports-trading-bot, polymarket-sports-betting, and polymarket-sport-bet automation.
Repository: github.com/dev-protocol/polymarket-sports-trading-bot
Polymarket is a decentralized prediction market where you trade on real-world outcomes—elections, sports (NFL, NBA, soccer, tennis, etc.), and more. Prices reflect market sentiment. This polymarket-sports-trading-bot connects to Polymarket’s APIs (Gamma + CLOB) to automate polymarket-sports-betting on selected sports markets.
| Focus | Description |
|---|---|
| Sports markets | Trade any binary-outcome polymarket-sport-bet by slug (NFL, NBA, football, tennis, etc.). Trailing strategy: follow the side that moves first, then hedge the opposite. |
| Modes | Simulation (no real orders) and live (real orders). Backtest on historical data. |
This polymarket-betting-bot is built in Rust for speed and reliability. Use it as a polymarket-nba-bot, polymarket-football-bot, polymarket-tennis-bot, or for any slug-based sports market on Polymarket.
- Sports trailing bot (default) — Trade sports markets by Polymarket slug. Trail both outcomes; buy the side that moves first (ask ≥ lowest + trailing stop), then hedge the other. One-shot or continuous.
- Backtest — Replay strategy on historical price data in
history/. - Test binaries — Limit order, redeem, merge, allowance, sell, prediction tests.
| Binary | Description |
|---|---|
main_sports_trailing |
Sports market trailing bot (default) — polymarket-sports-bot by slug |
backtest |
Backtest on history files |
test_* |
test_limit_order, test_redeem, test_merge, test_allowance, test_sell, test_predict_fun |
-
Install Rust (if needed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Build:
cargo build --release
-
Configure: Copy
config.example.jsontoconfig.jsonand set:- polymarket:
api_key,api_secret,api_passphrase,private_key - Optional:
proxy_wallet_address,signature_type(1 = POLY_PROXY, 2 = GNOSIS_SAFE) - trading:
slug(market slug from Polymarket URL),trailing_stop_point,trailing_shares,continuous
- polymarket:
Binary: main_sports_trailing
Trade any binary outcome sports market (NFL, NBA, football, tennis, etc.) by Polymarket slug. Trail both outcome tokens; buy the one whose price rises first (ask ≥ lowest + trailing_stop_point), then trail and buy the opposite token to hedge. Use as a polymarket-nba-bot, polymarket-football-bot, polymarket-tennis-bot, or for any Yes/No or Team A vs Team B market.
Config: Set trading.slug to your market slug (from the Polymarket URL). Use continuous: true to repeat buys until market ends, or false to buy each side once.
# Simulation (no real orders)
cargo run -- --simulation
# Live (real orders)
cargo run -- --no-simulation
# Explicit binary
cargo run --bin main_sports_trailing -- --config config.json --simulation
cargo run --bin main_sports_trailing -- --config config.json --no-simulationBinary: backtest
Replays the trailing strategy on history/market_*_prices.toml: simulated fills, hedge logic, PnL.
cargo run --bin backtest -- --backtest| Binary | Purpose |
|---|---|
test_limit_order |
Place a limit order (e.g. --price-cents 60 --shares 10) |
test_redeem |
List/redeem winning tokens (--list, --redeem-all) |
test_merge |
Merge complete sets to USDC (--merge) |
test_allowance |
Check balance/allowance; set approval (--approve-only, --list) |
test_sell |
Test market sell |
test_predict_fun |
Test prediction/price logic |
Example:
cargo run --bin test_allowance -- --approve-only # One-time approval for selling
cargo run --bin test_redeem -- --list--simulation/--no-simulation— No real orders in simulation.--config <path>— Config file (default:config.json).
Config summary:
- polymarket:
gamma_api_url,clob_api_url,api_key,api_secret,api_passphrase,private_key, optionalproxy_wallet_address,signature_type. - trading:
slug(required),continuous,trailing_stop_point(default 0.03),trailing_shares,check_interval_ms,min_time_remaining_seconds.
- Bots run until you stop them (Ctrl+C).
- Simulation mode logs trades but does not send orders.
- Before selling, set on-chain approval once per proxy wallet:
cargo run --bin test_allowance -- --approve-only
- Do not commit
config.jsonwith real keys or secrets. - Prefer simulation and small sizes when testing.
- Monitor logs and balances when running in production.
polymarket-sports-trading-bot — https://github.com/dev-protocol/polymarket-sports-trading-bot
SEO keywords: polymarket-sports-trading-bot, polymarket-sports-betting, polymarket-sports-bot, polymarket-betting-bot, polymarket-trading-bot, polymarket-nba-bot, polymarket-football-bot, polymarket-tennis-bot, polymarket-sport-bet.
Looking for a polymarket-sports-trading-bot, polymarket-sports-bot, or polymarket-betting-bot? This repo is a polymarket-trading-bot focused on polymarket-sports-betting: a polymarket-nba-bot, polymarket-football-bot, polymarket-tennis-bot, and general polymarket-sport-bet automation. Keywords: polymarket-sports-trading-bot, polymarket-sports-betting, polymarket-sports-bot, polymarket-betting-bot, polymarket-trading-bot, polymarket-nba-bot, polymarket-football-bot, polymarket-tennis-bot, polymarket-sport-bet.