fix: dashboard errors — Math.abs, API routing, fetchHistorical guard
Fixes three bugs in dashboard: 1. vbt.html: bare abs(dd) → Math.abs(dd) — fixes ReferenceError 2. server.py: Add /cv/ routing for Next.js quant dashboard - Mount _next static assets at /cv/_next (not /cv/ which eats API routes) - Add /cv/api/* routes for backtests/historical, detail, recalc, risk - Add /cv/ws WebSocket endpoints for live/paper metrics - Add /cv/ catchall for Next.js HTML pages 3. dashboard-next/src/lib/api.ts: add res.ok guard to fetchHistorical() — prevents SyntaxError when API returns HTML error pages 4. sim/maker.py: guard observe() against zero mid_price
This commit is contained in:
@@ -215,8 +215,10 @@ def cmd_run(args):
|
||||
import asyncio
|
||||
from live.node_v2 import ProductionNode
|
||||
|
||||
coins = [c.strip().upper() for c in args.coins.split(",") if c.strip()]
|
||||
|
||||
node = ProductionNode(
|
||||
coins=args.coins,
|
||||
coins=coins,
|
||||
testnet=not args.mainnet,
|
||||
mode=args.mode,
|
||||
max_position_per_coin=args.max_position,
|
||||
@@ -277,7 +279,7 @@ def main():
|
||||
|
||||
# run
|
||||
pr = sp.add_parser("run", help="Start production node")
|
||||
pr.add_argument("--coins", nargs="+", default=["BTC", "ETH"])
|
||||
pr.add_argument("--coins", default="BTC,ETH", help="Comma-separated coin list")
|
||||
pr.add_argument("--mainnet", action="store_true")
|
||||
pr.add_argument("--mode", default="paper", choices=["paper", "live"])
|
||||
pr.add_argument("--max-position", type=float, default=0.003)
|
||||
|
||||
Reference in New Issue
Block a user