中控快照附带 BTC/ETH 报价,供总览从客户端回传展示。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -189,6 +189,20 @@ def _enrich_hub_protocol(snap: dict[str, Any], *, app_module: Any) -> dict[str,
|
||||
from datetime import datetime
|
||||
|
||||
out["ts"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
quotes = {"tickers": [], "updated_at": out.get("ts") or ""}
|
||||
try:
|
||||
from lib.market.nav_spot_tickers_lib import build_nav_spot_tickers
|
||||
|
||||
ex = getattr(app_module, "exchange", None)
|
||||
reset_hour = int(getattr(app_module, "TRADING_DAY_RESET_HOUR", 8) or 8)
|
||||
tickers = build_nav_spot_tickers(ex, reset_hour=reset_hour) if ex is not None else []
|
||||
quotes = {
|
||||
"tickers": tickers if isinstance(tickers, list) else [],
|
||||
"updated_at": out.get("ts") or "",
|
||||
}
|
||||
except Exception:
|
||||
pass
|
||||
out["quotes"] = quotes
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user