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
+5
View File
@@ -924,6 +924,11 @@ class OkxLiveExecutor(Matcher):
if dual.ok:
return dual
# close_group 可能已卖掉期权并落 option_closed_perp_pending;勿再记 residual,只续平永续
pos_after = self.current_position()
if str(pos_after.get("status") or "") == "option_closed_perp_pending":
return self.close_group(reason=reason, bypass_liquidity=True)
if require_deep_otm and not self.option_is_deep_otm():
return CloseResult(
ok=False,