polymarket

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Polymarket

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 | sh
For trading, set up a wallet:
bash
python3 {baseDir}/scripts/polymarket.py wallet-setup
Or manually configure
~/.config/polymarket/config.json
with your private key. See the CLI docs for details.
只读命令可直接使用(无需安装)。
如需使用交易、订单簿和价格历史功能,请安装Polymarket CLI
bash
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh
要进行交易,需要先设置钱包:
bash
python3 {baseDir}/scripts/polymarket.py wallet-setup
或者手动在
~/.config/polymarket/config.json
中配置你的私钥。详情请查看CLI文档

Commands

命令

Browse Markets (no CLI needed)

浏览市场(无需安装CLI)

bash
undefined
bash
undefined

Trending/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
undefined
python3 {baseDir}/scripts/polymarket.py category politics python3 {baseDir}/scripts/polymarket.py category crypto
undefined

Order Book & Prices (CLI required, no wallet)

订单簿与价格(需要安装CLI,无需钱包)

bash
undefined
bash
undefined

Order 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
undefined
python3 {baseDir}/scripts/polymarket.py price-history TOKEN_ID --interval 1d
undefined

Wallet (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_ID
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_ID

Trading (CLI + wallet required)

交易(需要安装CLI + 配置钱包)

All trades require
--confirm
to execute. Without it, the order is previewed only.
bash
undefined
所有交易都需要添加
--confirm
参数才会执行,不加该参数仅会预览订单。
bash
undefined

Buy 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
undefined
python3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --market-order --amount 5
undefined

Orders & Positions (CLI + wallet required)

订单与持仓(需要安装CLI + 配置钱包)

bash
undefined
bash
undefined

List 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
undefined
python3 {baseDir}/scripts/polymarket.py positions python3 {baseDir}/scripts/polymarket.py positions --address 0xYOUR_WALLET
undefined

Example 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
    --confirm
    .
    Without it, you get a preview only.
  • 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
    ~/.config/polymarket/config.json
    . Keep it safe.
  • 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).
只读命令使用公共Gamma API(无需鉴权):
  • 基础URL:
    https://gamma-api.polymarket.com
交易命令封装了官方Polymarket CLI(Rust二进制文件)。