📡 Open source · MPL 2.0

An open source crypto trading agent, self-hosted, BYO keys

Farol cross-checks 11 technical indicators with 14 news sources, Smart Money Concepts (Order Blocks, FVG, BOS), macro context (DXY, SPX, Fear & Greed) and derivatives data. The agent runs every hour, persists structured signals in SQLite, and you decide whether to trade. Clone, configure your Binance API key, run docker compose up.

MPL 2.0 license · Built in the EU · 8 tokens covered · Self-hosted Docker · No telemetry, no SaaS, no third party touches your keys.

Run it locally in 3 steps

No SaaS sign-up, no API key to anyone but Binance, no third party reading your trades. The agent runs on your machine (or your VPS) and reports to no one.

1

Clone the repo

git clone the repository, cp .env.example .env, paste your Binance API key (spot trading only, no withdraw permissions) and an LLM API key (Anthropic, Google AI, OpenRouter — your call).

2

Run docker compose up

Single docker compose up -d brings up the agent container + SQLite volume. Cron runs every hour. Logs stream locally. You can verify by curling the local /api/health endpoint.

3

Read, decide, act

The agent persists structured signals (direction bias, indicator vote, news sentiment, SMC patterns, LLM rationale). You read them via local API, dashboard or by querying SQLite. Trade execution is opt-in and stays under your control.

Architecture

Inside the agent

Four analysis layers run every hour, in parallel where possible, and feed a final LLM decision. Every output is structured JSON, persisted in SQLite. Read the source — it's open.

Technical analysis (TA)

11 indicators voting on each token: RSI, MACD, EMA crossovers, Bollinger Bands, Stoch RSI, ADX, MFI, CCI, VWAP, ATR direction, candle pattern. Plus an Ensemble score and a Holt-Winters forecast (ETS). Deterministic, no LLM here.

sample response
{
  "tendance": "BAISSIER",
  "haussiers": 3, "baissiers": 8, "neutres": 0,
  "rsi": 28.4,
  "macd_cross": "bearish",
  "adx_force": "FORT",
  "ensemble_score": -0.62
}

News sentiment

14 RSS feeds polled every cycle, deduplicated by URL hash. An LLM reads only new articles and returns a sentiment score per token. If no new articles, zero LLM calls.

sample response
{
  "sentiment": "NEGATIF",
  "score": -0.42,
  "nb_articles_new": 7,
  "summary": "ETF outflows
   accelerating, regulatory
   pressure rising"
}

Smart Money Concepts

Detect Break of Structure (BOS), Order Blocks, Fair Value Gaps from OHLCV swings. Outputs a bias score [-100, +100] and a summary string injected directly into the trader's prompt — making whale movements visible to the model.

sample response
{
  "bias": -65,
  "bos": "BEAR",
  "order_blocks": 2,
  "fvg_count": 1,
  "summary": "Recent BOS
   bearish, institutional
   sell zone 67200-68100"
}

LLM trader decision

Final synthesis: a multi-source prompt is sent to an LLM (Workers AI Llama, Claude Haiku, Gemini Flash — your choice) with the regime context, open positions, last 3 decisions, and SMC patterns. Output is a typed JSON: BUY / SELL / HOLD with confidence score [20-99].

sample response
{
  "token": "BTC",
  "direction": "SELL",
  "score_confiance": 75,
  "raison": "BOS bearish
   + 8/11 indicators bearish
   + funding > 0.06%",
  "model": "llama-3.3-70b"
}
Quick start
terminal · 3 commands
# 1. Clone the repo
git clone https://github.com/FredericoRB/farol  # TBD
cd farol

# 2. Configure your keys
cp .env.example .env
# edit .env — add BINANCE_API_KEY (spot only),
#             ANTHROPIC_API_KEY (or OPENROUTER_API_KEY)

# 3. Run the agent
docker compose up -d
docker compose logs -f agent

Why open source

Crypto trading SaaS is a regulatory minefield (MiCA, PSAN, MiFID II). Rather than play the compliance game, Farol publishes the agent logic — you run your own copy, with your own keys, in your own jurisdiction. No central operator means no central risk.

Multi-source synthesis

11 technical indicators × 14 news feeds × Smart Money Concepts × derivatives (funding, OI) × macro (DXY, SPX, F&G). Cross-checked so one noisy source doesn't skew the read.

Hourly, never sleeps

The cron runs every hour on your container. No stale cache, no rate limits from a SaaS, no shared rate-limit pool with thousands of users.

Structured, not prose

Each output is typed JSON: direction bias, confidence score, indicator vote, SMC bias. Persisted in SQLite. Plug it into your own dashboard, alerts, or trading bot.

You stay in control

Your Binance API key never leaves your machine. The agent can run paper-only or wire trade execution under strict safeguards (rate limits, hard caps, daily loss circuit breaker). No copy-trading, no service, no central account.

STAY IN THE LOOP

Follow the project on GitHub

Star the repo to follow updates, file issues for bugs or feature requests, open PRs to contribute. The repo will be linked from the CTA above once the public release lands (Phase 4 of the roadmap).

View on GitHub

Public repo coming soon — repo URL will appear here.

FAQ

Do I need an exchange account? +
Yes — you bring your own Binance API key (spot trading only, withdraw disabled). The agent reads market data via public Binance endpoints (no key needed for reads) and only uses your key if you opt into live trade execution. In paper mode, no key is required at all.
Is my Binance API key safe? +
Your key never leaves your container. It's loaded from .env into the agent process and used only to call Binance. There is no central server, no telemetry, no third party in the path. Use IP whitelisting on the Binance side if you run on a fixed-IP VPS for extra defense.
Can I run multiple tokens? +
Yes — by default the agent runs 8 tokens (BTC, ETH, SOL, APT, ARB, AVAX, OP, DOGE). You can edit the token list in src/config.ts. Each token is processed in parallel within the cron run.
What LLM does the agent use? +
Configurable: Claude (Anthropic), Gemini (Google AI Studio), Llama (Workers AI or OpenRouter), or any provider with an OpenAI-compatible API. Default config uses a free-tier model. Switch via .env. The prompt is structured to work with most modern instruction-tuned models.
How do I update the agent? +
git pull && docker compose up -d --build. Database migrations run on startup. Breaking changes are documented in CHANGELOG.md.
Is paper trading or live trading the default? +
Paper trading is the default. Live execution requires explicit opt-in (LIVE_TRADING_ENABLED=true in .env) plus your Binance API key. Several safeguards are wired in: hard caps per token, daily loss circuit breaker, error-burst auto-disable. Read src/analysis/risk-manager.ts before flipping the flag.
Can I contribute? +
Yes, please. Issues, PRs and discussions are open. The license is MPL 2.0 (file-level copyleft) — your modifications to existing files must stay open, but you can combine the agent with proprietary code freely. See CONTRIBUTING.md.
Why open source instead of a SaaS? +
Crypto trading services in the EU fall under MiCA / MiFID II / PSAN regulations. As a solo developer, the compliance cost (legal advice, registration, reporting) is prohibitive. Publishing the code under MPL 2.0 lets the project exist legally while letting users self-host with their own jurisdiction's rules.