Polymarket Command Center
Real-time prediction market data for OpenClaw — no API key required.
Commands
trending
Get top 10 active markets by trading volume across Polymarket.
CODEBLOCK0
Examples:
- -
trending — all markets - INLINECODE1 — political prediction markets
- INLINECODE2 — cryptocurrency markets
- INLINECODE3 — sports betting markets
Output:
- - Market question (truncated to 65 chars)
- Primary outcome probability (Yes/No split)
- 24h volume
- Days until market closes
- Market slug (for detailed lookups)
Categories: Gamma API supports any tag in Polymarket's taxonomy. Common: politics, crypto, sports, elections, entertainment, economics.
odds [slug]
Get detailed odds for a specific market by slug or search term.
CODEBLOCK1
Examples:
- -
odds will-trump-win-2024 — exact slug match - INLINECODE11 — search for markets containing "bitcoin"
- INLINECODE12 — multi-term search
Output:
- - Full market question
- Outcome probabilities with visual bar chart (█ filled, ░ empty)
- 24h trading volume
- Market liquidity
- Close date (absolute + days remaining)
- Market description (truncated to 200 chars)
- Live CLOB midpoint (if available)
- Direct link to Polymarket web interface
Search behavior: If exact slug fails, performs client-side text search across market questions, slugs, and descriptions.
search [query]
Search across 100 active markets by text. Client-side filtering for instant results.
CODEBLOCK2
Examples:
- -
search bitcoin — single term - INLINECODE14 — all terms must match
- INLINECODE15 — multi-word search
- INLINECODE16 — phrase search
Output:
- - Up to 8 matching markets
- Question, yes probability, volume, slug for each
Search logic: All query terms must appear in the market question, slug, or description (case-insensitive). Searches are cached for 2 minutes.
watchlist
Check odds on your configured watchlist markets.
CODEBLOCK3
Output:
- - Current odds for each market on your watchlist
- Volume, close date for each
Configuration: Add market slugs to ~/.openclaw/state/polymarket_watchlist.json:
CODEBLOCK4
Or via ~/.openclaw/config.yaml:
CODEBLOCK5
Data Source & Architecture
No API Key Required
Polymarket Command Center uses only public APIs:
- - Gamma API (
https://gamma-api.polymarket.com) — Market metadata, outcomes, pricing - CLOB API (
https://clob.polymarket.com) — Live bid/ask midpoints
Zero authentication. Zero credentials. Pure HTTP.
Thread-Safe Caching
In-memory cache with automatic eviction:
- - TTL: 120 seconds default (180s for trending, 120s for search)
- Max entries: 100 (LRU eviction when full)
- Thread-safe: Reentrant locks for concurrent requests
- Smart invalidation: Expired entries auto-deleted on next access
CLOB Midpoints
The "Live midpoint" shown in odds details comes from CLOB (Central Limit Order Book) — Polymarket's on-chain order book. This represents the true real-time bid/ask spread. Falls back gracefully if CLOB data is unavailable.
Output Formats
Trending Markets
CODEBLOCK6
Detailed Odds
CODEBLOCK7
Search Results
CODEBLOCK8
Watchlist
👀 Polymarket Watchlist
🔮 Will Trump win the 2024 US Presidential Election?
Yes: 68% | Vol: $18.5M
🔮 Will Bitcoin reach $100K by end of 2026?
Yes: 72% | Vol: $2.5M
🔮 Will Fed cut rates in March 2026?
Yes: 64% | Vol: $3.1M
Response Codes
| Status | Meaning | Action |
|---|
| ❌ | Network error | Retry in a minute; check internet connection |
| 🔮 |
Success | Market data loaded and formatted |
| 👀 | Watchlist | Your configured markets |
| 🔍 | Search | Client-side filtered results |
| 💡 | Tip | Suggested next action |
Cache Behavior
- - First call: Hits Polymarket API, caches result
- Repeated calls (within TTL): Returns cached data instantly
- Stale data (past TTL): Cache evicted, fresh API call triggered
- Bounded memory: Max 100 entries; oldest evicted when full
- Thread-safe: Safe for concurrent requests (e.g., morning brief + user query)
Example timeline:
14:30:00 - User: "trending"
→ API call → cache set (expires 14:32:00)
→ response with 10 markets
14:30:45 - User: "trending"
→ cache hit (28s old)
→ instant response (same data)
14:32:15 - User: "trending"
→ cache miss (expired 15s ago)
→ API call → cache set (expires 14:34:15)
→ response with fresh data
Configuration (Optional)
All commands work without any configuration. Optional settings in ~/.openclaw/config.yaml:
CODEBLOCK11
No config needed — defaults work for all commands.
Supported Market Categories
Gamma API returns markets tagged with these common categories:
- -
politics — Elections, political outcomes - INLINECODE23 — Bitcoin, Ethereum, altcoins, blockchain
- INLINECODE24 — NFL, NBA, Premier League, Olympic Games
- INLINECODE25 — Movies, award shows, celebrity news
- INLINECODE26 — Fed rates, inflation, jobs data
- INLINECODE27 — Extreme weather events
- INLINECODE28 — Space, breakthrough discoveries
- INLINECODE29 — Tech IPOs, M&A, earnings
Custom tags may appear; Gamma API returns whatever is configured.
Implementation Details
HTTP Client
- - User-Agent: INLINECODE30
- Timeout: 10 seconds per request
- Accept: INLINECODE31
- No cookies; stateless requests
Error Handling
- - Network timeouts → graceful "couldn't reach Polymarket"
- Malformed JSON → ignored, fallback to empty results
- Unicode decode errors → handled silently
Outcome Parsing
Polymarket API returns outcomes and prices as JSON-stringified arrays. Command Center auto-detects format (string vs. array) and parses both.
Binary markets: ["Yes", "No"] outcomes with INLINECODE33
Categorical markets: ["Trump", "Harris", "RFK Jr"] with corresponding prices.
OpenClaw Ecosystem Integration
Read-only Polymarket data layer for the Prediction Market Trading Stack.
| Connected Skill | How It Connects |
|---|
| Market Morning Brief | Polymarket trending data appears in your daily brief |
| Prediction Market Arbiter |
Polymarket prices compared against Kalshi for divergences |
|
Xpulse | Social signals correlated with Polymarket movements |
Install the complete stack:
clawhub install kalshalyst kalshi-command-center polymarket-command-center prediction-market-arbiter xpulse portfolio-drift-monitor market-morning-brief personality-engine
Example Workflows
Monitor Crypto Market Sentiment
CODEBLOCK13
Track Election Predictions
CODEBLOCK14
Find Hidden Opportunities
1. trending # All markets
2. search [niche term] # Find underexplored markets
3. odds [slug] # Check volumes and liquidity
4. Compare CLOB midpoint vs. displayed probability
Limitations & Notes
- - Read-only: No trading, no account creation
- Public data only: No private market insights
- Gamma API limits: ~100 markets per request (used in search)
- CLOB midpoints: May be unavailable for some markets (graceful fallback)
- Pricing: Outcomes always shown as decimal probabilities (0.68 = 68%)
- Closed markets: Excluded from trending/search; archived on Polymarket
Troubleshooting
| Issue | Solution |
|---|
| "Couldn't reach Polymarket" | Retry in 1 minute; check internet |
| "No markets found for..." |
Try broader search term; check spelling |
| "No watchlist configured" | Add watchlist to config.yaml or create ~/.openclaw/state/polymarket_watchlist.json |
| Cached data looks stale | Cache TTL is 2 minutes; wait or restart service |
| CLOB midpoint missing | Market may not have CLOB tokens yet (new markets) |
Version History
v1.0.0 (2026-03-09)
- - Initial release
- Commands: trending, odds, search, watchlist
- Thread-safe caching with 120s TTL
- CLOB midpoint integration
- Zero API key required
- 100% read-only (no trading)
Feedback & Issues
Found a bug? Have a feature request? Want to share results?
Part of the OpenClaw Prediction Stack — the first prediction market skill suite on ClawHub.
Polymarket 指挥中心
OpenClaw 的实时预测市场数据 — 无需 API 密钥。
命令
trending
按交易量获取 Polymarket 上排名前 10 的活跃市场。
trending
trending [类别]
示例:
- - trending — 所有市场
- trending politics — 政治预测市场
- trending crypto — 加密货币市场
- trending sports — 体育博彩市场
输出:
- - 市场问题(截断至 65 个字符)
- 主要结果概率(是/否比例)
- 24 小时交易量
- 距离市场关闭的天数
- 市场标识(用于详细查询)
类别: Gamma API 支持 Polymarket 分类体系中的任何标签。常见类别:politics、crypto、sports、elections、entertainment、economics。
odds [标识]
通过标识或搜索词获取特定市场的详细赔率。
odds [标识]
odds [搜索词]
示例:
- - odds will-trump-win-2024 — 精确标识匹配
- odds bitcoin — 搜索包含 bitcoin 的市场
- odds fed rate cut march — 多词搜索
输出:
- - 完整市场问题
- 结果概率及可视化条形图(█ 填充,░ 空白)
- 24 小时交易量
- 市场流动性
- 关闭日期(绝对日期 + 剩余天数)
- 市场描述(截断至 200 个字符)
- 实时 CLOB 中间价(如有)
- 直接链接至 Polymarket 网页界面
搜索行为: 如果精确标识匹配失败,则在市场问题、标识和描述中执行客户端文本搜索。
search [查询]
通过文本在 100 个活跃市场中搜索。客户端过滤实现即时结果。
search [查询]
search [词1] [词2] [词3]
示例:
- - search bitcoin — 单个词
- search bitcoin 100k — 所有词必须匹配
- search fed interest rate — 多词搜索
- search election 2024 — 短语搜索
输出:
- - 最多 8 个匹配市场
- 每个市场的问题、是概率、交易量、标识
搜索逻辑: 所有查询词必须出现在市场问题、标识或描述中(不区分大小写)。搜索结果缓存 2 分钟。
watchlist
查看已配置关注列表市场的赔率。
watchlist
输出:
- - 关注列表中每个市场的当前赔率
- 每个市场的交易量和关闭日期
配置: 将市场标识添加到 ~/.openclaw/state/polymarket_watchlist.json:
json
{
slugs: [
will-trump-win-2024,
bitcoin-above-100k,
fed-rate-cut-march-2026
]
}
或通过 ~/.openclaw/config.yaml:
yaml
polymarket:
watchlist:
- will-trump-win-2024
- bitcoin-above-100k
- fed-rate-cut-march-2026
数据源与架构
无需 API 密钥
Polymarket 指挥中心仅使用公共 API:
- - Gamma API (https://gamma-api.polymarket.com) — 市场元数据、结果、定价
- CLOB API (https://clob.polymarket.com) — 实时买/卖中间价
零认证。零凭证。纯 HTTP。
线程安全缓存
具有自动驱逐机制的内存缓存:
- - TTL: 默认 120 秒(trending 为 180 秒,search 为 120 秒)
- 最大条目数: 100(满时按 LRU 策略驱逐)
- 线程安全: 可重入锁支持并发请求
- 智能失效: 过期条目在下次访问时自动删除
CLOB 中间价
赔率详情中显示的实时中间价来自 CLOB(中央限价订单簿)—— Polymarket 的链上订单簿。这代表真实的实时买/卖价差。如果 CLOB 数据不可用,则优雅降级。
输出格式
热门市场
🔮 Polymarket 热门(加密货币)
- 1. 比特币会在 2026 年底前达到 10 万美元吗?
是:72% | 交易量:250 万美元 | 关闭:45 天
📎 bitcoin-above-100k
- 2. 以太坊价格在 2026 年 3 月 31 日超过 5000 美元?
是:48% | 交易量:120 万美元 | 关闭:22 天
📎 ethereum-5k-march
💡 输入 odds [标识] 查看任何市场的详细赔率
详细赔率
🔮 特朗普会赢得 2024 年美国总统大选吗?
是:68% ████████████░░░░░░░░
否:32% ██████░░░░░░░░░░░░░░
📊 交易量:1850 万美元 | 流动性:420 万美元
📅 关闭:2026-11-05(240 天)
📝 2024 年美国总统大选结果的预测市场...
💹 实时中间价:67.8%
🔗 polymarket.com/event/will-trump-win-2024
搜索结果
🔍 Polymarket 搜索:bitcoin 100k
- 1. 比特币会在 2026 年底前达到 10 万美元吗?
是:72% | 交易量:250 万美元
📎 bitcoin-above-100k
- 2. 比特币价格预测:2026 年 3 月达到 10 万至 11 万美元区间?
是:58% | 交易量:85 万美元
📎 bitcoin-100k-110k-range
💡 输入 odds [标识] 查看任何市场的详细信息
关注列表
👀 Polymarket 关注列表
🔮 特朗普会赢得 2024 年美国总统大选吗?
是:68% | 交易量:1850 万美元
🔮 比特币会在 2026 年底前达到 10 万美元吗?
是:72% | 交易量:250 万美元
🔮 美联储会在 2026 年 3 月降息吗?
是:64% | 交易量:310 万美元
响应代码
| 状态 | 含义 | 操作 |
|---|
| ❌ | 网络错误 | 一分钟后重试;检查网络连接 |
| 🔮 |
成功 | 市场数据已加载并格式化 |
| 👀 | 关注列表 | 您已配置的市场 |
| 🔍 | 搜索 | 客户端过滤结果 |
| 💡 | 提示 | 建议的下一步操作 |
缓存行为
- - 首次调用: 访问 Polymarket API,缓存结果
- 重复调用(TTL 内): 立即返回缓存数据
- 过期数据(超过 TTL): 缓存被驱逐,触发新的 API 调用
- 有限内存: 最多 100 个条目;满时驱逐最旧的
- 线程安全: 支持并发请求(例如,晨间简报 + 用户查询同时进行)
示例时间线:
14:30:00 - 用户:trending
→ API 调用 → 设置缓存(14:32:00 过期)
→ 返回 10 个市场
14:30:45 - 用户:trending
→ 缓存命中(28 秒前)
→ 即时响应(相同数据)
14:32:15 - 用户:trending
→ 缓存未命中(15 秒前过期)
→ API 调用 → 设置缓存(14:34:15 过期)
→ 返回新数据
配置(可选)
所有命令无需任何配置即可工作。可选设置在 ~/.openclaw/config.yaml 中:
yaml
polymarket:
enabled: true
watchlist:
- will-trump-win-2024
- bitcoin-above-100k
- fed-rate-cut-march-2026
categories:
- politics
- crypto
- sports
无需配置 — 所有命令使用默认设置即可工作。
支持的市场类别
Gamma API 返回带有这些常见类别的市场:
- - politics — 选举、政治结果
- crypto — 比特币、以太坊、山寨币、区块链
- sports — NFL、NBA、英超联赛、奥运会
- entertainment —