Report single-sided traded shares and taker notional by event and market

This commit is contained in:
2026-12-03 05:15:50 +08:00
parent 7fd67e7c8e
commit fae9f26829
9 changed files with 212 additions and 2 deletions
+22
View File
@@ -20,6 +20,9 @@ flowchart LR
api -->|解析写命令| cmd["src/command.rs"]
api -->|事务内派发| market["src/market.rs"]
api -->|解析只读查询| queries["src/catalog.rs"]
queries -->|查询各盘及赛事成交量| volume["src/volume.rs"]
volume -->|按市场汇总普通及互补成交| volumesql["src/volume.sql"]
volumesql -->|成交、时间及吃单方| schema
queries -->|市价预估| estimate["src/estimate.rs"]
estimate -->|同步并读取常驻盘口| cache
estimate -->|成交金额| book
@@ -412,3 +415,22 @@ sequenceDiagram
C->>E: quote_history 从 quote_seq 之后续读
E-->>C: 顺序返回报价、价差、中点、时间和游标
```
## 赛事目录与成交量
```mermaid
sequenceDiagram
participant C as 客户端
participant E as Exchange
participant D as SQLite
C->>E: catalog(event) 或 volume(event)
E->>D: 打开同一读快照,选择已展示的市场
E->>D: 普通成交按 bid 定位市场,互补成交按 market 定位
D-->>E: 每笔取一次份额,按吃单方实际结果价统计金额
E->>E: 汇总每盘的累计及最近 24 小时,再求赛事总量
alt catalog
E-->>C: 保留目录顺序,事件和各市场附带 volume
else volume
E-->>C: 统计时刻、总量及按累计吃单份额降序的成员
end
```