Polymarket AI Trading Skills
Composable Agent Skills for Polymarket prediction market trading. Paper-trading-first, security-audited, works with Claude Code, OpenClaw, NanoClaw, Codex, Cursor, and any SKILL.md-compatible agent.
Skills
| Skill |
What It Does |
Auth |
Risk |
| polymarket-scanner |
Browse, search, and explore live markets |
None |
Zero |
| polymarket-analyzer |
Detect edges: arbitrage, momentum, correlation analysis |
None |
Zero |
| polymarket-monitor |
Price alerts and position monitoring |
None |
Zero |
| polymarket-paper-trader |
Simulate trades against live prices, portfolio health checks |
None |
Zero |
| polymarket-strategy-advisor |
Trading methodology, recommendations, backtesting |
None |
Low |
| polymarket-live-executor |
Execute real trades (wallet + explicit human opt-in) |
L2 Wallet |
Medium |
Install
One Command (All Skills)
Individual Skills
Manual
Copy any skill folder to ~/.claude/skills/ (Claude Code) or ~/.agents/skills/ (other agents).
Dependencies
Quick Start
Once installed, talk to your agent naturally:
- "Scan Polymarket for interesting markets" -- triggers polymarket-scanner
- "Find trading opportunities" -- triggers polymarket-analyzer
- "Set up a paper trading portfolio with $1000" -- triggers polymarket-paper-trader
- "What should I trade?" -- triggers polymarket-strategy-advisor
- "Check my portfolio health" -- triggers polymarket-paper-trader (health_check)
- "Am I ready to go live?" -- triggers polymarket-strategy-advisor (backtest --live-check)
- "Check correlation risk" -- triggers polymarket-analyzer (correlation_tracker)
Full Pipeline
Architecture
polymarket-scanner/ -- Market Data (Read-Only)
| Script |
Purpose |
Key Args |
scan_markets.py |
Browse/search active markets from Gamma API |
--limit 100 --min-volume 10000 --category TEXT --search TEXT |
get_orderbook.py |
Full order book for a specific token |
--token-id ID --depth 10 |
get_prices.py |
Current midpoint, spread, last trade |
--token-id ID (repeatable) --market-slug SLUG |
polymarket-analyzer/ -- Edge Detection
| Script |
Purpose |
Key Args |
find_edges.py |
Arbitrage (YES+NO < $1), wide spread, overpriced detection |
--min-edge 0.02 --limit 500 |
momentum_scanner.py |
Volume surges, price momentum, liquidity changes |
--min-volume 10000 --limit 300 |
analyze_orderbook.py |
Depth analysis, bid-ask imbalance, liquidity concentration |
--token-id ID --depth 10 |
correlation_tracker.py |
Detects hidden correlated exposure in portfolio |
--threshold 0.15 --json |
polymarket-monitor/ -- Price Monitoring
| Script |
Purpose |
Key Args |
monitor_prices.py |
Multi-token polling with threshold alerts (JSON) |
--token-id ID --interval 30 --threshold 5.0 |
watch_market.py |
Continuous single-market snapshots |
--token-id ID --interval 15 |
polymarket-paper-trader/ -- Simulation Engine
| Script |
Purpose |
Key Args |
paper_engine.py |
Core engine: init, buy, close, portfolio, trades |
--action init/buy/close/portfolio/trades |
execute_paper.py |
Execute structured strategy recommendations |
--recommendation '{"token_id":...}' --dry-run |
portfolio_report.py |
Full analytics: Sharpe, Sortino, drawdown |
--json |
health_check.py |
One-command session start: live prices, stops, drawdown, risk |
--json (exit codes: 0=GREEN, 1=YELLOW, 2=RED) |
polymarket-strategy-advisor/ -- Trading Methodology
| Script |
Purpose |
Key Args |
advisor.py |
Scan, score, size trade recommendations |
--top 5 --portfolio-db PATH |
backtest.py |
Performance analysis + live-readiness assessment |
--live-check --days 30 --json |
daily_review.py |
Win/loss breakdown, strategy analysis, suggestions |
--days 7 |
polymarket-live-executor/ -- Real Trading (4 Safety Layers)
| Script |
Purpose |
Key Args |
execute_live.py |
Place real orders (requires env vars + human "yes") |
--token-id ID --side BUY --size 5 --price 0.60 |
check_positions.py |
Wallet balance, open orders, trade history |
--balance --orders --trades |
setup_wallet.py |
Create burner wallet, verify config, check balance |
--create / --verify / --check-balance |
CLAUDE.md Constitution
The repo includes a CLAUDE.md that serves as the agent's trading constitution:
- 9 non-negotiable rules (edge required, paper default, risk is law, human confirms live trades, etc.)
- Authoritative risk limits resolving all cross-file conflicts (graduated drawdown at 10/15/20%)
- Daily workflow (14-step session start -> scan -> evaluate -> execute -> review)
- Paper-to-live prerequisites (20+ trades, >55% win rate, Sharpe >0.5, drawdown <15%)
- Experience tiers for live capital progression ($25 -> $100 -> $500 -> $2,000+)
When CLAUDE.md conflicts with any SKILL.md, CLAUDE.md wins.
Risk Management
Risk Limits (from CLAUDE.md)
| Parameter |
Limit |
| Max position size |
10% of portfolio (5% if confidence < 0.7, 2% for news, 1% for new strategy) |
| Max concurrent positions |
5 |
| Max single market exposure |
20% of portfolio |
| Daily loss halt |
5% of portfolio |
| Weekly loss halt |
10% of portfolio |
| Graduated drawdown |
10% -> reduce 50%, 15% -> reduce 75%, 20% -> halt all |
Correlation Detection
The correlation_tracker.py groups positions by topic and detects hidden correlation:
Portfolio Health Check
The health_check.py runs the full session-start workflow in one command:
Live-Readiness Assessment
The backtest.py --live-check tells you when you're ready for real money:
Going Live
Prerequisites
- 20+ closed paper trades with >55% win rate, Sharpe >0.5, drawdown <15%
- A burner wallet (never your main wallet) funded with USDC on Polygon
- Environment variables configured
Setup
Experience Tiers
| Level |
Max Wallet |
Max Per Trade |
Daily Loss Limit |
| First time |
$25 |
$5 |
$10 |
| Learning |
$100 |
$10 |
$25 |
| Experienced |
$500 |
$50 |
$100 |
| Advanced |
$2,000+ |
$200 |
$500 |
Safety Layers
- Paper-first: Must prove edge in simulation before going live
- Env var gate:
POLYMARKET_CONFIRM=true required for any execution
- Human-in-the-loop: Every trade shows full details, waits for "yes"
- Position caps: Hard limits on size, daily loss, and concentration
APIs Used
| API |
Endpoint |
Auth |
Usage |
| Gamma API |
gamma-api.polymarket.com |
None |
Market metadata, search |
| CLOB API |
clob.polymarket.com |
None (read) / L2 (trade) |
Prices, orderbooks, trading |
No official Polymarket testnet exists. The paper trading engine simulates execution against real live prices.
Data Storage
| Location |
Contents |
~/.polymarket-paper/portfolio.db |
Paper trading portfolio (SQLite) |
~/.polymarket-live/trades.log |
Live trade log |
~/.polymarket-paper/ |
All paper trading data |
Security
- Full security audit: SECURITY-AUDIT.md (14 findings, all HIGH/MEDIUM fixed)
- All DB queries use parameterized statements (no SQL injection)
- Market data treated as untrusted (prompt injection defense)
- Private keys never logged, displayed, or echoed
.env files gitignored; .env.example provided as template
Disclaimer
- These skills provide analytical tools and a paper trading simulator
- Not financial advice. Past performance does not predict future results
- Prediction market trading involves risk of total loss
- Always paper trade new strategies before risking real capital
- The authors are not responsible for any trading losses