Serve the CLOB price history protocol with minute-based fidelity

This commit is contained in:
2026-12-03 10:18:43 +08:00
parent 74749bfdb8
commit fe69e31929
10 changed files with 201 additions and 1 deletions
+23
View File
@@ -1111,3 +1111,26 @@ sequenceDiagram
D-->>Q: 返回买一与卖一
Q-->>H: 按资产和方向分组的可用价格
```
### 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 --> S["schema.sql 中的 price_settlements"]
```
```mermaid
sequenceDiagram
participant C as HTTP
participant E as Exchange
participant D as SQLite
C->>E: clob_price_history
E->>D: 读事务中确认资产并取得当前时钟
E->>D: 按查询窗口和分钟粒度选每个桶内最后一个成交或兑付
D-->>E: 观测时间和定点价格
E-->>C: t 为 Unix 秒,p 为十进制数
```