Fix OKX abandon residual double-book and fill/residual ledger holes.

After dual-close leaves option pending, continue close_group instead of false residual; reject partial fills on wait timeout; LIVE residual settle allow_negative.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 20:20:36 +08:00
parent ec87cf2104
commit 44fd0371b9
7 changed files with 71 additions and 44 deletions
+15
View File
@@ -5,6 +5,21 @@
---
## 2026-07-29 — 第二轮审计:abandon residual / 部分成交 / residual 账本
### 变更
1. OKX 弃期权:双腿已卖掉期权并落 `option_closed_perp_pending` 时,续平永续,不再误记 residual(防期权双计)。
2. OKX 等成交超时仅接受 `filled`,不再把部分成交当全成。
3. LIVE residual 到期结算 `allow_negative`,避免本地拒记卡 pending。
4. 币安开期权保留 opening 仅匹配 `orderId=`;紧急全平对 stuck `opening` 明确告警。
### 审计
详见 [`docs/审计说明-2026-07-29-开平仓与实盘安全.md`](./审计说明-2026-07-29-开平仓与实盘安全.md)。
---
## 2026-07-29 — 开平仓/实盘安全审计修复
### 变更