Cancel account orders by ID batch, market or outcome asset

This commit is contained in:
2026-12-03 04:23:08 +08:00
parent 67426ae617
commit c27bb60fd2
8 changed files with 221 additions and 2 deletions
+18
View File
@@ -35,6 +35,8 @@ flowchart LR
expiry -->|到期封盘并释放订单预留| market
twap -->|保存定点价格与证据| schema
res -->|规则与裁决状态| schema
market -->|批量、市场或账户撤单| cancellation["src/cancellation.rs"]
cancellation -->|释放订单未成交的预留| book
market -->|匹配命令类型| cmd
market -->|检查数量、标识和市场阶段| valid
market -->|下单、撤单与开盘| book["src/book.rs"]
@@ -250,3 +252,19 @@ sequenceDiagram
E->>D: 比较两个端点,校验抵押并记录结果
E-->>I: 返回最终结果与待兑付金额
```
## 批量撤单
```mermaid
sequenceDiagram
participant C as CLI
participant E as Exchange
participant D as SQLite
participant B as 常驻盘口
C->>E: cancel_orders 提交账户、请求键与订单号列表
E->>D: 查历史回执,或在写事务内按账户检查原单
E->>D: 对可撤订单释放余量,记录未撤原因与回执
D-->>E: 提交订单、资产和回执
E->>B: 同步撤单并移除对应互补挂单
E-->>C: canceled 与 not_canceled
```