SPB Git

Repository Public

ops-monitor.json 6.0 KB 60 lines json

1{2  "source": "shapes of services/api/src/monitor/routes.ts (walletTotal, /health), aggregate.ts (capital, pnl, exposure), health.ts (Connector, lastBackup, diskFree, auditChainStatus, versions), capabilities.ts, agents/lab.ts (LabStatus), quotes/engine.ts (summary, stats)",3  "capital": {4    "asOf": 1795000000000,5    "agents": [6      { "id": "a1", "name": "Momentum 1", "state": "LIVE", "network": "base", "mode": "LIVE", "real": true, "capitalUsd": 500, "equityUsd": 512.34, "asOf": 1794999990000, "positions": 2, "lastBar": 1794996400000, "stopReason": null, "mandateExpiresAt": 1795600000000 },7      { "id": "a2", "name": "Draft", "state": "PAPER_TRADING", "network": "base", "mode": "PAPER", "real": false, "capitalUsd": 1000, "equityUsd": null, "asOf": null, "positions": 0, "lastBar": null, "stopReason": "loss limit", "mandateExpiresAt": null }8    ],9    "derivatives": [10      { "id": "d1", "label": "Paper 1", "venue": "hyperliquid", "network": "mainnet", "kind": "paper", "real": false, "mode": "PAPER", "equity": 10000, "collateral": 10000, "marginUsed": 0, "unrealizedPnl": 0, "asOf": null, "halt": null, "divergence": null, "positions": 0, "openOrders": 0 },11      { "id": "d2", "label": "HL main", "venue": "hyperliquid", "network": "mainnet", "kind": "venue", "real": true, "mode": "MANUAL", "equity": null, "collateral": null, "marginUsed": null, "unrealizedPnl": null, "asOf": null, "halt": "owner", "divergence": null, "positions": 1, "openOrders": 2 }12    ],13    "totals": { "agentsLiveUsd": 512.34, "agentsPaperUsd": 0, "derivVenueUsd": 0, "derivPaperUsd": 10000, "derivTestnetUsd": 0 },14    "counts": { "agents": { "LIVE": 1, "PAPER_TRADING": 1 }, "openPositions": { "agents": 2, "derivatives": 1 }, "openOrders": { "agents": 0, "derivatives": 2 } },15    "wallet": { "usd": null, "cad": null, "assets": 3, "unpriced": 0, "unavailable": 1 }16  },17  "pnl": {18    "asOf": 1795000000000, "tz": "America/Toronto", "note": "flows_included",19    "agents": [ { "id": "a1", "name": "Momentum 1", "mode": "LIVE", "real": true, "state": "LIVE", "today": { "abs": 1.25, "pct": 0.24, "partial": false, "from": 1794960000000 }, "d7": { "abs": -3, "pct": null, "partial": true, "from": 1794700000000 }, "d30": null, "equity": 512.34, "asOf": 1794999990000 } ],20    "derivatives": [ { "id": "d1", "label": "Paper 1", "kind": "paper", "real": false, "today": null, "d7": null, "d30": null, "equity": null, "asOf": null } ]21  },22  "exposure": {23    "asOf": 1795000000000, "caveat": "spot_and_perp_differ",24    "real": [ { "asset": "BTC", "spotUsd": 100.5, "perpLongUsd": 0, "perpShortUsd": 50, "netUsd": 50.5, "grossUsd": 150.5, "priced": true } ],25    "simulated": [ { "asset": "ETH", "spotUsd": 0, "perpLongUsd": 0, "perpShortUsd": 0, "netUsd": 0, "grossUsd": 0, "priced": false } ]26  },27  "health": {28    "asOf": 1795000000000,29    "connectors": [30      { "id": "signer", "group": "signer", "name": "Signer", "ok": true, "lastSuccessAt": 1795000000000, "detail": "answering", "ageSec": 0 },31      { "id": "rpc:base", "group": "rpc", "name": "Base", "ok": null, "lastSuccessAt": null, "detail": "not checked yet", "ageSec": null },32      { "id": "bridge:circle", "group": "bridge", "name": "Circle attestation (CCTP)", "ok": false, "lastSuccessAt": 1794990000000, "detail": "1 transfer(s) awaiting attestation", "ageSec": 10000 }33    ],34    "loops": [ { "name": "tracker", "everyMs": 15000, "runs": 120, "lastOkAt": 1794999990000, "lastErrorAt": null, "lastError": null, "failures": 0, "ageSec": 10, "late": false } ],35    "loopsNote": null,36    "quotes": { "connections": 1, "subscriptions": 4, "messagesPerSec": 12.5, "conflated": 0, "tradesDropped": 0, "upstreamReconnects": 1, "metered": null, "lagMs": { "samples": 0, "p50": null, "p95": null },37      "venues": [ { "venue": "hyperliquid", "status": "connected", "ageMs": 120, "transport": "stream", "feeds": 3, "reconnects": 1, "gaps": 0 }, { "venue": "spot", "status": "idle", "ageMs": null, "transport": "poll", "feeds": 0, "reconnects": 0, "gaps": 0 } ] },38    "marketData": { "apibricks": { "provider": "apibricks", "configured": false, "needsKey": true, "missing": ["APIBRICKS_API_KEY"] } },39    "backup": { "visible": false, "lastAt": null, "files": 0, "ageHours": null },40    "disk": null,41    "audit": { "checkedAt": 1794999900000, "total": 1234, "intact": true, "brokenAt": null },42    "signer": { "reachable": true, "halted": false },43    "versions": { "apiCommit": null, "apiVersion": "1.0.0", "node": "v24.1.0", "startedAt": 1794900000000, "signerKeyId": "spw-0123456789abcdef", "signerPolicyVersion": 4 },44    "capabilities": [ { "id": "deriv_live_mainnet", "on": false, "missing": ["SPW_DERIV_LIVE_MAINNET"], "why": "SPW_DERIV_LIVE_MAINNET is not \"on\"" }, { "id": "broadcast", "on": true, "missing": [], "why": "signed transactions are relayed to the networks" } ],45    "lab": { "mode": "sandbox-exec", "ok": true, "reason": null, "checkedAt": 1794999000000, "lastFailureAt": null, "lastFailure": null, "calls": 12, "refused": 0 }46  },47  "streamStats": {48    "ts": 1795000000000, "protocol": 1,49    "connections": { "open": 1, "byPrincipal": { "owner": 1 }, "total": 5, "refused": 0 },50    "subscriptions": 4, "messagesPerSec": 12.5, "messagesSent": 1000, "bytesSent": 250000,51    "backpressure": { "queuedNow": 0, "conflated": 3, "tradesDropped": 0, "bookResyncs": 0, "slowConsumersClosed": 0 },52    "clients": { "deadPeers": 0, "badFrames": 0, "rateLimited": 0, "restricted": 0, "unauthorizedClosed": 1 },53    "tickets": { "issued": 0, "used": 0, "refused": 0, "pending": 0 },54    "upstreamReconnects": 1, "lagMs": { "samples": 10, "p50": 35, "p95": 120 },55    "limits": { "maxConnectionsOwner": 12, "maxConnectionsPerKey": 4, "maxConnectionsTotal": 200, "maxSubscriptions": 300, "maxFrameBytes": 16384, "maxMessagesPerSec": 20, "idleTimeoutMs": 120000, "heartbeatMs": 15000, "recheckMs": 30000, "ticketTtlMs": 30000, "lowWaterBytes": 262144, "highWaterBytes": 4194304, "overMs": 10000 },56    "hub": { "channels": 4, "channelsByType": { "quote": 3, "book": 1, "trades": 0, "candle": 0 }, "feeds": 4, "listeners": 5, "counters": { "quote": 900 }, "venues": [] },57    "metered": null58  }59}60
Files main
Menu

Theme