实现OKX单笔期权币本位与USDT桥复利(中控只读,不改Gate)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 12:10:29 +08:00
parent dd8fbae0dd
commit 72c84bb993
20 changed files with 1377 additions and 21 deletions
+13 -1
View File
@@ -351,7 +351,7 @@ def close_option_by_bid1(
# 自动平已挂过单:同仓续批只验流动性
mark_close_gate_passed(inst_id)
return {
out = {
"ok": True,
"mode": "bid1",
"orders": [{"order": order, "px": px, "sheets": level_sheets}],
@@ -369,6 +369,18 @@ def close_option_by_bid1(
+ ("" if fully_closed else f",剩余 {remaining_pos} 张待下次平仓")
),
}
if fully_closed:
try:
from lib.options.options_coin_open_lib import maybe_sell_spot_after_close
spot_sell = maybe_sell_spot_after_close(cfg, ex, inst_id=inst_id, close_result=out)
if spot_sell is not None:
out["spot_sell"] = spot_sell
if spot_sell.get("bridge_status") == "pending_sell_spot":
out["msg"] = str(out.get("msg") or "") + ";卖回 USDT 失败,请重试卖回"
except Exception as e:
out["spot_sell"] = {"ok": False, "msg": str(e)}
return out
# 兼容旧名