feat: compact instance toolbar, stats strip and settings two-column layout
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7215,10 +7215,23 @@ def api_account_snapshot():
|
||||
extra_blocks=not risk_status.get("can_trade", True),
|
||||
)
|
||||
available_trading_usdt = get_available_trading_usdt()
|
||||
unrealized_pnl = None
|
||||
if exchange_private_api_configured():
|
||||
from lib.instance.instance_live_pnl_lib import fetch_unrealized_pnl
|
||||
|
||||
def _gate_positions():
|
||||
ensure_markets_loaded()
|
||||
try:
|
||||
return exchange.fetch_positions(None, {"settle": "usdt"}) or []
|
||||
except Exception:
|
||||
return exchange.fetch_positions() or []
|
||||
|
||||
unrealized_pnl = fetch_unrealized_pnl(_gate_positions)
|
||||
return jsonify({
|
||||
"funding_usdt": funding_usdt,
|
||||
"current_capital": current_capital,
|
||||
"available_trading_usdt": round(available_trading_usdt, 2) if available_trading_usdt is not None else None,
|
||||
"unrealized_pnl": unrealized_pnl,
|
||||
"recommended_capital": recommended_capital,
|
||||
"active_count": position_limit_count,
|
||||
"max_active_positions": MAX_ACTIVE_POSITIONS,
|
||||
|
||||
Reference in New Issue
Block a user