OpenByteInc/QuantDinger
AI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
QuantDinger – Open‑source AI‑powered Trading Operating System
What it is – QuantDinger is a self‑hosted platform that lets you turn a trading idea into a full‑stack workflow: write the strategy in Python, back‑test it, run paper‑trading simulations, and (optionally) execute live orders on crypto exchanges or traditional brokers. The stack is built around AI‑assisted market research, so you can plug in LLM providers (OpenAI‑compatible, Google, DeepSeek, etc.) to generate signals or enrich data, but the actual strategy code, risk parameters and credentials stay under your control.
Core components
| Component | Role |
|---|---|
| API (Flask + Gunicorn) | HTTP entry point, authentication, validation, and durable command submission. |
| Trading worker | Hosts long‑lived strategy runtimes, maintains broker sessions, reconciles orders, and writes leases/heart‑beats to PostgreSQL. |
| Scheduler worker | Drives portfolio‑level schedules, payments and signal timing. |
| Celery workers + beat | Executes finite, retryable jobs such as AI‑driven research, back‑tests, experiment reports and maintenance tasks. |
| PostgreSQL | Persistent state: user accounts, strategy definitions, audit logs, order history. |
| Redis (cache & jobs) | Fast cache for market data and a separate Redis instance for Celery job queues. |
| Observability stack (optional) | Prometheus collects metrics, Grafana visualises them, Alertmanager handles alerts. |
| Agent Gateway / MCP | A thin API (/api/agent/v1) that lets external AI agents (e.g., Claude, Cursor) call approved trading tools without exposing credentials. |
Architecture at a glance
The system runs as a set of Docker containers that share a single image but start with different commands (backend, trading‑worker, scheduler‑worker, celery‑worker, etc.). Runtime boundaries are explicit:
- HTTP API never runs long‑lived loops – those live in dedicated workers.
- Celery handles short‑lived, retryable tasks; the trading worker owns the persistent strategy runtime.
- Separate Redis instances enforce different eviction policies for cache vs. job queues.
- Production overlays run containers as a non‑root user, with a read‑only root filesystem and limited Linux capabilities.
A simplified flow:
- Strategy author writes a Python module that implements the Strategy API V2 (signals, sizing, risk). The code is stored in the database.
- AI provider (OpenRouter, OpenAI, etc.) can be called from the strategy or from separate “research” Celery jobs to fetch sentiment, news or generate ideas.
- Back‑test jobs run in Celery, pulling historic market data from the data‑source adapters and storing results.
- Paper/live execution is performed by the trading worker, which talks to exchange adapters (Binance, OKX, Bybit, Gate, HTX) or broker APIs (IBKR, Alpaca).
- Monitoring – metrics flow to Prometheus; dashboards in Grafana show order flow, latency, and health.
Getting started (quick‑start)
Option A – Pre‑built Docker images (recommended)
# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/OpenByteInc/QuantDinger/main/install.sh | bash
# Windows PowerShell
irm https://raw.githubusercontent.com/OpenByteInc/QuantDinger/main/install.ps1 | iex
The installer prompts for an admin username/password, generates secrets, pulls the GHCR Compose stack and starts it. Afterward you can open:
- Web UI – http://127.0.0.1:8888
- Mobile H5 UI – http://127.0.0.1:8889
- API health – http://127.0.0.1:5000/api/health
Option B – Build from source
git clone https://github.com/OpenByteInc/QuantDinger.git
cd QuantDinger
cp backend_api_python/env.example backend_api_python/.env
cp .env.example .env
# edit the .env files – set SECRET_KEY, CREDENTIAL_ENCRYPTION_KEY, ADMIN_*, POSTGRES_PASSWORD, REDIS_PASSWORD, etc.
python -c "import secrets, sys; print(secrets.token_hex(32))" # generate random secrets
docker compose up -d --build # starts core services (no observability stack)
For a full production‑hardening setup add docker‑compose.production.yml and optionally docker‑compose.observability.yml.
Security & compliance highlights
- Credential encryption – broker API keys and MFA secrets are encrypted at rest with a user‑provided
CREDENTIAL_ENCRYPTION_KEY. - Agent tokens – hashed, scoped, rate‑limited and audit‑logged; live trading via agents requires an explicit token,
paper_only=false, and the server flagAGENT_LIVE_TRADING_ENABLED=true. - Container hardening – non‑root UID (10001), dropped capabilities, read‑only root FS, and resource limits in the production overlay.
- Network posture – all ports bind to
127.0.0.1by default; public exposure should be via a TLS‑terminating reverse proxy. - Vulnerability reporting – see
SECURITY.mdfor the private disclosure process.
Who might use it?
| Use case | What QuantDinger provides |
|---|---|
| Independent quant trader | End‑to‑end pipeline (research → back‑test → paper → live) with full code ownership. |
| AI‑augmented strategy developer | Built‑in hooks to call LLMs for sentiment, news summarisation or idea generation. |
| Small fintech team | Containerised, self‑hosted stack that can be run on a single VM or scaled with Kubernetes. |
| Researcher prototyping agents | Agent Gateway / MCP lets you expose tool‑calling APIs to external LLMs without leaking credentials. |
| Educator / hobbyist | One‑command installer and extensive docs (indicator guide, strategy guide, extension guide) make it easy to experiment. |
License & community
- License: Apache 2.0 – permissive, commercial‑friendly.
- Supported by: Atlas Cloud (AI inference) and Amazon Web Services (cloud infra).
- Community channels: Telegram, Discord, YouTube, X (Twitter) – links in the README.
- Documentation: English and Chinese docs, API reference, architecture diagrams, and step‑by‑step deployment guides.
Bottom line
QuantDinger is a genuine, production‑grade open‑source project that combines traditional algorithmic‑trading infrastructure with AI‑driven research and agent integration. It is not a simple demo; the repository contains a full backend, worker processes, CI pipelines, security hardening, and optional observability. If you need a self‑hosted, extensible platform to develop, test and run AI‑enhanced trading strategies, QuantDinger is a solid starting point.
Related
- Project
- Project
- Project
- Project
- Project