Fix post-close auto sell: restore missing spot min-size helpers used by sim sell.

Sell was silently failing on ImportError; surface sell result in close alert notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-14 16:58:09 +08:00
parent d54bbdfcb3
commit be00991568
5 changed files with 83 additions and 8 deletions
+2
View File
@@ -178,6 +178,8 @@ def _sell_all_coin_to_usdt(cfg: dict[str, Any], underlying: str) -> dict[str, An
from lib.options.options_spot_bridge_lib import spot_market_sell_coin_to_usdt
ex = cfg.get("exchange_options") or cfg.get("exchange")
if callable(ex):
ex = ex()
if ex is None:
return {"ok": False, "msg": "无交易所实例,跳过卖币"}
return spot_market_sell_coin_to_usdt(ex, underlying=str(underlying or "ETH").upper())