Clear resting sports orders once at scheduled kickoff

This commit is contained in:
2026-12-03 06:46:20 +08:00
parent 53b36cce82
commit 7b26767a97
10 changed files with 226 additions and 1 deletions
+32
View File
@@ -702,3 +702,35 @@ sequenceDiagram
C->>E: tick_history 从保存的 tick_seq 续读
E-->>C: 返回该结果资产的旧步长、新步长、时间和游标
```
### 体育赛事开赛撤单
```mermaid
flowchart LR
Command["command.rs"] --> Market["market.rs"]
Market -->|改期| Kickoff["kickoff.rs"]
Expiry["expiry.rs"] -->|扫描到期赛事| Kickoff
Kickoff -->|退回剩余现金或份额| Book["book.rs"]
Kickoff --> Timers["kickoff_schema.sql"]
Catalog["catalog.rs"] -->|查询清盘时间与笔数| Timers
Lib["lib.rs"] -->|升级旧库| Timers
```
```mermaid
sequenceDiagram
participant C as CLI 或定时维护
participant E as Exchange
participant D as SQLite
participant B as 常驻盘口
C->>E: 下一笔请求、空闲维护或重启
E->>D: 按时间索引检查到期体育赛事
opt 有尚未清盘的赛事
E->>D: 获取写锁并复查,按赛事查出各子盘活跃余单
loop 每笔余单
E->>D: 退回预留现金或份额并记为 cancelled
end
E->>D: 记录清盘时间和笔数,提交
end
E->>B: 从已提交变更刷新盘口,重启时恢复活跃订单
C->>E: 在已进入连续交易的子盘提交新单
```