Blog
How Barfinex Works: A Five-Service Market Infrastructure
Provider, Detector, Advisor, Inspector, and Studio form a traceable workflow for market data, signals, decision support, risk checks, and observability.

The Core Idea
Each stage of trading gets its own service. Services talk through typed events. Every decision is traceable.
This means you can update a strategy without restarting the data feed. Adjust risk rules without touching the policy stage. Trace any candidate action back to the signal, signed evidence, policy basis, and risk check that produced it.
The Five Services
Provider — Your Data Foundation
Provider is the single source of truth for all market data. No other service talks to exchanges directly.
What it does for you:
- Connects to exchanges (Binance, Alpaca, more via plugins)
- Normalizes data into clean OHLCV candles
- Detects and repairs data gaps automatically
- Exposes one unified API — the only endpoint you need
Detector — Your Strategy Engine
This is where your trading logic lives. You define rules, weights, and thresholds as a TypeScript config.
- Evaluates rules on every new candle
- Scores conditions and emits signals only when the threshold is met
- Shows exactly which rules fired and why (full attribution)
- Multiple strategies run in parallel, isolated from each other
Advisor — The Deterministic Policy Boundary
Advisor has one narrow job:
- Validate an immutable Detector candidate and signed Provider evidence
- Apply a pinned deterministic admission policy
- Record
ADMITorREJECTwith an immutable basis - Hand admitted candidates to Inspector through a durable outbox
It does not call AI, analyze the market, score conviction, size positions, manage risk, or place orders.
Inspector — Your Risk Manager
No admitted candidate should proceed without Inspector's approval and final sizing. It checks:
- Position size limits
- Portfolio exposure caps
- Drawdown thresholds
- Loss streak limits
- Cooldown periods
Where enabled by the deployment, it can also coordinate stop-loss and take-profit controls.
Studio — Your Dashboard
Real-time view of the entire pipeline:
- Live charts with signal overlays
- Advisor policy decisions and lifecycle traces
- Risk dashboard with active positions
- Capital efficiency metrics
Studio is read-only — it observes but doesn't control.
How Data Flows
Exchange/data source → Provider → Detector → Advisor → Inspector → downstream action
↓
Studio (observes everything)
Every arrow is a typed event with a timestamp and audit record.
Deployment
Local and production-like deployment commands live in the current repository runbooks. Each service can also run on separate infrastructure as a deployment matures.