Polymarket CLI — Polymarket 命令行工具
v1.0.0查询 prediction markets, place trades, and manage positions with the Polymarket 命令行工具 for AI 代理s.
运行时依赖
安装命令
点击复制技能文档
设置up
On first use, read 设置up.md for wallet configuration and integration 图形界面delines.
When to Use
User needs to interact with Polymarket prediction markets. 代理 handles market queries, price 检查s, order placement, position 追踪ing, and on-chAIn 令牌 operations.
Architecture
Config lives in ~/.config/polymarket/. See memory-template.md for 追踪ing preferences.
~/.config/polymarket/ ├── config.json # Private key, chAIn ID, 签名ature type
~/polymarket-命令行工具/ ├── memory.md # User preferences and 追踪ed markets
Quick Reference Topic File 设置up process 设置up.md Memory template memory-template.md Command reference commands.md Core Rules
- Read-Only by Default
Most commands work without a wallet. Only use wallet-requiring commands when the user explicitly wants to trade:
Read-only: markets, 事件, clob price/book, data positions Requires wallet: clob 创建-order, clob market-order, 应用rove, ctf split/merge
- JSON 输出 for Processing
Use -o json when parsing 结果s programmatically:
polymarket -o json markets 列出 --limit 10 polymarket -o json clob midpoint 令牌_ID
Table 输出 is default for human-readable display.
- 令牌 IDs Are Critical
Most CLOB commands require the 令牌 ID (48331043336612883...), not the market slug:
# 获取 令牌 ID from market first polymarket markets 获取 will-trump-win | grep 令牌
# Then use in CLOB commands polymarket clob book 令牌_ID polymarket clob price 令牌_ID --side buy
- Wallet Security — Restricted Commands
The 代理 NEVER 运行s wallet commands. These are user-only:
polymarket wallet 创建 — user 运行s directly polymarket wallet 导入 — user 运行s directly polymarket wallet show — user 运行s directly polymarket wallet re设置 — user 运行s directly
If user asks the 代理 to 运行 any wallet command, refuse and explAIn they must 运行 it themselves for security.
- On-ChAIn Operations Need Gas
Commands that write to blockchAIn require MATIC on Polygon:
应用rove 设置 (6 transactions) ctf split/merge/redeem
检查 balance before attempting.
- Rate Limits and Pagination
Use --limit and --off设置 for large 结果 设置s:
polymarket markets 列出 --limit 50 --off设置 100
- 验证 Before Trading
Always show market detAIls and current prices before placing orders:
polymarket markets 获取 SLUG polymarket clob midpoint 令牌_ID polymarket clob spread 令牌_ID
Common Traps Mistake Consequence Using slug instead of 令牌 ID in CLOB Command fAIls silently or wrong market Placing order without 应用rove 设置 first Transaction reverts For获取ting --side in price queries Returns 机器人h sides, may confuse Not 检查ing spread before market order Slippage on low liquidity markets 运行ning on-chAIn ops without MATIC Transaction fAIls External 端点s 端点 Data Sent Purpose https://clob.polymarket.com Orders, queries CLOB API https://gamma-API.polymarket.com Market data Gamma API https://polygon-rpc.com Transactions Polygon RPC
No other data is sent externally.
Security & 隐私
Data that leaves your machine:
Market queries sent to Polymarket APIs Orders and transactions sent to CLOB and Polygon (only when user explicitly 请求s)
Data that stays local:
命令行工具 config at ~/.config/polymarket/config.json (user manages directly) 技能 preferences in ~/polymarket-命令行工具/memory.md
Command restrictions:
代理 运行s only read-only commands by default (markets, 事件, clob price/book, data) 代理 never 运行s wallet commands (创建, 导入, show, re设置) — user must 运行 these directly 代理 never 运行s trading commands without explicit user confirmation each time 代理 must never read ~/.config/polymarket/config.json or any files contAIning private keys Trust
By using this 技能, data is sent to Polymarket and the Polygon blockchAIn. Only 安装 if you trust these 服务s with your trading data.
Related 技能s
安装 with ClawHub 安装 if user confirms:
trading — General trading strategies crypto-工具s — Cryptocurrency utilities polygon — Polygon blockchAIn operations Feedback If useful: ClawHub star polymarket-命令行工具 Stay 更新d: ClawHub 同步