Fix LIVE SoT P0/P1: closing state machine, OO exchange fills, BN balances.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -70,8 +70,15 @@ def _live_balances() -> dict[str, float | None]:
|
||||
|
||||
ex = str(load_runtime_settings().exchange or "").strip().lower()
|
||||
if ex in ("binance", "bn"):
|
||||
# 币安资金接口尚未接入;返回 None 使可开判定为「未知」而非误用 OKX
|
||||
logger.debug("open_capacity: binance live balance not wired; treating as unknown")
|
||||
from ..live.binance_trade import BinanceTradeClient
|
||||
|
||||
client = BinanceTradeClient()
|
||||
try:
|
||||
bal = client.fetch_balances()
|
||||
out["trading_usdt"] = _f(bal.get("trading_usdt"))
|
||||
out["trading_usdc"] = _f(bal.get("trading_usdc"))
|
||||
finally:
|
||||
client.close()
|
||||
else:
|
||||
from ..live.okx_funds import OkxFundsClient
|
||||
|
||||
|
||||
Reference in New Issue
Block a user