Support amount-specific negative-risk redemptions and wallet receipts
This commit is contained in:
@@ -1404,3 +1404,26 @@ sequenceDiagram
|
||||
C->>E: 裁决赢家
|
||||
E->>D: 将完整准备金含小数余数划入赢家抵押
|
||||
```
|
||||
|
||||
### 互斥市场按持仓数量赎回
|
||||
|
||||
`command.rs` 解析可选的两侧数量。`market.rs` 校验市场状态并提交现金和钱包活动;`neg_risk.rs` 验证互斥组合成员身份,调用 `inventory.rs` 扣减指定份额。`activity.sql` 和 `activity.rs` 按请求回执返回每侧实际销毁量。
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant C as 持有人
|
||||
participant E as market.rs
|
||||
participant N as neg_risk.rs
|
||||
participant D as SQLite 账本
|
||||
C->>E: redeem,提交请求 ID 和 YES、NO 微份数
|
||||
E->>N: 在同一事务内校验已裁决市场
|
||||
N->>D: 读取赢家并扣减两侧指定份额
|
||||
alt 任一侧不足
|
||||
E->>D: 回滚本次扣减
|
||||
E-->>C: 余额不足
|
||||
else 成功
|
||||
N-->>E: 销毁总份额及赢家应付现金
|
||||
E->>D: 记入兑付、活动和幂等回执并提交
|
||||
E-->>C: 返回本次两侧销毁量和实付金额
|
||||
end
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user