Barfinex

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)

MethodPath (on Inspector)Description
GET/inspector/optionsCurrent Inspector options
PUT/inspector/optionsUpdate options (body: { options })
GET/inspector/healthHealth check (ok, connectors, timestamp)
GET/inspector/risk/dashboardFull risk dashboard (KPI, runtime positions, audit tail)
GET/inspector/risk/kpiRisk KPI snapshot only
GET/inspector/risk/runtime-positionsRuntime-managed positions
GET/inspector/risk/pricesLatest prices from risk engine cache
GET/inspector/risk/liquidityLatest liquidity snapshots
GET/inspector/risk/auditLive audit tail (query: limit, default 200)
GET/inspector/risk/audit/questdbRisk audit from QuestDB (query: limit, default 200)

Via Provider proxy

ResourceExample Provider path
OptionsGET /api/inspectors/:appKey/inspector/options, PUT .../inspector/options
HealthGET /api/inspectors/:appKey/inspector/health
Risk dashboardGET /api/inspectors/:appKey/inspector/risk/dashboard
KPIGET /api/inspectors/:appKey/inspector/risk/kpi
Runtime positionsGET /api/inspectors/:appKey/inspector/risk/runtime-positions
PricesGET /api/inspectors/:appKey/inspector/risk/prices
LiquidityGET /api/inspectors/:appKey/inspector/risk/liquidity
Live auditGET /api/inspectors/:appKey/inspector/risk/audit?limit=200
QuestDB auditGET /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

Let’s Get in Touch

Have questions or want to explore Barfinex? Send us a message.