← 返回 Skills 市场
johny0920

Polymarket Arbitrage

作者 JohnY0920 · GitHub ↗ · v0.1.0
cross-platform ⚠ suspicious
4410
总下载
12
收藏
27
当前安装
1
版本数
在 OpenClaw 中安装
/install polymarket-arbitrage
功能描述
Monitor and execute arbitrage opportunities on Polymarket prediction markets. Detects math arbitrage (multi-outcome probability mismatches), cross-market arbitrage (same event different prices), and orderbook inefficiencies. Use when user wants to find or trade Polymarket arbitrage, monitor prediction markets for opportunities, or implement automated trading strategies. Includes risk management, P&L tracking, and alerting.
使用说明 (SKILL.md)

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: \x3C50
  • Volume: $1M+
  • Type: math_arb_buy (safer)

Arbitrage Types Detected

Math Arbitrage (Primary Focus)

Type A: Buy All Outcomes (prob sum \x3C 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

  1. Run monitor 2-3x per day
  2. Log opportunities in spreadsheet
  3. Check if they're still available when you look
  4. 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

  1. Create Polymarket account
  2. Deposit $50-100 in USDC
  3. Manual trades only (no automation)
  4. Max $5-10 per opportunity
  5. 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

  1. Increase bankroll to $500
  2. Max 5% per trade ($25)
  3. Still manual execution
  4. 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

  1. Maximum position size: 5% of bankroll per opportunity
  2. Minimum edge: 3% net (after fees)
  3. Daily loss limit: 10% of bankroll
  4. Focus on buy arbs: Avoid sell-side until experienced

Red Flags

  • Edge >10% (likely stale data)
  • Volume \x3C$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 scan
  • arbs.json - Detected opportunities
  • alert_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\x3Ctoken>/sendMessage?chat_id=\x3Cid>"

Position Sizing

For a 2-outcome math arb with probabilities p₁ and p₂ where p₁ + p₂ \x3C 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

Support

For skill issues:

  • Check references/arbitrage_types.md for strategy details
  • Check references/getting_started.md for setup help
  • Review output files in polymarket_data/
  • Ensure dependencies installed: pip install requests beautifulsoup4
安全使用建议
Before installing, treat this as a Polymarket monitoring and paper-trading helper, not an automated trading system. Run it in a virtual environment, avoid real webhook tokens until logging is fixed, use only trusted simple paths, and manually verify any market opportunity before risking funds.
功能分析
Type: OpenClaw Skill Name: polymarket-arbitrage Version: 0.1.0 The skill is designed to monitor Polymarket for arbitrage opportunities, using web scraping and local data processing. It fetches data from polymarket.com, saves results to local files in `./polymarket_data/`, and orchestrates its scripts using `subprocess.run`. While `subprocess.run` with `shell=True` can be risky, the commands executed are fixed Python script paths with controlled arguments, not arbitrary user input. Crucially, the `send_alert` function in `scripts/monitor.py` explicitly notes a 'TODO' for webhook implementation and currently only prints that an alert *would* be sent, meaning no actual data exfiltration via webhook is performed. There is no evidence of intentional malicious behavior, prompt injection, or unauthorized access.
能力评估
Purpose & Capability
The artifacts are coherent for market scraping, arbitrage detection, local JSON output, and alerts, but the description overstates execution/automation compared with the code and docs, which emphasize manual trading and future automation.
Instruction Scope
The monitor script builds command strings from paths and executes them with shell=True, so a crafted data directory or unusual install path could cause unintended shell execution.
Install Mechanism
There is no install spec, but the quick start asks users to pip install unpinned requests and beautifulsoup4 packages; this is purpose-aligned but should be done in a virtual environment.
Credentials
Network access to polymarket.com and local writes under ./polymarket_data are disclosed and proportionate for monitoring; no wallet integration or trade execution is implemented.
Persistence & Privilege
Continuous monitoring is disclosed and stoppable, but optional webhook URLs may contain bot tokens and the code prints the full URL to stderr; alert state is also persisted locally.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install polymarket-arbitrage
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /polymarket-arbitrage 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of polymarket-arbitrage. - Detects and reports math arbitrage, cross-market inconsistencies, and orderbook inefficiencies on Polymarket. - Includes scripts for scanning markets, detecting arbitrage, and continuous monitoring with alerting. - Features built-in risk management, P&L tracking, stateful deduplication of alerts, and configurable thresholds. - Provides comprehensive documentation: setup, workflow phases (paper trading to automation), risk management, and troubleshooting. - Currently focuses on multi-outcome math arbitrage; cross-market and real-time orderbook arbitrage support outlined for future development.
元数据
Slug polymarket-arbitrage
版本 0.1.0
许可证
累计安装 30
当前安装数 27
历史版本数 1
常见问题

Polymarket Arbitrage 是什么?

Monitor and execute arbitrage opportunities on Polymarket prediction markets. Detects math arbitrage (multi-outcome probability mismatches), cross-market arbitrage (same event different prices), and orderbook inefficiencies. Use when user wants to find or trade Polymarket arbitrage, monitor prediction markets for opportunities, or implement automated trading strategies. Includes risk management, P&L tracking, and alerting. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 4410 次。

如何安装 Polymarket Arbitrage?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install polymarket-arbitrage」即可一键安装,无需额外配置。

Polymarket Arbitrage 是免费的吗?

是的,Polymarket Arbitrage 完全免费(开源免费),可自由下载、安装和使用。

Polymarket Arbitrage 支持哪些平台?

Polymarket Arbitrage 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Polymarket Arbitrage?

由 JohnY0920(@johny0920)开发并维护,当前版本 v0.1.0。

💬 留言讨论