Reconstruct public CLOB chart samples from historical books

This commit is contained in:
2026-12-03 16:29:55 +08:00
parent d7a77c734d
commit 2a8916e1d9
11 changed files with 223 additions and 85 deletions
+6 -4
View File
@@ -1125,14 +1125,16 @@ sequenceDiagram
Q-->>H: 按资产和方向分组的可用价格
```
### CLOB 历史交易价格
### CLOB 历史价格
```mermaid
flowchart LR
H["cli/market_http.rs"] --> L["prices_history/legacy.rs"]
L --> A["assets.rs"]
L --> Q["prices_history/legacy.sql"]
Q --> T["price_migration.sql 中的 outcome_trade_prices"]
Q --> T["quote_schema.sql 中的 quote_events"]
Q --> O["prices_history/chart_schema.sql 中的采样起点和时间索引"]
API["lib.rs"] --> O
Q --> S["schema.sql 中的 price_settlements"]
```
@@ -1142,8 +1144,8 @@ sequenceDiagram
participant E as Exchange
participant D as SQLite
C->>E: clob_price_history
E->>D: 读事务中确认资产并取得当前时钟
E->>D: 按查询窗口和分钟粒度选每个桶内最后一个成交或兑付
E->>D: 清理到期委托并取得读快照与数据库时钟
E->>D: 按 UTC 分钟网格重放各采样点当时的盘口,再读取最近可用点
D-->>E: 观测时间和定点价格
E-->>C: t 为 Unix 秒,p 为十进制数
```