Move fleet stats to nav page; backfill funds and loss metrics from curve/status.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -220,12 +220,26 @@ async def fleet_status(_tok: Annotated[str, Depends(require_fleet_token)]) -> di
|
||||
return None
|
||||
return _sf(key, default)
|
||||
|
||||
latest_funds = 0.0
|
||||
try:
|
||||
from ..sim.funds_wallets import FundsWallets
|
||||
|
||||
latest_funds = float(FundsWallets(db).total_usdt_equiv())
|
||||
except Exception:
|
||||
try:
|
||||
from ..sim.ledger import Ledger
|
||||
|
||||
latest_funds = float(Ledger(db).snapshot().get("equity") or 0)
|
||||
except Exception:
|
||||
latest_funds = 0.0
|
||||
|
||||
return {
|
||||
"ok": True,
|
||||
"mode": settings.mode,
|
||||
"env_name": settings.env_name,
|
||||
"exchange": exchange_name,
|
||||
"sim": settings.is_sim,
|
||||
"latest_funds": latest_funds,
|
||||
"market_connected": bool(snap.connected) if snap else False,
|
||||
"pair": snap.pair.to_dict() if snap and snap.pair else None,
|
||||
"index_px": (
|
||||
|
||||
Reference in New Issue
Block a user