How Barfinex Works
Inspector API reference
REST API of the Barfinex Inspector: options, health, risk dashboard, KPI, runtime positions, prices, liquidity, and audit.
Overview
The Inspector exposes a REST API for configuration, health, risk dashboard, KPI, runtime positions, cached prices, liquidity snapshots, and audit (live and QuestDB).
- Base URL when called via Provider:
GET|PUT /api/inspectors/:appKey/...(e.g.appKey=inspector) - Direct base URL:
{inspectorUrl}/api(default port 8008)
All paths below are relative to /api. When using the Provider proxy, the path prefix is /api/inspectors/:appKey/inspector/... as in the table.
REST endpoints (summary)
| Method | Path (on Inspector) | Description |
|---|---|---|
| GET | /inspector/options | Current Inspector options |
| PUT | /inspector/options | Update options (body: { options }) |
| GET | /inspector/health | Health check (ok, connectors, timestamp) |
| GET | /inspector/risk/dashboard | Full risk dashboard (KPI, runtime positions, audit tail) |
| GET | /inspector/risk/kpi | Risk KPI snapshot only |
| GET | /inspector/risk/runtime-positions | Runtime-managed positions |
| GET | /inspector/risk/prices | Latest prices from risk engine cache |
| GET | /inspector/risk/liquidity | Latest liquidity snapshots |
| GET | /inspector/risk/audit | Live audit tail (query: limit, default 200) |
| GET | /inspector/risk/audit/questdb | Risk audit from QuestDB (query: limit, default 200) |
Via Provider proxy
| Resource | Example Provider path |
|---|---|
| Options | GET /api/inspectors/:appKey/inspector/options, PUT .../inspector/options |
| Health | GET /api/inspectors/:appKey/inspector/health |
| Risk dashboard | GET /api/inspectors/:appKey/inspector/risk/dashboard |
| KPI | GET /api/inspectors/:appKey/inspector/risk/kpi |
| Runtime positions | GET /api/inspectors/:appKey/inspector/risk/runtime-positions |
| Prices | GET /api/inspectors/:appKey/inspector/risk/prices |
| Liquidity | GET /api/inspectors/:appKey/inspector/risk/liquidity |
| Live audit | GET /api/inspectors/:appKey/inspector/risk/audit?limit=200 |
| QuestDB audit | GET /api/inspectors/:appKey/inspector/risk/audit/questdb?limit=200 |
Dashboard response typically includes kpi (equity, drawdown, daily PnL, closed trades, wins/losses, consecutive losses, stress mode), runtimePositions, activeRuntimeManaged, and auditTail.
Events (for integrators)
The Inspector consumes market and order events from the event bus and publishes risk events. For real-time risk and market data in your app, use the Provider WebSocket (/ws) and subscribe to events such as INSPECTOR_RISK_LIMIT_BREACH, INSPECTOR_RISK_KILL_SWITCH, and other INSPECTOR_* types. You do not need to connect to the Inspector or the bus directly.
Next steps
- Inspector overview — Role and setup
- Inspector risk policies — Configuration options
- Provider API reference — Proxy and WebSocket