Record committed best-bid and ask changes for resumable quote history
This commit is contained in:
@@ -394,3 +394,21 @@ sequenceDiagram
|
||||
E->>D: 读取该时刻或之前最后一笔成交或实际裁决
|
||||
E-->>C: 一个观测或空数组
|
||||
```
|
||||
|
||||
## 最优报价变化与断线续读
|
||||
|
||||
`lib.rs` 安装 `quote_schema.sql`,按市场保存事务提交时的买一和卖一。常规交易随请求回执写入,`expiry.rs` 在订单到期或定时封盘的事务内用 `quotes.rs` 写入变化。`assets.rs` 和 `catalog.rs` 将资产路由至当前报价或历史查询。
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant C as 客户端
|
||||
participant E as Exchange
|
||||
participant D as SQLite
|
||||
C->>E: quote 获取结果资产当前报价
|
||||
E-->>C: 买一、卖一、quote_seq
|
||||
E->>D: 撮合或撤单,同事务标记发生变化的市场
|
||||
D->>D: 提交回执前核对四个直接或互补最优价
|
||||
D->>D: 买一或卖一变化时写入一个市场序号
|
||||
C->>E: quote_history 从 quote_seq 之后续读
|
||||
E-->>C: 顺序返回报价、价差、中点、时间和游标
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user