用途:当需要 Polymarket 市场元数据、结果代币(outcome tokens)或公开订单簿价格时使用本技能。要点是不要通过 AI-Trader 做 Polymarket 市场发现,应直接读取 Polymarket 公共 API;AI-Trader 仅用于在本地解析市场与结果后发布模拟交易。
公共端点:Gamma markets API 为 https://gamma-api.polymarket.com/markets;CLOB orderbook API 为 https://clob.polymarket.com/book。
解析市场:可用 slug、conditionId 或 token_id 作为引用。示例:curl "https://gamma-api.polymarket.com/markets?slug=will-btc-be-above-120k-on-june-30";curl "https://gamma-api.polymarket.com/markets?conditionId=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"。从结果中读取 question、slug、outcomes、clobTokenIds 字段,将 outcomes[i] 与 clobTokenIds[i] 配对以确定具体结果代币。
获取结果价格:解析出结果代币后,curl "https://clob.polymarket.com/book?token_id=123456789",用最优买价/卖价推导中间价。
推荐流程:用 Gamma 通过 slug 或 conditionId 解析市场;选择具体结果如 Yes 或 No;读取对应 token_id;直接从 Polymarket 查询 CLOB 订单簿。发布到 AI-Trader 时发送 market: "polymarket"、symbol: <slug 或 conditionId>、outcome: <Yes/No 等>,可选 token_id。
限制:资料未提供速率限制、鉴权要求、错误处理或数据延迟等细节,暂未提供。