A conservative Polymarket trading bot that scans prediction markets for mispricings, uses Claude to evaluate trades, and places orders via the Polymarket CLOB API.
- Scans active Polymarket markets via the public Gamma API
- Detects mispricings — probability discrepancies where YES + NO prices don't sum to ~1.0
- Analyzes each opportunity with Claude (optional but recommended)
- Confirms the mispricing with a re-check to avoid false signals
- Places conservative, small-position trades automatically
- Logs all activity and runs continuously on a configurable interval
- Claude-powered analysis — evaluates whether a trade makes sense before placing it
- Conservative by default — small position sizes ($10), low daily limits ($100, 5 trades/day)
- Confirmation checks — re-fetches prices before trading to avoid noise
- Dry-run mode — runs with zero risk, no real orders placed
- Daily risk limits — max trades and spend per 24 hours
- Comprehensive logging — trade log, cycle-by-cycle output
cd ~/PolymarketBot
pip install -r requirements.txtcp config.py.example config.py
# Edit config.py with your settingsRequired environment variables (or set in config.py):
export POLYMARKET_PRIVATE_KEY="0x..." # Your Polygon private key
export POLYMARKET_WALLET_ADDRESS="0x..." # Your Polygon wallet address
export ANTHROPIC_API_KEY="sk-ant-..." # Optional: for Claude analysis
⚠️ WARNING: Never commitconfig.pyor expose your private key!
python bot.py --checkpython bot.py --dry-runThis will scan markets and show what it would trade without placing any orders.
python bot.py --liveOr edit config.py and set LIVE_MODE = True.
python bot.py --dry-run --once| Setting | Default | Description |
|---|---|---|
DEFAULT_POSITION_SIZE |
$10 |
Base trade size |
MAX_POSITION_SIZE |
$50 |
Maximum per trade |
MAX_DAILY_TRADES |
5 |
Trades per 24h |
MAX_DAILY_SPEND |
$100 |
USDC spent per 24h |
SCAN_INTERVAL_SECONDS |
300 |
Seconds between scans |
LIVE_MODE |
False |
Set True to place real trades |
USE_CLAUDE_ANALYSIS |
True |
Use Claude to evaluate trades |
CLAUDE_CONFIDENCE_THRESHOLD |
0.7 |
Minimum Claude confidence to trade |
MIN_PROBABILITY_MISPRICING |
0.05 |
Minimum price discrepancy to act on |
MIN_LIQUIDITY |
$100 |
Minimum open interest to consider |
CONFIRMATION_CHECKS |
2 |
Re-checks before placing order |
The bot looks for YES + NO spread anomalies on binary markets:
- In a properly priced binary market: YES price + NO price ≈ 1.0
- If
YES > 1 - NO + threshold, YES is expensive → bot buys NO - If
NO > 1 - YES + threshold, NO is expensive → bot buys YES
The threshold is MIN_PROBABILITY_MISPRICING (default 5%).
Example: If YES = 65¢ and NO = 42¢, the sum is 107¢ — a 7% spread indicating a potential mispricing.
bot.py
├── PolymarketClient # Gamma (public) + CLOB (public) API calls
├── TradingClient # Authenticated CLOB trading via py-clob-client
├── MispricingDetector # Scans markets, finds mispricings
├── ClaudeAnalyzer # Asks Claude to evaluate trades
└── PolymarketBot # Main orchestrator: scan → analyze → trade → log
- Conservative position sizing (max $50/trade)
- Daily spend and trade limits reset every 24h
- Claude analysis adds a human-like sanity check before each trade
- Confirmation checks filter out momentary price noise
- Live mode must be explicitly enabled
- This is not financial advice. Use at your own risk.
- Prediction markets can be inefficient, but execution, fees, and slippage can erode profits
- The bot does NOT guarantee profitability
- Multi-choice markets are excluded (only binary YES/NO markets are traded)
- The bot does not automatically exit positions — it places limit orders only
- Always start in dry-run mode and monitor closely when going live
PolymarketBot/
├── bot.py # Main bot code
├── config.py.example # Configuration template
├── requirements.txt # Python dependencies
├── README.md # This file
├── trade_log.jsonl # Auto-created: all trades logged here
└── daily_stats.json # Auto-created: daily statistics
- Python 3.10+
- Polygon wallet with USDC.e for trading and POL for gas
ANTHROPIC_API_KEYfor Claude analysis (optional but recommended)