Barfinex

How Barfinex Works

Detector API reference

REST API of the Barfinex Detector: detector selection, health, state, options, accounts, trades, performance, plugins, and risk close-position.

Overview

The Detector is the signal engine. Its REST API is used to select the active detector, read state and performance, manage plugins, and request position closure for risk.

  • Base URL when called via Provider: GET|POST /api/detectors/:appKey/... (e.g. appKey = detector)
  • Direct base URL: {detectorUrl}/api (default port 8101)

All paths below are relative to /api. When using the Provider proxy, the path becomes /api/detectors/:appKey/detector/... or /api/detectors/:appKey/risk/... as in the table.


REST endpoints (summary)

MethodPath (on Detector)Description
GET/detector/selectSwitch active detector (query: sysName)
GET/detector/activeGet active detector
GET/detector/healthHealth check and readiness
GET/detector/stateFull state (options, performance, timestamp)
GET/detector/optionsCurrent and previous detector options
GET/detector/accountsDetector accounts
GET/detector/trades/lastLast trades by symbol
GET/detector/performancePerformance metrics of active detector
POST/detector/plugins/:studioGuid/installInstall plugin
GET/detector/plugins/installedList installed plugins
GET/detector/plugins/:studioGuidPlugin details
POST/risk/close-positionClose position for risk (body: symbol, connectorType, marketType, side?, quantity?, reason)

Via Provider proxy

ResourceExample Provider path
Select detectorGET /api/detectors/:appKey/detector/select?sysName=...
Active detectorGET /api/detectors/:appKey/detector/active
HealthGET /api/detectors/:appKey/detector/health
StateGET /api/detectors/:appKey/detector/state
OptionsGET /api/detectors/:appKey/detector/options
AccountsGET /api/detectors/:appKey/detector/accounts
Last tradesGET /api/detectors/:appKey/detector/trades/last
PerformanceGET /api/detectors/:appKey/detector/performance
PluginsPOST /api/detectors/:appKey/detector/plugins/:studioGuid/install, GET .../plugins/installed, GET .../plugins/:studioGuid
Close positionPOST /api/detectors/:appKey/risk/close-position

Plugin endpoints may require authentication (e.g. user context). Risk close-position request body includes symbol, connectorType, marketType, optional side, quantity, and reason; response includes success, optional orderId, symbol, side, closedQuantity, or error message.


Events (for integrators)

The Detector consumes market and account events from the event bus (from Provider) and risk events (from Inspector). It publishes signal and position-request events. For real-time data in your app, use the Provider WebSocket (/ws); you do not need to connect to the Detector or the bus directly. Subscribe to events such as DETECTOR_SIGNAL_GENERATED, DETECTOR_SIGNAL_UPDATED, DETECTOR_SIGNAL_INVALIDATED, and position request events.


Next steps

Let’s Get in Touch

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