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)
| Method | Path | Description |
|---|---|---|
| GET | /advisor-agent/health | Health and orchestrator state |
| GET | /advisor-agent/metrics | Metrics: orchestrator, open signals, locks |
| GET | /advisor-agent/signals/open | Open signals in memory (query: limit) |
| GET | /advisor-agent/locks | Active symbol locks |
| GET | /advisor-agent/setup/history | Setup memory history (query: symbol, limit) |
| GET | /advisor-agent/prompt/active | Active prompt policy |
| GET | /advisor-agent/prompt/history | Prompt history |
| GET | /advisor-agent/context/price | Last price from context (query: symbol) |
| GET | /advisor-agent/audit/questdb | QuestDB audit (query: table, limit) |
| GET | /advisor-agent/llm/decision | Trigger LLM decision for symbol (query: symbol) |
| POST | /advisor-agent/orchestrator/run-once | Run one orchestrator cycle manually |
Financial recommendations
| Method | Path | Description |
|---|---|---|
| POST | /financial-recommendations/trading-advice | Trading advice (body: instrument) |
| POST | /financial-recommendations/portfolio-optimization | Portfolio optimization (body: portfolio) |
| POST | /financial-recommendations/scenario-analysis | Scenario analysis (body: scenario) |
News and financial data
| Method | Path | Description |
|---|---|---|
| GET | /news/fetch | Fetch news (query: query) |
| GET | /news/sentiment | News sentiment (query: query) |
| GET | /financial-api/price | Current price (query: instrument) |
| GET | /financial-api/historical | Historical data (query: instrument) |
Recommendations
| Method | Path | Description |
|---|---|---|
| GET | /recommendations/signals | Signal recommendations (query: instrument) |
| GET | /recommendations/portfolio | Portfolio 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/healthGET /api/advisors/:appKey/advisor-agent/metricsGET /api/advisors/:appKey/advisor-agent/signals/openGET /api/advisors/:appKey/advisor-agent/context/price?symbol=BTCUSDTGET /api/advisors/:appKey/advisor-agent/llm/decision?symbol=BTCUSDTPOST /api/advisors/:appKey/advisor-agent/orchestrator/run-oncePOST /api/advisors/:appKey/financial-recommendations/trading-adviceGET /api/advisors/:appKey/news/fetch,GET .../news/sentimentGET /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
- Advisor overview — Role and setup
- Provider API reference — Proxy and WebSocket