重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
polyclaw by chainstacklabs/polyclaw
npx skills add https://github.com/chainstacklabs/polyclaw --skill polyclaw适用于 OpenClaw 的、支持交易的 Polymarket 技能。浏览市场、管理钱包、执行交易并跟踪持仓。
首先,安装依赖项(在技能目录下):
cd {baseDir}
uv sync
在首次交易前,设置 Polymarket 合约授权(一次性操作,消耗约 0.01 POL 的 gas):
uv run python scripts/polyclaw.py wallet approve
这将向 Polygon 提交 6 笔授权交易。每个钱包只需执行一次。
# 按交易量查看热门市场
uv run python scripts/polyclaw.py markets trending
# 搜索市场
uv run python scripts/polyclaw.py markets search "election"
# 市场详情(返回包含所有字段的完整 JSON)
uv run python scripts/polyclaw.py market <market_id>
输出选项:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--full 标志获取未经截断的完整问题文本scripts/markets.py --json trending 使用 --json 标志获取结构化 JSON 输出# 检查钱包状态(地址、余额)
uv run python scripts/polyclaw.py wallet status
# 设置合约授权(一次性)
uv run python scripts/polyclaw.py wallet approve
钱包通过 POLYCLAW_PRIVATE_KEY 环境变量配置。
# 以 50 美元买入 YES 仓位
uv run python scripts/polyclaw.py buy <market_id> YES 50
# 以 25 美元买入 NO 仓位
uv run python scripts/polyclaw.py buy <market_id> NO 25
# 列出所有持仓及其盈亏
uv run python scripts/polyclaw.py positions
发现覆盖投资组合——通过逆否逻辑相互对冲的一对市场仓位。
# 扫描热门市场以寻找对冲机会
uv run python scripts/polyclaw.py hedge scan
# 扫描匹配查询的市场
uv run python scripts/polyclaw.py hedge scan --query "election"
# 分析特定市场之间的对冲关系
uv run python scripts/polyclaw.py hedge analyze <market_id_1> <market_id_2>
输出选项:
--json 标志获取结构化 JSON 输出--min-coverage 0.90 按最小覆盖率过滤(默认 0.85)--tier 1 按层级过滤(1=最佳,默认 2)覆盖率层级:
LLM 模型: 通过 OpenRouter 使用 nvidia/nemotron-nano-9b-v2:free。模型选择很重要——有些模型会发现虚假相关性,而其他模型(如 DeepSeek R1)存在输出格式问题。如有需要,可使用 --model <model_id> 覆盖。
对于 MVP 版本,为简化操作和兼容 Claude Code,私钥存储在环境变量中。
安全警告: 请仅在此钱包中保留少量资金。定期将资金提取到安全的钱包中。
| 变量 | 必需 | 描述 |
|---|---|---|
CHAINSTACK_NODE | 是(交易) | Polygon RPC URL |
OPENROUTER_API_KEY | 是(对冲) | 用于 LLM 对冲发现的 OpenRouter API 密钥 |
POLYCLAW_PRIVATE_KEY | 是(交易) | EVM 私钥(十六进制,带或不带 0x 前缀) |
HTTPS_PROXY | 推荐 | 用于 CLOB 的轮换住宅代理(例如 IPRoyal) |
CLOB_MAX_RETRIES | 否 | CLOB 配合 IP 轮换的最大重试次数(默认:5) |
安全警告: 请仅在此钱包中保留少量资金。定期将资金提取到安全的钱包中。将私钥存储在环境变量中便于自动化,但安全性不如加密存储。
示例:以 0.70 美元买入 YES
0x2791Bca1f2de4661ED88A30C99A7a9449Aa841740x4D97DCd97eC945f40cF65F87097ACe5EA04760450x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E使用 uv 安装(在技能目录下):
cd {baseDir}
uv sync
Polymarket 的 CLOB API 使用 Cloudflare 保护,会阻止来自许多 IP 的 POST 请求,包括数据中心 IP 和一些住宅 ISP。这会影响“卖出不需要的代币”步骤。
解决方案:使用具有重试逻辑的住宅代理
推荐设置使用轮换住宅代理(例如 IPRoyal, BrightData)。CLOB 客户端会自动使用新 IP 重试,直到成功:
export HTTPS_PROXY="http://user:pass@geo.iproyal.com:12321"
export CLOB_MAX_RETRIES=10 # 默认为 5
通过此设置,CLOB 订单通常在 5-10 次重试内成功,因为代理会轮换 IP 直到找到一个未被屏蔽的。
替代解决方案:
--skip-sell — 保留 YES 和 NO 代币,在 polymarket.com 上手动卖出如果 CLOB 在所有重试后失败,您的拆分仍然成功了。输出会告诉您需要手动卖出多少代币。
设置 POLYCLAW_PRIVATE_KEY 环境变量:
export POLYCLAW_PRIVATE_KEY="0x..."
使用 uv run python scripts/polyclaw.py wallet status 检查余额。您需要在 Polygon 上有 USDC.e(桥接的 USDC)。
CLOB 卖出可能因以下原因失败:
您的拆分仍然成功了——您已经拥有代币,只是无法卖出不需要的一侧。
首次交易需要合约授权。运行:
uv run python scripts/polyclaw.py wallet approve
Apache 2.0
每周安装数
68
代码仓库
GitHub 星标数
260
首次出现
2026年2月6日
安全审计
安装于
gemini-cli65
codex62
opencode62
openclaw61
github-copilot61
kimi-cli61
Trading-enabled Polymarket skill for OpenClaw. Browse markets, manage wallets, execute trades, and track positions.
First, install dependencies (from skill directory):
cd {baseDir}
uv sync
Before your first trade, set Polymarket contract approvals (one-time, costs ~0.01 POL in gas):
uv run python scripts/polyclaw.py wallet approve
This submits 6 approval transactions to Polygon. You only need to do this once per wallet.
# Trending markets by volume
uv run python scripts/polyclaw.py markets trending
# Search markets
uv run python scripts/polyclaw.py markets search "election"
# Market details (returns full JSON with all fields)
uv run python scripts/polyclaw.py market <market_id>
Output options:
--full flag for full question text without truncation--json flag via scripts/markets.py --json trending for structured JSON output# Check wallet status (address, balances)
uv run python scripts/polyclaw.py wallet status
# Set contract approvals (one-time)
uv run python scripts/polyclaw.py wallet approve
The wallet is configured via the POLYCLAW_PRIVATE_KEY environment variable.
# Buy YES position for $50
uv run python scripts/polyclaw.py buy <market_id> YES 50
# Buy NO position for $25
uv run python scripts/polyclaw.py buy <market_id> NO 25
# List all positions with P&L
uv run python scripts/polyclaw.py positions
Find covering portfolios - pairs of market positions that hedge each other via contrapositive logic.
# Scan trending markets for hedges
uv run python scripts/polyclaw.py hedge scan
# Scan markets matching a query
uv run python scripts/polyclaw.py hedge scan --query "election"
# Analyze specific markets for hedging relationship
uv run python scripts/polyclaw.py hedge analyze <market_id_1> <market_id_2>
Output options:
--json flag for structured JSON output--min-coverage 0.90 to filter by minimum coverage (default 0.85)--tier 1 to filter by tier (1=best, default 2)Coverage tiers:
LLM model: Uses nvidia/nemotron-nano-9b-v2:free via OpenRouter. Model selection matters — some models find spurious correlations while others (like DeepSeek R1) have output format issues. Override with --model <model_id> if needed.
For the MVP, the private key is stored in an environment variable for simplicity and Claude Code compatibility.
Security Warning: Keep only small amounts in this wallet. Withdraw regularly to a secure wallet.
| Variable | Required | Description |
|---|---|---|
CHAINSTACK_NODE | Yes (trading) | Polygon RPC URL |
OPENROUTER_API_KEY | Yes (hedge) | OpenRouter API key for LLM hedge discovery |
POLYCLAW_PRIVATE_KEY | Yes (trading) | EVM private key (hex, with or without 0x prefix) |
HTTPS_PROXY | Recommended | Rotating residential proxy for CLOB (e.g., IPRoyal) |
CLOB_MAX_RETRIES |
Security Warning: Keep only small amounts in this wallet. Withdraw regularly to a secure wallet. The private key in an env var is convenient for automation but less secure than encrypted storage.
Example: Buy YES at $0.70
0x2791Bca1f2de4661ED88A30C99A7a9449Aa841740x4D97DCd97eC945f40cF65F87097ACe5EA04760450x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982EInstall with uv (from skill directory):
cd {baseDir}
uv sync
Polymarket's CLOB API uses Cloudflare protection that blocks POST requests from many IPs, including datacenter IPs and some residential ISPs. This affects the "sell unwanted tokens" step.
Solution: Residential proxy with retry logic
The recommended setup uses a rotating residential proxy (e.g., IPRoyal, BrightData). The CLOB client automatically retries with new IPs until one works:
export HTTPS_PROXY="http://user:pass@geo.iproyal.com:12321"
export CLOB_MAX_RETRIES=10 # Default is 5
With this setup, CLOB orders typically succeed within 5-10 retries as the proxy rotates through IPs until finding an unblocked one.
Alternative workarounds:
--skip-sell — Keep both YES and NO tokens, sell manually on polymarket.comIf CLOB fails after all retries, your split still succeeded. The output tells you how many tokens to sell manually.
Set the POLYCLAW_PRIVATE_KEY environment variable:
export POLYCLAW_PRIVATE_KEY="0x..."
Check balance with uv run python scripts/polyclaw.py wallet status. You need USDC.e (bridged USDC) on Polygon.
The CLOB sell may fail due to:
Your split still succeeded - you have the tokens, just couldn't sell unwanted side.
First trade requires contract approvals. Run:
uv run python scripts/polyclaw.py wallet approve
Apache 2.0
Weekly Installs
68
Repository
GitHub Stars
260
First Seen
Feb 6, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli65
codex62
opencode62
openclaw61
github-copilot61
kimi-cli61
CoinGecko API 集成 - 实时加密货币价格、市场数据与区块链分析工具
4,100 周安装
| No |
| Max CLOB retries with IP rotation (default: 5) |