Barfinex

How Barfinex Works

Advisor API reference

REST API of the Barfinex Advisor: health, metrics, open signals, locks, setup history, prompts, context price, LLM decision, audit, recommendations, news, and financial data.

Overview

The Advisor exposes a REST API for health, metrics, open signals, symbol locks, setup history, active prompt, context price, on-demand LLM decision, audit, and for financial recommendations, news, and portfolio endpoints.

  • Base URL when called via Provider: GET|POST /api/advisors/:appKey/... (e.g. appKey = advisor)
  • Direct base URL: {advisorUrl}/api (default port 8009)

All paths below are relative to /api. When using the Provider proxy, the path prefix is /api/advisors/:appKey/... (no extra segment like advisor-agent in the path after the appKey in the proxy matrix). Check Provider docs for the exact proxy path; typically it is /api/advisors/:appKey/advisor-agent/... for the agent and /api/advisors/:appKey/... for the rest.


REST endpoints (summary)

Advisor Agent (signal agent)

MethodPathDescription
GET/advisor-agent/healthHealth and orchestrator state
GET/advisor-agent/metricsMetrics: orchestrator, open signals, locks
GET/advisor-agent/signals/openOpen signals in memory (query: limit)
GET/advisor-agent/locksActive symbol locks
GET/advisor-agent/setup/historySetup memory history (query: symbol, limit)
GET/advisor-agent/prompt/activeActive prompt policy
GET/advisor-agent/prompt/historyPrompt history
GET/advisor-agent/context/priceLast price from context (query: symbol)
GET/advisor-agent/audit/questdbQuestDB audit (query: table, limit)
GET/advisor-agent/llm/decisionTrigger LLM decision for symbol (query: symbol)
POST/advisor-agent/orchestrator/run-onceRun one orchestrator cycle manually

Financial recommendations

MethodPathDescription
POST/financial-recommendations/trading-adviceTrading advice (body: instrument)
POST/financial-recommendations/portfolio-optimizationPortfolio optimization (body: portfolio)
POST/financial-recommendations/scenario-analysisScenario analysis (body: scenario)

News and financial data

MethodPathDescription
GET/news/fetchFetch news (query: query)
GET/news/sentimentNews sentiment (query: query)
GET/financial-api/priceCurrent price (query: instrument)
GET/financial-api/historicalHistorical data (query: instrument)

Recommendations

MethodPathDescription
GET/recommendations/signalsSignal recommendations (query: instrument)
GET/recommendations/portfolioPortfolio recommendations (query: userId)

Via Provider proxy

Use the Provider proxy paths listed in the Provider API reference (proxy-ready endpoint matrix). Examples:

  • GET /api/advisors/:appKey/advisor-agent/health
  • GET /api/advisors/:appKey/advisor-agent/metrics
  • GET /api/advisors/:appKey/advisor-agent/signals/open
  • GET /api/advisors/:appKey/advisor-agent/context/price?symbol=BTCUSDT
  • GET /api/advisors/:appKey/advisor-agent/llm/decision?symbol=BTCUSDT
  • POST /api/advisors/:appKey/advisor-agent/orchestrator/run-once
  • POST /api/advisors/:appKey/financial-recommendations/trading-advice
  • GET /api/advisors/:appKey/news/fetch, GET .../news/sentiment
  • GET /api/advisors/:appKey/recommendations/signals, GET .../recommendations/portfolio

Events (for integrators)

The Advisor subscribes to detector signals and optional decision requests on the event bus and publishes decision responses and context snapshots. For real-time decisions in your app, use the Provider WebSocket (/ws) and subscribe to ADVISOR_DECISION_RESPONSE, ADVISOR_DECISION_CONTEXT_SNAPSHOT, and related events. You do not need to connect to the Advisor or the bus directly.


Next steps

Let’s Get in Touch

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