实现OKX单笔期权币本位与USDT桥复利(中控只读,不改Gate)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
# 兼容旧名
|
||||
|
||||
Reference in New Issue
Block a user