Polymarket Trading Skill
Trade prediction markets on Polymarket through the official polymarket CLI. Browse markets, place limit and market orders, manage positions, check rewards, and interact with conditional tokens — all from the terminal.
Installation
macOS / Linux (Homebrew)
CODEBLOCK0
Shell script
CODEBLOCK1
Build from source (Rust)
CODEBLOCK2
Wallet Setup
CODEBLOCK3
Configuration
Private key is resolved in order:
- 1. CLI flag: INLINECODE1
- Environment variable: INLINECODE2
- Config file: INLINECODE3
Signature types: proxy (default), eoa, gnosis-safe. Override with --signature-type.
Overview
You are an expert in using the polymarket CLI for prediction market trading. Your goal is to help users trade on Polymarket efficiently while emphasizing safety, position management, and risk awareness.
How to Use This Skill
- 1. Safety First: Start with small positions. Polymarket trades are real money on Polygon mainnet.
- Verify Before Trading: Always show the exact command and confirm with the user before executing trades.
- Check Prerequisites: Confirm wallet is set up, approvals are granted, and sufficient USDC balance exists.
- Use JSON Output: For scripting and automation, use
-o json for machine-readable output. - Understand Token IDs: Each market outcome (YES/NO) has a unique token ID. Get it from market details or order book commands.
When to Use This Skill
Use this skill when the user wants to:
- - Browse or search prediction markets
- Place bets (limit orders, market orders)
- Check market prices, spreads, and order books
- View or manage open orders
- Check portfolio positions and P/L
- Cancel orders
- Redeem winnings from resolved markets
- Check liquidity rewards and earnings
- Monitor market activity and leaderboards
- Hedge positions across markets
Common trigger phrases:
- - "What prediction markets are trending?"
- "Buy YES on Bitcoin above 100k"
- "Show me the order book"
- "What's the spread on this market?"
- "Cancel all my orders"
- "Check my positions"
- "How much have I earned in rewards?"
- "Place a limit order at 0.45"
- "Hedge my position"
When NOT to use this skill:
- - User wants to trade stocks/ETFs/options (use Alpaca trading skill)
- User wants financial advice (provide tools, not recommendations)
- User wants to use the Polymarket web UI
Core Commands
Market Discovery (No wallet needed)
List markets:
CODEBLOCK4
Get market details:
CODEBLOCK5
Search markets:
CODEBLOCK6
List events (groups of related markets):
CODEBLOCK7
Browse tags and categories:
CODEBLOCK8
Sports markets:
CODEBLOCK9
Order Book & Prices (No wallet needed)
Get prices:
CODEBLOCK10
Batch price queries:
CODEBLOCK11
Order book depth:
CODEBLOCK12
Price history:
CODEBLOCK13
Market metadata:
CODEBLOCK14
Trading (Requires wallet)
Place a limit order:
CODEBLOCK15
Place a market order:
CODEBLOCK16
Place multiple orders at once:
CODEBLOCK17
Order types: GTC (default), FOK, GTD, FAK. Add --post-only for maker-only limit orders.
Cancel orders:
CODEBLOCK18
View orders and trades:
CODEBLOCK19
Check balances:
CODEBLOCK20
Rewards & Earnings
CODEBLOCK21
Portfolio & On-Chain Data (Public, no wallet needed)
CODEBLOCK22
Conditional Token Operations (On-chain, needs MATIC)
CODEBLOCK23
Wallet Management
CODEBLOCK24
Contract Approvals
CODEBLOCK25
API Key Management
CODEBLOCK26
Notifications & Account Status
CODEBLOCK27
Bridge (Deposits)
CODEBLOCK28
Interactive Shell
CODEBLOCK29
Utility Commands
CODEBLOCK30
Output Formats
All commands support --output table (default) and --output json (or -o json).
CODEBLOCK31
Common Workflows
Research a market before trading
CODEBLOCK32
Place a limit order and monitor
CODEBLOCK33
Two-sided market making (reward farming)
CODEBLOCK34
Hedge a position
CODEBLOCK35
Redeem winnings after market resolves
CODEBLOCK36
Scripting with JSON output
CODEBLOCK37
Best Practices
Safety & Risk
- 1. Start small — Polymarket trades are real money on Polygon mainnet
- Use
--post-only — Maker orders have zero fees and earn rebates - Check fee rates — Use
polymarket clob fee-rate TOKEN_ID before trading - Verify token IDs — Each YES/NO outcome has a different token ID
- Keep MATIC for gas — On-chain operations (approve, split, merge, redeem) need MATIC
- Monitor positions — Use
polymarket data positions regularly
Order Management
- 1. Prefer limit orders — Better price control, zero maker fees
- Use
--post-only — Ensures your order is a maker order (no taker fees) - Batch when possible — Use
clob post-orders to place multiple orders at once - Cancel stale orders — Orders sitting far from mid are not earning rewards
- Check order scoring — Use
clob order-scoring to verify reward eligibility
Market Making
- 1. Two-sided orders earn ~3x rewards — Place on both YES and NO
- Stay close to midpoint — Rewards decay quadratically with distance from mid
- Low-competition markets — Larger share of the reward pool
- Monitor spread — Tighter spreads earn more rewards but increase fill risk
- Rebalance regularly — Cancel and replace orders as midpoint moves
Command Reference
| Task | Command |
|---|
| List markets | INLINECODE24 |
| Search markets |
polymarket markets search "query" |
| Get market details |
polymarket markets get SLUG_OR_ID |
| List events |
polymarket events list --limit 10 |
| Check price |
polymarket clob price TOKEN_ID --side buy |
| Check midpoint |
polymarket clob midpoint TOKEN_ID |
| Check spread |
polymarket clob spread TOKEN_ID |
| View order book |
polymarket clob book TOKEN_ID |
| Price history |
polymarket clob price-history TOKEN_ID --interval 1d |
| Place limit order |
polymarket clob create-order --token TOKEN_ID --side buy --price 0.50 --size 10 |
| Place market order |
polymarket clob market-order --token TOKEN_ID --side buy --amount 5 |
| Batch orders |
polymarket clob post-orders --tokens "T1,T2" --side buy --prices "0.4,0.6" --sizes "10,10" |
| View orders |
polymarket clob orders |
| Cancel order |
polymarket clob cancel ORDER_ID |
| Cancel all |
polymarket clob cancel-all |
| Check balance |
polymarket clob balance --asset-type collateral |
| View positions |
polymarket data positions 0xADDRESS |
| Check rewards |
polymarket clob current-rewards |
| Check earnings |
polymarket clob earnings --date 2026-03-01 |
| Split USDC to tokens |
polymarket ctf split --condition 0xCOND --amount 10 |
| Merge tokens to USDC |
polymarket ctf merge --condition 0xCOND --amount 10 |
| Redeem winnings |
polymarket ctf redeem --condition 0xCOND |
| Wallet info |
polymarket wallet show |
| Approve contracts |
polymarket approve set |
| API health |
polymarket clob ok |
| Geo-restriction check |
polymarket clob geoblock |
| Account status |
polymarket clob account-status |
| List API keys |
polymarket clob api-keys |
| CTF condition ID |
polymarket ctf condition-id --oracle 0xORA --question 0xQ --outcomes 2 |
| Interactive shell |
polymarket shell |
| Update CLI |
polymarket upgrade |
| Guided setup |
polymarket setup |
Important Notes
- - Token IDs are long numeric strings (e.g.,
48331043336612883...). Get them from market details or order book. - Condition IDs are hex strings (e.g.,
0xABC...). Used for on-chain operations and market-level queries. - USDC is the settlement currency. All amounts are in USDC.
- MATIC is needed for gas on Polygon for on-chain operations (approve, split, merge, redeem).
- Maker orders (limit orders with
--post-only) have zero fees and earn daily rebates. - Taker orders pay fees up to ~1.56% at 50/50 odds.
- Rewards are distributed daily at midnight UTC. Two-sided orders earn ~3x single-sided.
Troubleshooting
Wallet not configured
CODEBLOCK38
Approvals not set
CODEBLOCK39
Insufficient balance
CODEBLOCK40
Order rejected
- - Check balance: INLINECODE59
- Verify token ID is correct
- Check fee rate: INLINECODE60
- Ensure approvals are set: INLINECODE61
Command not found
CODEBLOCK41
Additional Resources
- - Polymarket CLI: https://github.com/Polymarket/polymarket-cli
- Polymarket Docs: https://docs.polymarket.com/
- CLOB API Docs: https://docs.polymarket.com/developers/
- Liquidity Rewards: https://docs.polymarket.com/developers/market-makers/liquidity-rewards
- Maker Rebates: https://docs.polymarket.com/developers/market-makers/maker-rebates-program
Polymarket 交易技能
通过官方 polymarket CLI 在 Polymarket 上交易预测市场。浏览市场、下达限价单和市价单、管理仓位、查看奖励以及与条件代币交互——全部在终端中完成。
安装
macOS / Linux (Homebrew)
bash
brew tap Polymarket/polymarket-cli https://github.com/Polymarket/polymarket-cli
brew install polymarket
Shell 脚本
bash
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh
从源码构建 (Rust)
bash
git clone https://github.com/Polymarket/polymarket-cli
cd polymarket-cli
cargo install --path .
钱包设置
bash
引导式首次设置
polymarket setup
或手动设置:
polymarket wallet create
polymarket approve set # 在 Polygon 上需要 MATIC 作为 gas
配置
私钥按以下顺序解析:
- 1. CLI 标志:--private-key 0xabc...
- 环境变量:POLYMARKETPRIVATEKEY=0xabc...
- 配置文件:~/.config/polymarket/config.json
签名类型:proxy(默认)、eoa、gnosis-safe。使用 --signature-type 覆盖。
概述
您是使用 polymarket CLI 进行预测市场交易的专家。您的目标是在强调安全、仓位管理和风险意识的前提下,帮助用户在 Polymarket 上高效交易。
如何使用此技能
- 1. 安全第一:从小仓位开始。Polymarket 交易是在 Polygon 主网上使用真实资金。
- 交易前验证:始终显示确切的命令,并在执行交易前与用户确认。
- 检查先决条件:确认钱包已设置、已授权且有足够的 USDC 余额。
- 使用 JSON 输出:对于脚本编写和自动化,使用 -o json 获取机器可读的输出。
- 理解代币 ID:每个市场结果(是/否)都有唯一的代币 ID。从市场详情或订单簿命令中获取。
何时使用此技能
当用户想要以下操作时使用此技能:
- - 浏览或搜索预测市场
- 下注(限价单、市价单)
- 查看市场价格、价差和订单簿
- 查看或管理未成交订单
- 查看投资组合仓位和盈亏
- 取消订单
- 从已结算市场赎回收益
- 查看流动性奖励和收益
- 监控市场活动和排行榜
- 跨市场对冲仓位
常见触发短语:
- - 哪些预测市场正在热门?
- 买入比特币超过 10 万的 YES
- 显示订单簿
- 这个市场的价差是多少?
- 取消我所有的订单
- 查看我的仓位
- 我赚了多少奖励?
- 以 0.45 的价格下限价单
- 对冲我的仓位
何时不使用此技能:
- - 用户想要交易股票/ETF/期权(使用 Alpaca 交易技能)
- 用户想要财务建议(提供工具,而非建议)
- 用户想要使用 Polymarket 网页界面
核心命令
市场发现(无需钱包)
列出市场:
bash
polymarket markets list --limit 10
polymarket markets list --active true --order volume_num
polymarket markets list --closed false --limit 50 --offset 25
获取市场详情:
bash
polymarket markets get 12345
polymarket markets get will-trump-win # 按 slug
搜索市场:
bash
polymarket markets search bitcoin --limit 5
列出事件(相关市场组):
bash
polymarket events list --limit 10
polymarket events list --tag politics --active true
polymarket events get 500
浏览标签和分类:
bash
polymarket tags list
polymarket tags get politics
polymarket tags related politics
体育市场:
bash
polymarket sports list
polymarket sports market-types
polymarket sports teams --league NFL --limit 32
订单簿与价格(无需钱包)
获取价格:
bash
polymarket clob price TOKEN_ID --side buy
polymarket clob midpoint TOKEN_ID
polymarket clob spread TOKEN_ID
批量价格查询:
bash
polymarket clob batch-prices TOKEN1,TOKEN2 --side buy
polymarket clob midpoints TOKEN1,TOKEN2
polymarket clob spreads TOKEN1,TOKEN2
订单簿深度:
bash
polymarket clob book TOKEN_ID
polymarket clob books TOKEN1,TOKEN2
价格历史:
bash
polymarket clob price-history TOKEN_ID --interval 1d --fidelity 30
时间间隔:1m, 1h, 6h, 1d, 1w, max
市场元数据:
bash
polymarket clob tick-size TOKEN_ID
polymarket clob fee-rate TOKEN_ID
polymarket clob neg-risk TOKEN_ID
polymarket clob last-trade TOKEN_ID
polymarket clob time
polymarket clob ok # API 健康检查
polymarket clob geoblock # 检查是否受地域限制
交易(需要钱包)
下达限价单:
bash
polymarket clob create-order \
--token TOKEN_ID \
--side buy --price 0.50 --size 10
下达市价单:
bash
polymarket clob market-order \
--token TOKEN_ID \
--side buy --amount 5
一次下达多个订单:
bash
polymarket clob post-orders \
--tokens TOKEN1,TOKEN2 \
--side buy \
--prices 0.40,0.60 \
--sizes 10,10
订单类型:GTC(默认)、FOK、GTD、FAK。添加 --post-only 用于仅做市商的限价单。
取消订单:
bash
polymarket clob cancel ORDER_ID
polymarket clob cancel-orders ORDER1,ORDER2
polymarket clob cancel-market --market 0xCONDITION_ID
polymarket clob cancel-all
查看订单和交易:
bash
polymarket clob orders
polymarket clob orders --market 0xCONDITION_ID
polymarket clob order ORDER_ID
polymarket clob trades
检查余额:
bash
polymarket clob balance --asset-type collateral
polymarket clob balance --asset-type conditional --token TOKEN_ID
polymarket clob update-balance --asset-type collateral
奖励与收益
bash
polymarket clob rewards --date 2026-03-01
polymarket clob earnings --date 2026-03-01
polymarket clob earnings-markets --date 2026-03-01
polymarket clob reward-percentages
polymarket clob current-rewards
polymarket clob market-reward 0xCONDITION_ID
检查订单是否获得奖励积分
polymarket clob order-scoring ORDER_ID
polymarket clob orders-scoring ORDER1,ORDER2
投资组合与链上数据(公开,无需钱包)
bash
polymarket data positions 0xWALLET_ADDRESS
polymarket data closed-positions 0xWALLET_ADDRESS
polymarket data value 0xWALLET_ADDRESS
polymarket data traded 0xWALLET_ADDRESS
polymarket data trades 0xWALLET_ADDRESS --limit 50
polymarket data activity 0xWALLET_ADDRESS
市场分析
polymarket data holders 0xCONDITION_ID
polymarket data open-interest 0xCONDITION_ID
polymarket data volume 12345 # 事件 ID
排行榜
polymarket data leaderboard --period month --order-by pnl --limit 10
条件代币操作(链上,需要 MATIC)
bash
将 10 USDC 拆分为 YES/NO 代币
polymarket ctf split --condition 0xCONDITION_ID --amount 10
将 YES/NO 代币合并回 USDC
polymarket ctf merge --condition 0xCONDITION_ID --amount 10
#