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:
+5
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user