Match public CLOB side prices and batch responses to observed books
This commit is contained in:
@@ -61,10 +61,10 @@ Content-Type: application/json
|
||||
|
||||
[{"token_id":"eb:YES:mid-example"},{"token_id":"eb:NO:mid-example"}]
|
||||
|
||||
### Read the best ask to buy YES in the midpoint.jsonl fixture ("0.09")
|
||||
### Read the resting YES bid in the midpoint.jsonl fixture ("0.08")
|
||||
GET http://127.0.0.1:9002/price?token_id=eb%3AYES%3Amid-example&side=BUY
|
||||
|
||||
### Read BUY and SELL for the same outcome (0.09 and 0.08)
|
||||
### Query-only batch GET returns 400 Invalid payload
|
||||
GET http://127.0.0.1:9002/prices?token_ids=eb%3AYES%3Amid-example%2Ceb%3AYES%3Amid-example&sides=BUY%2CSELL
|
||||
|
||||
### Include both outcomes with a JSON body
|
||||
|
||||
@@ -219,7 +219,7 @@ list 接受十进制份额字符串,最多六位小数;book、assets 和事
|
||||
|
||||
## 下单面板的单笔与批量买卖报价
|
||||
|
||||
`price` 接受 token_id 和方向,BUY 读取最低卖价,SELL 读取最高买价。单笔响应的 price 为十进制字符串。`prices` 在 requests 中接受最多 500 对资产与方向,在同一读快照中返回按资产和方向索引的 JSON 数值,匹配官方 REST 文档的样例类型。客户端可以直接为多个结果填入买卖按钮。大单仍需通过 estimate 按深度估算成交金额。[官方单笔与批量报价](https://docs.polymarket.com/market-data/prices-order-books.md#best-market-price)
|
||||
JSONL 下单面板的 `price` 接受 token_id 和方向,BUY 读取最低卖价,SELL 读取最高买价。单笔响应的 price 为十进制字符串。`prices` 在 requests 中接受最多 500 对资产与方向,在同一读快照中返回按资产和方向索引的 JSON 数值,客户端可以直接为多个结果填入买卖按钮。公开 HTTP 接口遵循下文实测的盘口方向。大单仍需通过 estimate 按深度估算成交金额。[官方单笔与批量报价](https://docs.polymarket.com/market-data/prices-order-books.md#best-market-price)
|
||||
|
||||
[可重放样例](examples/execution-prices.jsonl)开始时只有 YES 买单,买入 YES 的报价为 null。随后有人以 0.89 挂买 NO,YES 买入价变成 0.11,卖出价为 0.09。NO 买入价为 0.91,卖出价为 0.89。这四个报价均来自挂单,无需先发生交易。单侧没有对手时保留该键并返回 null。重复项合并,未知资产使整批失败。空批次拒绝,盘前返回待集合竞价的挂单报价。上述边界属于本地约定。本地 token_id 使用 Eventbook 的结果资产 ID,公开接口的生产响应、原生资产编号与无流动性时的处理仍待对照。
|
||||
|
||||
@@ -366,9 +366,9 @@ Polymarket 的单资产最近成交接口规定,无成交时返回价格字符
|
||||
|
||||
### HTTP 买卖报价的方向
|
||||
|
||||
用[同一份本地盘口](examples/midpoint.jsonl)重放:YES 买一 0.08、卖一 0.09。单查 BUY 返回 {"price":"0.09"},单查 SELL 返回 {"price":"0.08"}。批量查询同一结果的两个方向会保留两个键,价格为 JSON 数字。GET 的 token_ids、sides 两列按位置配对,POST 接收含 token_id 和 side 的对象数组。[HTTP 请求](examples/clob-http.http) · [批量 GET 规范](https://docs.polymarket.com/api-reference/market-data/get-market-prices-query-parameters) · [批量 POST 规范](https://docs.polymarket.com/api-reference/market-data/get-market-prices-request-body)
|
||||
用[同一份本地盘口](examples/midpoint.jsonl)重放:YES 买一 0.08、卖一 0.09。公开 HTTP 单查 BUY 返回 {"price":"0.08"},SELL 返回 {"price":"0.09"}。POST /prices 返回各方向的价格字符串;已上市资产缺买或卖侧时分别返回 "0" 或 "1"。单查未知资产为 404,批量会省略未知资产。只在批量请求中省略 side 时默认为 SELL。
|
||||
|
||||
官方行情指南从交易者角度描述 BUY 取卖一,OpenAPI 的单查文字则把 BUY 对应到买一。本地沿用行情指南与既有交易命令的口径。官方 Rust SDK 的模拟回执可以确认单查字符串、批查数字,无法据此判定生产方向。已上市资产缺少所需一侧时,本地 HTTP 单查返回 422,批查省略该方向。请求中出现未上市资产时整批返回 404。上述边界和交易方向仍待稳定盘口实测。[行情指南](https://docs.polymarket.com/market-data/prices-order-books#best-market-price) · [单查规范](https://docs.polymarket.com/api-reference/market-data/get-market-price) · [官方 SDK 用例](https://github.com/Polymarket/rs-clob-client-v2/blob/main/tests/clob.rs#L139-L216)
|
||||
2026-12-03 06:55 UTC,三个生产资产各自的前后盘口哈希一致。单查与批量分别得到双侧 0.039/0.04、仅卖侧 0/0.001 和仅买侧 0.999/1。文档中仅带 token_ids 和 sides 的 GET /prices 在采样中返回 400 Invalid payload。本地保留此查询结果,正常批量读取用 POST。两侧均空时的 0/1 由单侧规则推得,尚缺双空实测。生产样本保存在连接器分支的 crates/venue-probe/fixtures/live-side-prices.json。客户端准备实际买卖时,仍可用本地 JSONL 交易命令查询对手价或按数量预估成交。[HTTP 请求](examples/clob-http.http) · [单查规范](https://docs.polymarket.com/api-reference/market-data/get-market-price) · [批量 GET 规范](https://docs.polymarket.com/api-reference/market-data/get-market-prices-query-parameters)
|
||||
|
||||
### CLOB 历史价格曲线
|
||||
|
||||
|
||||
Reference in New Issue
Block a user