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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user