粉尘低于现货最小可卖量时忽略且不展示、不再重试卖回。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -161,10 +161,18 @@ def trading_account_label(
|
||||
parts.append(f"{float(usdt):.2f} USDT")
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
eth_txt = _fmt_coin_amount(eth, min_amt=1e-6)
|
||||
# 低于现货最小可卖的粉尘不展示(与卖回逻辑一致)
|
||||
try:
|
||||
from lib.options.options_spot_bridge_lib import spot_min_sell_sz
|
||||
|
||||
eth_min = spot_min_sell_sz(None, "ETH")
|
||||
btc_min = spot_min_sell_sz(None, "BTC")
|
||||
except Exception:
|
||||
eth_min, btc_min = 0.0001, 0.00001
|
||||
eth_txt = _fmt_coin_amount(eth, min_amt=eth_min)
|
||||
if eth_txt is not None:
|
||||
parts.append(f"{eth_txt} ETH")
|
||||
btc_txt = _fmt_coin_amount(btc, min_amt=1e-7)
|
||||
btc_txt = _fmt_coin_amount(btc, min_amt=btc_min)
|
||||
if btc_txt is not None:
|
||||
parts.append(f"{btc_txt} BTC")
|
||||
return "\n".join(parts) if parts else "—"
|
||||
|
||||
@@ -1158,7 +1158,9 @@ function formatTradingAccountLabel(usdt, eth, btc, marginMode) {
|
||||
const pushCoin = (v, ccy) => {
|
||||
if (v === null || v === undefined || v === "") return;
|
||||
const n = Number(v);
|
||||
if (Number.isNaN(n) || !(n >= (ccy === "BTC" ? 1e-7 : 1e-6))) return;
|
||||
// 低于 OKX 现货常见 minSz 的粉尘不展示
|
||||
const minSz = ccy === "BTC" ? 0.00001 : 0.0001;
|
||||
if (Number.isNaN(n) || !(n >= minSz)) return;
|
||||
const txt = String(n.toFixed(6)).replace(/\.?0+$/, "");
|
||||
parts.push(`${txt || "0"} ${ccy}`);
|
||||
};
|
||||
|
||||
@@ -1644,7 +1644,9 @@ function formatTradingAccountLabel(usdt, eth, btc, marginMode) {
|
||||
const pushCoin = (v, ccy) => {
|
||||
if (v == null || v === "") return;
|
||||
const n = Number(v);
|
||||
if (Number.isNaN(n) || !(n >= (ccy === "BTC" ? 1e-7 : 1e-6))) return;
|
||||
// 低于 OKX 现货常见 minSz 的粉尘不展示
|
||||
const minSz = ccy === "BTC" ? 0.00001 : 0.0001;
|
||||
if (Number.isNaN(n) || !(n >= minSz)) return;
|
||||
const txt = String(n.toFixed(6)).replace(/\.?0+$/, "");
|
||||
parts.push(`${txt || "0"} ${ccy}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user