360 Secure SkillHub
360 安全技能中心

Polymarket

这是Polymarket预测市场的终端操作工具,分两类功能:只读功能无需额外安装,可查询趋势市场、搜索特定主题事件、按分类/ID查看市场详情;交易类功能需安装Polymarket CLI并配置钱包,支持挂单、市价交易、查看订单簿/价格历史、管理订单与仓位。典型场景包括终端快速了解热门预测事件、搜索特定主题市场,或进行实盘USDC交易。输入为终端命令,输出为结构化数据或交易反馈,交易需--confirm确认,涉及真实资金请注意风险。

mvanhorn
mvanhorn
热度 99.61
最近更新 2026-05-17 11:03:01
分类:生活依赖:代码执行 / 第三方 API / 读写文件应用场景:个人理财 / 财务 / 市场分析

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add polymarket
Metadata
name
polymarket
version
1.1.0
description
Query and trade on Polymarket prediction markets — check odds, trending markets, search events, view order books, place trades, and manage positions. Now available to US developers.
author
mvanhorn
license
MIT
repository
https://github.com/mvanhorn/clawdbot-skill-polymarket
homepage
https://polymarket.com
metadata
{"openclaw":{"emoji":"📊","tags":["prediction-markets","polymarket","trading","odds","betting"]}}

Polymarket

Query Polymarket prediction markets and trade from the terminal.

Setup

Read-only commands work immediately (no install needed).

For trading, order books, and price history, install the Polymarket CLI:

curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh

For trading, set up a wallet:

python3 {baseDir}/scripts/polymarket.py wallet-setup

Or manually configure ~/.config/polymarket/config.json with your private key. See the CLI docs for details.

Commands

Browse Markets (no CLI needed)

# Trending/active markets
python3 {baseDir}/scripts/polymarket.py trending

# Search markets
python3 {baseDir}/scripts/polymarket.py search "trump"

# Get specific event by slug
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

Order Book & Prices (CLI required, no wallet)

# Order book for a token
python3 {baseDir}/scripts/polymarket.py book TOKEN_ID

# Price history
python3 {baseDir}/scripts/polymarket.py price-history TOKEN_ID --interval 1d

Wallet (CLI required)

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)

All trades require --confirm to execute. Without it, the order is previewed only.

# Buy limit order: 10 shares at $0.50
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

# Market order: buy $5 worth
python3 {baseDir}/scripts/polymarket.py --confirm trade buy --token TOKEN_ID --market-order --amount 5

Orders & Positions (CLI + wallet required)

# List open orders
python3 {baseDir}/scripts/polymarket.py orders

# Cancel a specific order
python3 {baseDir}/scripts/polymarket.py --confirm orders --cancel ORDER_ID

# Cancel all orders
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

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"

⚠️ 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.

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).