Match public midpoint and spread across all four book shapes

This commit is contained in:
2026-12-03 16:02:32 +08:00
parent 6e1cfb4e22
commit 9cc3921e3c
8 changed files with 145 additions and 41 deletions
+2 -2
View File
@@ -1104,9 +1104,9 @@ sequenceDiagram
participant E as Exchange
participant D as SQLite
C->>E: spreads(tokens) 或 midpoints(tokens)
E->>D: 单条查询读取各市场最新 quote_events
E->>D: 先处理到期订单,再从同一快照读取各市场最新 quote_events
D-->>E: 返回 YES 的买一和卖一
E->>E: 按结果换算两侧,计算价差或精确到半个价格步长的中点
E->>E: 换算结果方向,缺买盘取 0、缺卖盘取 1,计算价差或中点
E-->>C: 按结果资产索引,未上市资产无条目
```