polymarket
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePolymarket
Polymarket
Query Polymarket prediction markets and trade from the terminal.
在终端查询Polymarket预测市场并进行交易。
Setup
安装设置
Read-only commands work immediately (no install needed).
For trading, order books, and price history, install the Polymarket CLI:
bash
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | shFor trading, set up a wallet:
bash
python3 {baseDir}/scripts/polymarket.py wallet-setupOr manually configure with your private key. See the CLI docs for details.
~/.config/polymarket/config.json只读命令可直接使用(无需安装)。
如需使用交易、订单簿和价格历史功能,请安装Polymarket CLI:
bash
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh要进行交易,需要先设置钱包:
bash
python3 {baseDir}/scripts/polymarket.py wallet-setup或者手动在中配置你的私钥。详情请查看CLI文档。
~/.config/polymarket/config.jsonCommands
命令
Browse Markets (no CLI needed)
浏览市场(无需安装CLI)
bash
undefinedbash
undefinedTrending/active markets
热门/活跃市场
python3 {baseDir}/scripts/polymarket.py trending
python3 {baseDir}/scripts/polymarket.py trending
Search markets
搜索市场
python3 {baseDir}/scripts/polymarket.py search "trump"
python3 {baseDir}/scripts/polymarket.py search "trump"
Get specific event by slug
通过slug获取特定事件
python3 {baseDir}/scripts/polymarket.py event "fed-decision-in-october"
python3 {baseDir}/scripts/polymarket.py event "fed-decision-in-october"
Get markets by category
按分类获取市场
python3 {baseDir}/scripts/polymarket.py category politics
python3 {baseDir}/scripts/polymarket.py category crypto
undefinedpython3 {baseDir}/scripts/polymarket.py category politics
python3 {baseDir}/scripts/polymarket.py category crypto
undefinedOrder Book & Prices (CLI required, no wallet)
订单簿与价格(需要安装CLI,无需钱包)
bash
undefinedbash
undefinedOrder book for a token
某token的订单簿
python3 {baseDir}/scripts/polymarket.py book TOKEN_ID
python3 {baseDir}/scripts/polymarket.py book TOKEN_ID
Price history
价格历史
python3 {baseDir}/scripts/polymarket.py price-history TOKEN_ID --interval 1d
undefinedpython3 {baseDir}/scripts/polymarket.py price-history TOKEN_ID --interval 1d
undefinedWallet (CLI required)
钱包(需要安装CLI)
bash
python3 {baseDir}/scripts/polymarket.py wallet-setup
python3 {baseDir}/scripts/polymarket.py wallet-show
python3 {baseDir}/scripts/polymarket.py wallet-balance
python3 {baseDir}/scripts/polymarket.py wallet-balance --token TOKEN_IDbash
python3 {baseDir}/scripts/polymarket.py wallet-setup
python3 {baseDir}/scripts/polymarket.py wallet-show
python3 {baseDir}/scripts/polymarket.py wallet-balance
python3 {baseDir}/scripts/polymarket.py wallet-balance --token TOKEN_IDTrading (CLI + wallet required)
交易(需要安装CLI + 配置钱包)
All trades require to execute. Without it, the order is previewed only.
--confirmbash
undefined所有交易都需要添加参数才会执行,不加该参数仅会预览订单。
--confirmbash
undefinedBuy limit order: 10 shares at $0.50
限价买单:0.5美元价格买入10份
python3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --price 0.50 --size 10
python3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --price 0.50 --size 10
Sell limit order
限价卖单
python3 {baseDir}/scripts/polymarket.py --confirm trade sell --token TOKEN_ID --price 0.70 --size 10
python3 {baseDir}/scripts/polymarket.py --confirm trade sell --token TOKEN_ID --price 0.70 --size 10
Market order: buy $5 worth
市价单:买入价值5美元的份额
python3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --market-order --amount 5
undefinedpython3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --market-order --amount 5
undefinedOrders & Positions (CLI + wallet required)
订单与持仓(需要安装CLI + 配置钱包)
bash
undefinedbash
undefinedList open orders
列出未成交订单
python3 {baseDir}/scripts/polymarket.py orders
python3 {baseDir}/scripts/polymarket.py orders
Cancel a specific order
取消指定订单
python3 {baseDir}/scripts/polymarket.py --confirm orders --cancel ORDER_ID
python3 {baseDir}/scripts/polymarket.py --confirm orders --cancel ORDER_ID
Cancel all orders
取消所有订单
python3 {baseDir}/scripts/polymarket.py --confirm orders --cancel all
python3 {baseDir}/scripts/polymarket.py --confirm orders --cancel all
View positions
查看持仓
python3 {baseDir}/scripts/polymarket.py positions
python3 {baseDir}/scripts/polymarket.py positions --address 0xYOUR_WALLET
undefinedpython3 {baseDir}/scripts/polymarket.py positions
python3 {baseDir}/scripts/polymarket.py positions --address 0xYOUR_WALLET
undefinedExample Chat Usage
示例对话使用场景
- "What are the odds Trump wins 2028?"
- "Trending on Polymarket?"
- "Search Polymarket for Bitcoin"
- "Show me the order book for [token]"
- "Buy 10 shares of YES on [market] at $0.45"
- "What are my open positions?"
- "Cancel all my orders"
- "特朗普赢得2028年大选的赔率是多少?"
- "Polymarket上有什么热门内容?"
- "在Polymarket搜索比特币相关内容"
- "给我看[token]的订单簿"
- "以0.45美元的价格买入[市场]的YES选项10份"
- "我有哪些未平仓持仓?"
- "取消我所有的订单"
⚠️ Safety Notes
⚠️ 安全提示
- Real money. Trades execute on Polygon with real USDC. Double-check everything.
- All trades require . Without it, you get a preview only.
--confirm - The CLI is experimental. The Polymarket team warns: "Use at your own risk and do not use with large amounts of funds."
- Private key security. Your key is stored in . Keep it safe.
~/.config/polymarket/config.json - Gas fees. On-chain operations (approvals, splits, redeems) require MATIC for gas.
- 涉及真实资金:交易在Polygon链上执行,使用真实USDC,请再三确认所有操作。
- 所有交易都需要参数:不加该参数仅会生成预览。
--confirm - CLI处于实验阶段:Polymarket团队提示:“风险自担,请勿使用大额资金操作。”
- 私钥安全:你的私钥存储在中,请妥善保管。
~/.config/polymarket/config.json - Gas费:链上操作(授权、拆分、兑换)需要MATIC支付Gas费。
API
API
Read-only commands use the public Gamma API (no auth):
- Base URL:
https://gamma-api.polymarket.com
Trading commands wrap the official Polymarket CLI (Rust binary).