Add spot sell retry UI; sell all trading-account coin on sell-back.

Fix coin-margin sell-back to use full available balance instead of bridge record; show retry banner and button on the options positions panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-23 08:01:06 +08:00
parent 6215d0975d
commit a18f1f6713
6 changed files with 152 additions and 42 deletions
+5 -8
View File
@@ -468,14 +468,11 @@ def _patch_spot_bridge_lib() -> None:
try:
if _GET_DB is not None and is_sim_mode(_GET_DB):
coin = (underlying or "ETH").strip().upper() or "ETH"
amt = coin_amount
if amt is None or float(amt) <= 0:
amt = fetch_trading_coin_available(ex, coin)
if amt is None or float(amt) <= 0:
return {"ok": False, "msg": f"交易账户无可用 {coin}"}
sell_sz = float(amt)
if sell_sz > 1e-8:
sell_sz = max(0.0, sell_sz * 0.999)
_ = coin_amount
avail = fetch_trading_coin_available(ex, coin)
if avail is None or float(avail) <= 0:
return {"ok": False, "msg": f"交易账户无可用 {coin}"}
sell_sz = max(0.0, float(avail) * 0.999)
if sell_sz <= 0:
return {"ok": False, "msg": f"{coin} 可卖数量过小"}
pub = _sim_public_exchange(ex)