UMA Oracle / API Documentation

Question Browser Live Monitor

UMA Oracle API

Polymarket UMA Oracle 数据的公开 API。所有接口返回 JSON,无需认证,支持跨域 (CORS)。

Public API for Polymarket UMA Oracle data. All endpoints return JSON, no authentication required, CORS enabled.

https://tero.market/uma
GET /api/questions 问题列表 (分页/筛选/搜索)

Query Parameters

参数类型默认说明
statestring""Requested / Proposed / Disputed / Settled
pageint1页码
per_pageint50每页数量 (max 200)
searchstring""全文搜索 (FTS5)
sortstringrequest_timestamp排序字段: request_timestamp, title, state, bond, deadline
dirstringdesc排序方向: asc / desc
event_slugstring""按事件 slug 筛选
sourcestring""按来源筛选: managed / oov2
sinceint""增量更新: 返回 updated_at > since 的记录

Response

{ "questions": [ { "id": "0x...", "title": "Counter-Strike: Team A vs Team B...", "title_zh": "反恐精英:A队 vs B队...", "state": "Requested", "market_id": "1751089", "bond": "750000000", "reward": "2000000", "event_slug": "cs2-team1-vs-team2-2026-03-30", "request_timestamp": 1774834026, "pm_slug": "/event/cs2-..." } ], "total": 26112, "page": 1, "pages": 523, "per_page": 50 }

Example

# 获取所有争议中的问题 curl "https://tero.market/uma/api/questions?state=Disputed" # 搜索 Counter-Strike 相关 curl "https://tero.market/uma/api/questions?search=Counter-Strike&per_page=10" # 按事件筛选 curl "https://tero.market/uma/api/questions?event_slug=cs2-team1-vs-team2-2026-03-30"
GET /api/stats 全局统计 120s cache

Response

{ "total": 355806, "disputed": 7, "pending": 26829, "settled": 328958, "ai_done": 34674, "ai_pending": 10040, "last_fetch": 1774834026, "fetch_interval": 300, "recent_fetches": [...] }
GET /api/question/{id} 问题详情

URL Parameters

参数说明
id问题 ID (0x... 格式的链上标识)

Response

返回问题的全部字段,包括 title, title_zh, description, description_zh, state, proposed_price, settlement_price, proposer, disputer, bond, reward, timestamps, pm_slug 等。

GET /api/question/{id}/rounds 争议轮次历史

Response

{ "rounds": [ { "id": "0x...", "state": "Disputed", "proposer": "0x...", "proposed_price": "1000000000000000000", "bond": "750000000" } ], "total_rounds": 3 }
GET /api/events 事件机会看板

Query Parameters

参数默认说明
sortopportunityopportunity / recent / size
filteropportunityopportunity (有结算+有待提议) / all / disputed

Response

{ "events": [ { "event_slug": "cs2-team1-vs-team2-2026-03-30", "title": "反恐精英:A队 vs B队 (BO3)", "title_en": "Counter-Strike: Team A vs Team B (BO3)", "category": "CS2", "category_zh": "电竞", "total": 11, "requested": 8, "settled": 3, "avg_bond": 750, "avg_reward": 2.0, "samples": [...] } ], "total": 100 }
GET /api/events/refresh/{event_slug} 实时刷新事件状态 (查链上)

从 UMA Subgraph 实时查询指定事件下所有问题的最新状态并更新数据库。较慢 (~2-5s)。

Response

{ "updated": 5, "total": 11 }
GET /api/pm/prices Polymarket CLOB 价格缓存 DB cache

Query Parameters

参数说明
ids required逗号分隔的 market_id 列表 (max 100)

Response

{ "1751089": { "yesBid": 65, "yesAsk": 67, "noBid": 33, "noAsk": 35, "updated": 1774834026 } } // 价格单位: 分 (cents), 即 65 = $0.65

Example

curl "https://tero.market/uma/api/pm/prices?ids=1751089,1751090"
GET /api/pm/siblings/{market_id} 同组市场列表

Response

{ "event": "cs2-team1-vs-team2-2026-03-30", "current": "1751089", "siblings": [ { "market_id": "1751090", "question": "Map 1 Winner", "uma_state": "Requested", "title_zh": "地图 1 获胜者" } ] }
GET /api/live/state CS2 Live Monitor 完整状态 Live

CS2 比赛实时监控的完整状态快照,包括进行中的比赛、即将开始的赛事、历史判断和统计。

Response

{ "pm2_status": "online", "active": { "team1-vs-team2-30-03-2026": { "team1": "TeamA", "team2": "TeamB", "score": "2-0", "match_status": "finished", "maps": [...], "markets": [ { "type": "map_winner", "our_answer": "p1", "uma_proposed": "p1", "result": "correct", "lead_seconds": 120 } ] } }, "upcoming": [...], "stats": { "total_judgments": 2387, "accuracy": 93.1, "correct": 2102, "wrong": 155, "by_type": { "map_winner": { "total": 385, "correct": 371, "wrong": 4 }, "match_winner": { "total": 274, "correct": 251, "wrong": 7 } } } }
SSE /api/live/stream 实时事件流 (Server-Sent Events) Live

Event Types

事件触发说明
init连接时完整状态快照 (同 /api/live/state)
match_new发现新比赛新的 CS2 live 比赛
map_done一局结束map 结束后判断结果
match_end比赛结束整场结束后判断比赛级 market
heartbeat每 15s心跳 + pm2 状态

Example

// JavaScript const es = new EventSource("https://tero.market/uma/api/live/stream"); es.addEventListener("init", e => { const state = JSON.parse(e.data); console.log(state.stats.accuracy + "% accuracy"); }); es.addEventListener("match_new", e => { const match = JSON.parse(e.data); console.log("New match:", match.data.team1, "vs", match.data.team2); }); # curl curl -N "https://tero.market/uma/api/live/stream"
GET /api/pm/{market_id} Polymarket 链接查询

查询 Polymarket 上的 market URL。首次查询会调用 Gamma API 获取,之后缓存。

Response

{ "slug": "will-...", "url": "https://polymarket.com/event/..." }

Notes

Rate Limit: 暂无限流,请合理使用。建议 polling 间隔 >= 10s。

CORS: Access-Control-Allow-Origin: *,支持浏览器直接调用。

Data Source: UMA Optimistic Oracle v2 (Polygon) via Goldsky Subgraph + Polymarket Gamma/CLOB API + bo3.gg (CS2).

Update Frequency: 链上数据每 3 分钟更新,CLOB 价格每 5 分钟更新,Live Monitor 比赛期间 10s 轮询。

Bond/Reward 单位: 原始值为 USDC (6 decimals),如 750000000 = 750 USDC。API 中 avg_bond/avg_reward 已转换为 U。