Expose event and market directory details with consistent outcome prices

This commit is contained in:
2026-12-03 11:54:06 +08:00
parent 9cbcc03681
commit 6f620089b6
9 changed files with 361 additions and 12 deletions
+25
View File
@@ -242,3 +242,28 @@ sequenceDiagram
```
event_id 取自本地 events 或 catalog 查询,market_id 取自 assets 查询。两个参数均可重复,同类 ID 取并集,同时指定事件与市场时取交集。独立市场的公告也能通过 market_id 查询。默认按公告 ID 降序,每页 20 条;支持 order=id、ascending、offset 和 0 到 100 的 limit。当前查询对其他筛选参数返回 400。
### 从事件页进入订单簿
```mermaid
flowchart LR
H["market_http.rs"] --> G["exchange/gamma_directory.rs"]
H --> B["exchange/book_snapshot.rs"]
```
```mermaid
sequenceDiagram
participant C as 客户端
participant H as market-http
participant E as Exchange
C->>H: GET /events/slug/nvda-closing-price-2027
H->>E: gamma_event
E-->>C: markets 数组,每项含该门槛的目录 ID
C->>H: GET /markets/{id}
H->>E: gamma_market
E-->>C: outcomes 与 clobTokenIds,均为 JSON 数组编码的字符串
C->>H: GET /book?token_id=选中的资产
H-->>C: 该结果的买卖盘
```
加载 [主题事件样例](../../docs/examples/topic.jsonl) 后即可按上图读取。事件与市场均支持按数字 ID 和按 slug 查询,缺失资源返回 404。路径段按 UTF-8 百分号编码,路径中的加号表示加号。当前详情入口支持无查询参数的 GET。