SkillAgentSearch skills...

Polymarket Trading Bot

πŸ€– The most advanced open-source Polymarket trading bot. 7 automated strategies (arbitrage, convergence, market making, momentum, AI forecast), whale tracker with copy-trade simulator, real-time dashboard, parallel market scanner, paper trading mode. 53K+ lines of TypeScript. Contact @DylanForexia on Telegram for custom bots.

Install / Use

npx skills add emmanuelwestra/Polymarket-Trading-Bot

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center">

πŸ€– Polymarket Trading Bot & Dashboard

The Most Advanced Open-Source Automated Trading Platform for Polymarket Prediction Markets

TypeScript Node.js Tests License Docker Lines of Code

7 trading strategies Β· πŸ‹ whale tracker & copy-trade simulator Β· πŸ“Š real-time dashboard Β· πŸ”’ paper trading by default

Features Β· Quick Start Β· Strategies Β· Whale Scanner Β· Dashboard Β· Configuration Β· API Reference Β· Custom Development

<br/> <img src="docs/screenshots/dashboard.png" alt="Polymarket Trading Bot Dashboard β€” Real-time P&L tracking, 10 wallets, 8 strategies, whale scanner" width="100%" />

Real-time dashboard showing 10 active wallets, $72,800 total capital, $39,240 total P&L, and 7 concurrent strategies running in paper trading mode.

</div>

πŸ“– Overview

A production-grade, modular trading system for Polymarket prediction markets. Run 7 concurrent strategies β€” from cross-market arbitrage to AI-driven forecasting β€” each isolated in its own wallet with independent capital, risk limits, and execution modes (LIVE or PAPER).

The platform includes an enterprise-level whale tracking engine that auto-discovers profitable traders, scores them with regime-adaptive algorithms, detects coordinated whale clusters, and lets you simulate copy-trading their moves β€” all from a beautiful real-time dashboard.

Why This Bot?

| Problem | Solution | |---------|----------| | Manual trading is slow & emotional | 7 automated strategies scan 24/7, execute in milliseconds | | Can't find alpha in prediction markets | Whale scanner discovers profitable traders with proven track records | | Risk of ruin from a single bad trade | Per-wallet isolation, daily loss limits, global kill switch | | No visibility into what the bot is doing | Real-time SSE dashboard with live trades, P&L, positions | | Rate-limited by Polymarket APIs | Multi-API pool with rotation, 16x parallel scanning | | Fear of losing real money while testing | Paper trading mode by default β€” no real funds at risk |


✨ Features

🧠 8 Built-In Trading Strategies

| # | Strategy | Type | Description | Edge | |---|----------|------|-------------|------| | 1 | Cross-Market Arbitrage | Arbitrage | Exploits price differences between correlated Polymarket markets | 3%+ minimum edge | | 2 | Mispricing Arbitrage | Arbitrage | Detects when outcome probabilities don't sum to 100% | 2%+ dislocation | | 3 | Filtered High-Prob Convergence | Convergence | 7-filter pipeline targeting 65-96% probability outcomes | 200 bps take profit | | 4 | Market Making (Spread) | Market Making | Provides liquidity by quoting both sides of the book | 40 bps spread capture | | 5 | Momentum | Trend Following | Rides short-term price trends with 15-min lookback | Trend continuation | | 6 | AI Forecast | Research/AI | ML-driven predictions with web research pipeline | Data-driven alpha | | 7 | Copy Trading | Whale Mirroring | Mirrors whale trades in real-time with full risk management | Whale alpha extraction | | 8 | User-Defined | Custom | Your own strategy β€” extend the base class | Unlimited |

πŸ‹ Whale Tracking & Copy Trading

  • Auto-Discovery Scanner β€” Scans 50+ liquid markets per cycle to find profitable whales
  • 16x Parallel Scanning β€” Semaphore-based concurrency with tunable batch sizes
  • Multi-Dimensional Scoring β€” Profitability (30%), timing skill (20%), low slippage (15%), consistency (15%), market selection (10%), recency (10%)
  • Regime-Adaptive Scoring β€” Automatically adjusts whale scores based on current market conditions
  • Whale Cluster Detection β€” Identifies when multiple whales converge on the same market
  • Network Graph Analysis β€” Visualizes relationships between whale wallets
  • Copy-Trade Simulator β€” Backtest copy-trading strategies with configurable slippage & delay
  • Big Trade Alerts β€” Real-time alerts for trades β‰₯ $3K
  • Cross-Reference Engine β€” Deep-scans top whales across all markets
  • Historical Backfill β€” 7-day lookback on first run for immediate insights
  • On-Chain Balance Lookup β€” USDC balance verification via Polygon RPC
  • Multi-Exchange Ready β€” Stubs for Kalshi and Manifold Markets

πŸ“Š Real-Time Dashboard

  • Server-Sent Events (SSE) β€” Live updates, no polling
  • Dark Theme UI β€” Professional trading terminal aesthetic
  • 10 Wallet Cards β€” Each showing strategy, P&L, open positions, trade history
  • Strategy Library β€” Browse all strategies, create wallets with one click
  • Live Trade Feed β€” Every BUY/SELL across all wallets in real-time
  • Market Scanner View β€” See which markets the bot is analyzing
  • Console Logs β€” Live log stream from the engine
  • Whale Tracking Panel with 6 sub-tabs:
    • πŸ” Scanner β€” Live scan results with whale profiles
    • πŸ“Š Clusters β€” Coordinated whale activity detection
    • πŸ•ΈοΈ Network β€” Wallet relationship graph
    • πŸ“ˆ Copy Sim β€” Copy-trade performance simulation
    • 🌊 Regime β€” Market regime analysis & adaptive scoring
    • πŸ”„ API Pool β€” Endpoint health & rate limit monitoring
  • Performance Metrics β€” Markets/sec, trades/sec, fetch latency, cache hit rate

πŸ”’ Risk Management

  • Wallet Isolation β€” Each strategy runs in its own wallet with separate capital
  • Per-Wallet Limits β€” Max position size, exposure per market, daily loss, max drawdown
  • Global Kill Switch β€” Emergency stop across all strategies
  • Paper Trading Default β€” LIVE mode requires explicit ENABLE_LIVE_TRADING=true
  • Daily/Weekly Loss Halts β€” Auto-pause at configurable thresholds (3% daily, 8% weekly)
  • MLE Caps β€” Maximum loss exposure capped at 5% per market, 15% total
  • Order Rate Limiting β€” Prevents runaway order submission
  • No Secrets in Code β€” All API keys via environment variables only

⚑ Performance & Scalability

  • 50 TypeScript source files β€” Clean, modular architecture
  • 106 unit tests β€” Full coverage with Vitest
  • 16x parallel market scanning β€” Configurable concurrency
  • Smart caching β€” 5-minute TTL market metadata cache
  • API pool rotation β€” Distribute requests across multiple endpoints
  • Docker-ready β€” Single docker build & docker run
  • SQLite storage β€” Zero-config whale database

πŸš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/dylanpersonguy/Polymarket-Trading-Bot.git
cd Polymarket-Trading-Bot

# Install dependencies
npm install

# Build the project
npm run build

Launch (Paper Trading β€” Safe by Default)

# Start the bot with default config (all wallets in PAPER mode)
npm start

# Or use the CLI directly
node dist/cli.js start --config config.yaml

The bot will start all 10 wallets (8 strategies), launch the whale scanner, and serve the dashboard at:

🌐 Dashboard: http://localhost:3000/dashboard

Verify It's Working

# Check the dashboard
open http://localhost:3000/dashboard

# View engine status via API
curl http://localhost:3000/api/data | jq

# List all wallets
curl http://localhost:3000/api/wallets | jq

# View live trades
curl http://localhost:3000/api/trades/all | jq

🧠 Strategies

1. Cross-Market Arbitrage

Identifies price discrepancies between correlated Polymarket markets and captures the spread.

strategy_config:
  cross_market_arbitrage:
    min_edge: 0.03  # Minimum 3% edge to trade

Example: Market A prices "Trump wins" at 52Β’ while Market B prices "Trump nominee" at 48Β’. If logically linked, the bot captures the 4% spread.

2. Mispricing Arbitrage

Detects when a market's outcome probabilities don't sum to 100% (minus the vig), indicating mispricing.

strategy_config:
  mispricing_arbitrage:
    min_dislocation: 0.02  # 2% minimum dislocation

Example: A binary market shows YES at 55Β’ and NO at 42Β’ (total = 97Β’). The bot buys the underpriced side.

3. Filtered High-Probability Convergence

The flagship strategy. A rule-based, no-AI approach that targets markets where the leading outcome has a 65-96% probability AND passes 7 strict filters:

| Filter | What It Checks | |--------|---------------| | Liquidity | β‰₯ $10K market liquidity + depth within 1% of mid | | Probability Band | Leading outcome between 65% and 96% | | Spread | Bid-ask spread ≀ 200 bps | | Time-to-Resolution | Market resolves within 14 days | | Anti-Chasing | No recent 8%+ price spikes | | Flow/Pressure | Orderbook imbalance or net buy flow β‰₯ $500 | | Cluster Exposure | ≀ 25% capital in correlated markets |

Sizing: position = capital Γ— 0.5% Γ— setup_score where setup_score is a composite of spread tightness (30%), depth (25%), order flow (25%), and time-to-resolution (20%).

Example: Market "Will inflation drop below 3%?" β€” probability at 78%, spread at 120 bps, $50K liquidity, resolves in 9 days, strong buy flow. Setup score = 0.82. On $10K capital: position = $10,000 Γ— 0.005 Γ— 0.82 = $41 entry, targeti

Related Skills

View on GitHub
GitHub Stars17
CategoryDevelopment
Updated9d ago
Forks53

Languages

TypeScript

Security Score

75/100

Audited on Jul 29, 2026

No findings