Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Polymarket sports arbitrage trading bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot polymarket arbitrage bot
| Date | Stars |
|---|---|
| 2026-07-24 | 293 |
| 2026-07-25 | 290 |
| 2026-07-28 | 290 |
| 2026-07-30 | 290 |
| 2026-08-06 | 290 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Polymarket Sports Cross-Line Arbitrage Bot
> A polymarket trading bot that detects temporary pricing inefficiencies across connected Polymarket sports markets.
<p align="center">
<img width="800" height="418" alt="image" src="https://github.com/user-attachments/assets/78ca4d97-f674-4330-8b79-4f23cd24f12f" />
</p>
**Polymarket Profile** → https://polymarket.com/@woaifacai
### Connect
📞 https://t.me/woaifacai888
---
## Features
- ⚡ Real-time Polymarket CLOB streaming (market + user WS in live mode)
- 🧠 Cross-line arbitrage detection on NBA, WNBA, MLB, KBO, K League, Liga MX & MLS markets
- ⚡ Atomic taker execution: all legs filled immediately at detection (no legging risk)
- ♻️ Auto-merges matched YES+NO pairs back to USDC (capital recycled mid-game, not at settlement)
- 🏟 Trades in-play by default — resting orders survive kickoff
- 📈 Kelly / target-notional stake sizing (default **$100** per package)
- 💰 Paper trading (sim) & live trading via `@polymarket/clob-client-v2`
- 🛡 Risk engine: kill switch, exposure caps, liquidity & stale-book gates
- 📦 Multi-leg execution with tick rounding, retries, and rollback on failure
- 📜 Persistent trade history (JSONL) for sim and live sessions
- 📊 Terminal dashboard with live + recent opportunities, PnL, and exposure
- 🪟 **Windows one-click launchers** (`run-bot-sim.bat`, `run-bot-live.bat`)
- 🚀 PM2 process management with auto-restart
- 🧩 Modular TypeScript architecture + unit tests
---
## Strategy
Sports markets inside a single event should satisfy several no-arbitrage relationships. When one market reprices faster than another, temporary inefficiencies can appear.
```
Gamma API
│
▼
Discover connected markets (NBA, WNBA, MLB, KBO, K League, Liga MX, MLS)
│
▼
Stream live CLOB order books (REST + WebSocket)
│
▼
Detect pricing violations (6 relation types)
│
▼
Depth / staleness / exposure / kill-switch checks
│
▼
Size to target notional (~$100 package default)
│
▼
Place multi-leg limit orders (tick-rounded, with retry)
│
▼
Track fills, positions, PnL & append trade history
```
### Arbitrage checks
| Relation | Description |
|----------|-------------|
| `complementary_pair` | YES ask + NO ask < $1 on same market |
| `btts` | BTTS YES/NO pair (same as complementary) |
| `totals_ladder` | Over(lower line) priced below Over(higher line) |
| `spread_ladder` | Easier spread YES cheaper than harder spread YES |
| `moneyline_spread` | ML vs spread-at-0 desync (real NO ask hedge) |
| `three_way_sum` | Home + draw + away YES asks sum < $1 |
### Execution quality
- **Stable opportunity IDs** — cooldown and risk tracking work across scans
- **Depth-aware sizing** — rejects or clamps when ask depth is insufficient
- **Stale book filter** — skips opportunities when books are older than `MAX_BOOK_AGE_MS`
- **Multi-leg rollback** — cancels already-placed legs if a later leg fails
- **Kill switch** — halts trading when daily realized loss exceeds limit
---
## Quick Start
### Windows / macOS / Linux
```bash
git clone https://github.com/Woaifacai888/polymarket-sports-arbitrage-bot.git
cd polymarket-sports-arbitrage-bot
cp .env.example .env
npm install
npm run build
# Simulation
npm run start:sim
# Live (requires credentials + confirmation)
npm run start:live -- --confirm-live
```
### Development (hot reload)
```bash
npm run dev
```
### Tests
```bash
npm test
```
---
## CLI
```bash
npm start -- --mode sim
npm start -- --mode live --confirm-live
npm start -- --event nba-lal-bos-2026-01-15
npm start -- --tag 100381
```
| Flag | Description |
|------|-------------|
| `--mode sim` | Simulation / paper trading |
| `--mode live` | Live trading on Polymarket CLOB |
| `--event` | Watch a specific event slug |
| `--tag` | Filter Gamma tag IDs |
| `--confirm-live` | Required safety confirmation for live mode |
---
## Configuration
Copy `.env.example` to `.env`. Key variables:
| Variable | DefauExcerpt of 6,722 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:617b0c5a1bf9536f, topic:trading, desc:trading bot, readme:trading bot