修复币本位平仓/到期后未自动卖回,并消除模拟盘卖币时数据库锁定。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -829,6 +829,25 @@ class SimBroker:
|
||||
forget_close_gate_for_inst(inst_id)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
from lib.options.options_margin_mode_lib import margin_mode_from_inst_id
|
||||
from lib.options.options_spot_bridge_lib import sell_residual_after_option_flat
|
||||
|
||||
if margin_mode_from_inst_id(inst_id) == "coin":
|
||||
uly = inst_id.split("-")[0].upper() if "-" in inst_id else "ETH"
|
||||
conn_s = self.get_db()
|
||||
try:
|
||||
sell_residual_after_option_flat(
|
||||
conn_s,
|
||||
exchange,
|
||||
underlying=uly,
|
||||
inst_id=inst_id,
|
||||
)
|
||||
conn_s.commit()
|
||||
finally:
|
||||
conn_s.close()
|
||||
except Exception:
|
||||
pass
|
||||
settled.append(
|
||||
{
|
||||
"inst_id": inst_id,
|
||||
|
||||
Reference in New Issue
Block a user