
Trading Automation
polymarket-arbitrage-cn
该 Skill 自动扫描 Polymarket 预测市场以发现并执行套利机会,适用于想要系统化捕捉预测市场数学套利和监控价差的量化交易者。核心功能包括:fetch_markets.py 抓取市场概率、成交量和元数据;detect_arbitrage.py 基于设定阈值(--min-edge)识别套利并考虑每腿 2% 手续费;scripts/monitor.py 支持一次性纸面回测(--once)与定时监控(--interval),将结果写入 markets.json 与 polymarket_data/arbs.json。
Overview
该 Skill 自动扫描 Polymarket 预测市场以发现并执行套利机会,适用于想要系统化捕捉预测市场数学套利和监控价差的量化交易者。核心功能包括:fetch_markets.py 抓取市场概率、成交量和元数据;detect_arbitrage.py 基于设定阈值(--min-edge)识别套利并考虑每腿 2% 手续费;scripts/monitor.py 支持一次性纸面回测(--once)与定时监控(--interval),将结果写入 markets.json 与 polymarket_data/arbs.json。每条套利包含 net_profit_pct、risk_score(0-100)、volume 与操作建议(买/卖所有结果)。推荐先进行纸面交易、优先 math_arb_buy 类型(更安全)、避开 Sell-All 直到有足够流动性与资金。优势在于自动化筛选、可配置阈值、易于集成与告警,注意跨市场和订单薄套利尚未完全实现。
该 Skill 自动扫描 Polymarket 预测市场以发现并执行套利机会,适用于想要系统化捕捉预测市场数学套利和监控价差的量化交易者。核心功能包括:fetch_markets.py 抓取市场概率、成交量和元数据;detect_arbitrage.py 基于设定阈值(--min-edge)识别套利并考虑每腿 2% 手续费;scripts/monitor.py 支持一次性纸面回测(--once)与定时监控(--interval),将结果写入 markets.json 与 polymarket_data/arbs.json。每条套利包含 net_profit_pct、risk_score(0-100)、volume 与操作建议(买/卖所有结果)。推荐先进行纸面交易、优先 math_arb_buy 类型(更安全)、避开 Sell-All 直到有足够流动性与资金。优势在于自动化筛选、可配置阈值、易于集成与告警,注意跨市场和订单薄套利尚未完全实现。
Skill.md
How this skill works
该 Skill 自动扫描 Polymarket 预测市场以发现并执行套利机会,适用于想要系统化捕捉预测市场数学套利和监控价差的量化交易者。核心功能包括:fetch_markets.py 抓取市场概率、成交量和元数据;detect_arbitrage.py 基于设定阈值(--min-edge)识别套利并考虑每腿 2% 手续费;scripts/monitor.py 支持一次性纸面回测(--once)与定时监控(--interval),将结果写入 markets.json 与 polymarket_data/arbs.json。
Polymarket Arbitrage
Find and execute arbitrage opportunities on Polymarket prediction markets.
Quick Start
1. Paper Trading (Recommended First Step)
Run a single scan to see current opportunities:
cd skills/polymarket-arbitrage
pip install requests beautifulsoup4
python scripts/monitor.py --once --min-edge 3.0
View results in polymarket_data/arbs.json
2. Continuous Monitoring
Monitor every 5 minutes and alert on new opportunities:
python scripts/monitor.py --interval 300 --min-edge 3.0
Stop with Ctrl+C
3. Understanding Results
Each detected arbitrage includes:
- net_profit_pct: Edge after 2% fees
- risk_score: 0-100, lower is better
- volume: Market liquidity
- action: What to do (buy/sell all outcomes)
Good opportunities:
- Net profit: 3-5%+
- Risk score: <50
- Volume: $1M+
- Type:
math_arb_buy(safer)
Arbitrage Types Detected
Math Arbitrage (Primary Focus)
Type A: Buy All Outcomes (prob sum < 100%)
- Safest type
- Guaranteed profit if executable
- Example: 48% + 45% = 93% → 7% edge, ~5% net after fees
Type B: Sell All Outcomes (prob sum > 100%)
- Riskier (requires liquidity)
- Need capital to collateralize
- Avoid until experienced
See references/arbitrage_types.md for detailed examples and strategies.
Cross-Market Arbitrage
Same event priced differently across markets (not yet implemented - requires semantic matching).
Orderbook Arbitrage
Requires real-time orderbook data (homepage shows midpoints, not executable prices).
Scripts
fetch_markets.py
Scrape Polymarket homepage for active markets.
python scripts/fetch_markets.py --output markets.json --min-volume 50000
Returns JSON with market probabilities, volumes, and metadata.
detect_arbitrage.py
Analyze markets for arbitrage opportunities.
python scripts/detect_arbitrage.py markets.json --min-edge 3.0 --output arbs.json
Accounts for:
- 2% taker fees (per leg)
- Multi-outcome fee multiplication
- Risk scoring
monitor.py
Continuous monitoring with alerting.
python scripts/monitor.py --interval 300 --min-edge 3.0 [--alert-webhook URL]
Features:
- Fetches markets every interval
- Detects arbitrage
- Alerts on NEW opportunities only (deduplicates)
- Saves state to
polymarket_data/
Workflow Phases
Phase 1: Paper Trading (1-2 weeks)
Goal: Understand opportunity frequency and quality
- Run monitor 2-3x per day
- Log opportunities in spreadsheet
- Check if they're still available when you look
- Calculate what profit would have been
Decision point: If seeing 3-5 good opportunities per week, proceed to Phase 2.
Phase 2: Micro Testing ($50-100 CAD)
Goal: Learn platform mechanics
- Create Polymarket account
- Deposit $50-100 in USDC
- Manual trades only (no automation)
- Max $5-10 per opportunity
- Track every trade in spreadsheet
Decision point: If profitable after 20+ trades, proceed to Phase 3.
Phase 3: Scale Up ($500 CAD)
Goal: Increase position sizes
- Increase bankroll to $500
- Max 5% per trade ($25)
- Still manual execution
- Implement strict risk management
Phase 4: Automation (Future)
Requires:
- Wallet integration (private key management)
- Polymarket API or browser automation
- Execution logic
- Monitoring infrastructure
Only consider after consistently profitable manual trading.
See references/getting_started.md for detailed setup instructions.
Risk Management
Critical Rules
- Maximum position size: 5% of bankroll per opportunity
- Minimum edge: 3% net (after fees)
- Daily loss limit: 10% of bankroll
- Focus on buy arbs: Avoid sell-side until experienced
Red Flags
- Edge >10% (likely stale data)
- Volume <$100k (liquidity risk)
- Probabilities recently updated (arb might close)
- Sell-side arbs (capital + liquidity requirements)
Fee Structure
Polymarket charges:
- Maker fee: 0%
- Taker fee: 2%
Conservative assumption: 2% per leg (assume taker)
Breakeven calculation:
- 2-outcome market: 2% × 2 = 4% gross edge needed
- 3-outcome market: 2% × 3 = 6% gross edge needed
- N-outcome market: 2% × N gross edge needed
Target: 3-5% NET profit (after fees)
Common Issues
"High edge but disappeared"
Homepage probabilities are stale or represent midpoints, not executable prices. This is normal. Real arbs disappear in seconds.
"Can't execute at displayed price"
Liquidity issue. Low-volume markets show misleading probabilities. Stick to $1M+ volume markets.
"Edge is too small after fees"
Increase --min-edge threshold. Try 4-5% for more conservative filtering.
Files and Data
All monitoring data stored in ./polymarket_data/:
markets.json- Latest market scanarbs.json- Detected opportunitiesalert_state.json- Deduplication state (which arbs already alerted)
Advanced Topics
Telegram Integration (Future)
Pass webhook URL to monitor script for alerts:
python scripts/monitor.py --alert-webhook "https://api.telegram.org/bot<token>/sendMessage?chat_id=<id>"
Position Sizing
For a 2-outcome math arb with probabilities p₁ and p₂ where p₁ + p₂ < 100%:
Optimal allocation:
- Bet on outcome 1: (100% / p₁) / [(100%/p₁) + (100%/p₂)] of capital
- Bet on outcome 2: (100% / p₂) / [(100%/p₁) + (100%/p₂)] of capital
This ensures equal profit regardless of which outcome wins.
Simplified rule: For small edges, split capital evenly across outcomes.
Execution Speed
Arbs disappear fast. If planning automation:
- Use websocket connections (not polling)
- Place limit orders simultaneously
- Have capital pre-deposited
- Monitor gas fees on Polygon
Resources
- Polymarket: https://polymarket.com
- Documentation: https://docs.polymarket.com
- API (if available): Check Polymarket docs
- Community: Polymarket Discord
Support
For skill issues:
- Check
references/arbitrage_types.mdfor strategy details - Check
references/getting_started.mdfor setup help - Review output files in
polymarket_data/ - Ensure dependencies installed:
pip install requests beautifulsoup4
Best used for
When to use it
该 Skill 自动扫描 Polymarket 预测市场以发现并执行套利机会,适用于想要系统化捕捉预测市场数学套利和监控价差的量化交易者。核心功能包括:fetch_markets.py 抓取市场概率、成交量和元数据;detect_arbitrage.py 基于设定阈值(--min-edge)识别套利并考虑每腿 2% 手续费;scripts/monitor.py 支持一次性纸面回测(--once)与定时监控(--interval),将结果写入 markets.json 与 polymarket_data/arbs.json。

01 · PRE-MEETING
Prepare a decision brief
Turn scattered evidence into a structured case before an investment committee meeting.

02 · TEAM WORKFLOW
Standardize handoffs
Create consistent research outputs across analysts, portfolio managers, and agents.

03 · LIVE UPDATE
Refresh the thesis
Update scenarios after a new catalyst, KPI release, or earnings result.
Community notes
Built to improve with use.
Feedback will appear here as this skill is used and reviewed.
Discover more
Related skills
View allquant-analysis
Quantitative Analysis Skill provides an end-to-end toolkit for quantitative finance research and production analysis. It automates data ingestion, interactive analysis in Jupyter (jupyter_execute,…
bankr
Bankr enables executing crypto trading and DeFi operations via natural-language commands. It offers two integration options: a batteries-included Bankr CLI and a REST API at https://api.bankr.bot,…
pine-backtester
pine-backtester provides comprehensive backtesting for Pine Script indicators and strategies. Use it to append performance metrics, analyze trades, generate equity curves, compute win rates, track…