{"id":51075826,"url":"https://github.com/steliosk98/binance-quanttradingdashboard","last_synced_at":"2026-06-23T14:01:50.033Z","repository":{"id":364205041,"uuid":"1265428551","full_name":"steliosk98/Binance-QuantTradingDashboard","owner":"steliosk98","description":"Self-hosted crypto quant research terminal — live Binance market data, TimescaleDB time series, technical/statistical analytics, vectorized backtesting, testnet-only paper trading. Bloomberg-style mission-control UI.","archived":false,"fork":false,"pushed_at":"2026-06-12T04:10:39.000Z","size":6511,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T05:16:00.601Z","etag":null,"topics":["backtesting","binance","crypto","dashboard","fastapi","quant","react","timescaledb","trading","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steliosk98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T19:08:43.000Z","updated_at":"2026-06-12T04:08:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/steliosk98/Binance-QuantTradingDashboard","commit_stats":null,"previous_names":["steliosk98/binance-quanttradingdashboard"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/steliosk98/Binance-QuantTradingDashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steliosk98%2FBinance-QuantTradingDashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steliosk98%2FBinance-QuantTradingDashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steliosk98%2FBinance-QuantTradingDashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steliosk98%2FBinance-QuantTradingDashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steliosk98","download_url":"https://codeload.github.com/steliosk98/Binance-QuantTradingDashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steliosk98%2FBinance-QuantTradingDashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34692781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtesting","binance","crypto","dashboard","fastapi","quant","react","timescaledb","trading","websocket"],"created_at":"2026-06-23T14:01:45.147Z","updated_at":"2026-06-23T14:01:50.028Z","avatar_url":"https://github.com/steliosk98.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/banner.svg\" alt=\"CryptoQuant Terminal\" width=\"100%\"/\u003e\n\n**A self-hosted crypto quant research terminal powered by the Binance API.**\nLive market data · technical \u0026 statistical analytics · vectorized backtesting · testnet paper trading — in a Bloomberg-style mission-control UI.\n\n[![CI](https://github.com/steliosk98/Binance-QuantTradingDashboard/actions/workflows/ci.yml/badge.svg)](https://github.com/steliosk98/Binance-QuantTradingDashboard/actions/workflows/ci.yml)\n![Python](https://img.shields.io/badge/Python-3.12-3776AB?logo=python\u0026logoColor=white)\n![React](https://img.shields.io/badge/React-19-61DAFB?logo=react\u0026logoColor=black)\n![FastAPI](https://img.shields.io/badge/FastAPI-async-009688?logo=fastapi\u0026logoColor=white)\n![TimescaleDB](https://img.shields.io/badge/TimescaleDB-hypertables-FDB515)\n![License](https://img.shields.io/badge/License-MIT-8B5CF6)\n![Trading](https://img.shields.io/badge/trading-testnet%20only-ef5350)\n\n\u003cimg src=\"docs/screenshots/hero-dashboard.png\" alt=\"CryptoQuant dashboard — live watchlist with sparklines, regime labels, funding extremes and correlation heatmap\" width=\"100%\"/\u003e\n\n\u003c/div\u003e\n\n\u003e **Research tool. Not financial advice. There is no live-money trading mode — order execution targets Binance Spot Testnet only, by design.**\n\n---\n\n## Highlights\n\n- 📡 **Live everything** — Binance WebSocket ingestion with auto-reconnect, order-book sync (snapshot + diff, full resync on gaps), sub-second chart ticks, streaming ticker tape, liquidation \u0026 whale feeds\n- 🗄️ **Time-series storage done right** — TimescaleDB hypertables, idempotent gap-repairing backfill (2 years of candles, exact to the bar), compression \u0026 retention policies\n- 📈 **A real analytics engine** — Wilder-exact RSI/ATR/ADX, MACD, Bollinger, VWAP, Ichimoku, 3 realized-vol estimators, Hurst exponent, ADF \u0026 Engle-Granger cointegration, order-book imbalance + CVD, per-symbol **market regime classification**\n- ⚡ **Vectorized backtesting** — 6 built-in strategies with auto-generated parameter forms, fees + slippage, full metric suite, **walk-forward optimization with in-sample vs out-of-sample shown side by side** (2 years of hourly candles in \u003c1s)\n- 🤖 **Paper trading with guardrails** — strategy instances run live against closed candles on Binance Testnet (or internal sim fills), with max-position \u0026 daily-loss guards and a kill switch that halts within one evaluation cycle\n- 🔔 **Alert engine** — price crosses, whale trades, liquidation cascades, funding extremes and regime changes evaluated live, with an in-app alert bell and optional **Telegram delivery**\n- 🔁 **Pairs trading** — rolling-hedge-ratio spread engine with z-score entry/exit: dual-leg backtests and simulated paper trading\n- 🎛️ **Parameter optimizer** — 2-param grid search rendering a Sharpe heatmap with one-click apply of the best cell\n- 🛩️ **Autopilot (V3)** — paper instances re-optimize themselves on a schedule via walk-forward grid search, adopting new parameters only when they win out-of-sample\n- 📤 **Research export (V3)** — one-click CSV downloads for candles, backtest trades and equity curves\n- ⌨️ **Command palette \u0026 multi-chart** — ⌘K to jump anywhere, 2×2 live chart grid\n- 🔐 **Single-user auth \u0026 key custody** — argon2 + JWT on every route with login rate-limiting and fail-closed production mode, WS auth without URL tokens, CSP headers, Binance keys Fernet-encrypted at rest and never returned to the client, read-only portfolio view\n- 🖥️ **Terminal-grade UI** — dark mission-control design, JetBrains Mono tabular numerals, price-flash animations, live sparklines, `prefers-reduced-motion` support\n\n## Screenshots\n\n| Chart — indicators, RSI/MACD panes, live order book | Backtest — equity, drawdown, monthly heatmap |\n| :--: | :--: |\n| \u003cimg src=\"docs/screenshots/hero-chart.png\" alt=\"Chart page\"/\u003e | \u003cimg src=\"docs/screenshots/hero-backtest.png\" alt=\"Backtest page\"/\u003e |\n| **Research — distributions, QQ, volatility, cointegration** | **Mission control on mobile** |\n| \u003cimg src=\"docs/screenshots/hero-research.png\" alt=\"Research page\"/\u003e | \u003cimg src=\"docs/screenshots/design-mobile.png\" alt=\"Mobile\" height=\"420\"/\u003e |\n| **V2: parameter optimizer — Sharpe grid with apply-best** | **V2: alert rules + live event log** |\n| \u003cimg src=\"docs/screenshots/v2-optimizer.png\" alt=\"Optimizer heatmap\"/\u003e | \u003cimg src=\"docs/screenshots/v2-alerts.png\" alt=\"Alerts page\"/\u003e |\n| **V2: ⌘K command palette** | **V2: 2×2 live multi-chart grid** |\n| \u003cimg src=\"docs/screenshots/v2-palette.png\" alt=\"Command palette\"/\u003e | \u003cimg src=\"docs/screenshots/v2-multichart.png\" alt=\"Multi-chart grid\"/\u003e |\n\n## Architecture\n\n```mermaid\nflowchart TB\n    subgraph Frontend[\"Frontend — React 19 · Vite · Tailwind\"]\n        UI[\"Lightweight Charts · Plotly · Zustand · TanStack Query\"]\n    end\n\n    subgraph API[\"API — FastAPI\"]\n        REST[\"/api/v1 REST · JWT auth · JSON logs\"]\n        HUB[\"/ws relay hub · per-topic subscriptions\"]\n    end\n\n    subgraph Workers\n        ING[\"Ingestion worker\u003cbr/\u003eBinance WS + REST backfill\u003cbr/\u003eorder-book sync\"]\n        PAPER[\"Paper runner\u003cbr/\u003esignal → guarded order\u003cbr/\u003eTESTNET only\"]\n    end\n\n    subgraph Engines[\"In-process engines\"]\n        ANA[\"Analytics\u003cbr/\u003eindicators · stats · regimes\"]\n        BT[\"Backtester\u003cbr/\u003evectorized · walk-forward\"]\n    end\n\n    subgraph Storage\n        TS[(\"TimescaleDB\u003cbr/\u003ecandles · funding · OI · backtests · orders\")]\n        RD[(\"Redis\u003cbr/\u003ehot state · pub/sub\")]\n    end\n\n    BINANCE[\"Binance\u003cbr/\u003espot + USD-M futures\"] --\u003e|\"WS + REST\"| ING\n    UI --\u003e|HTTPS| REST\n    UI --\u003e|WSS| HUB\n    REST --\u003e ANA \u0026 BT\n    HUB --\u003e RD\n    ING --\u003e TS \u0026 RD\n    PAPER --\u003e TS\n    RD --\u003e|closed candles| PAPER\n    ANA \u0026 BT --\u003e TS\n    PAPER -.-\u003e|orders| TESTNET[\"Binance Spot Testnet\"]\n```\n\n## Quick start\n\nSelf-host the full stack in about 10 minutes — public Binance market data needs **no API key**.\n\n```bash\ngit clone https://github.com/steliosk98/Binance-QuantTradingDashboard.git\ncd Binance-QuantTradingDashboard\ndocker compose up --build        # TimescaleDB, Redis, API, WS worker, paper runner, frontend\n\n# in another shell — load 2 years of history for the 10-symbol watchlist:\ndocker compose exec backend alembic upgrade head\ndocker compose exec backend python -m app.ingestion.backfill\n```\n\n| | |\n|---|---|\n| 🖥️ Terminal | http://localhost:5173 — dev password `cryptoquant-dev` |\n| 📚 API docs | http://localhost:8000/docs |\n| 🚀 Cloud deploy | [docs/DEPLOY.md](docs/DEPLOY.md) — Railway (EU region) + Fly.io guides |\n\n### Local development\n\n```bash\n# Backend (uv · ruff · mypy --strict · pytest)\ncd backend \u0026\u0026 uv sync\nuv run uvicorn app.main:app --reload\nuv run pytest\n\n# Frontend (pnpm · eslint · tsc · vitest · playwright)\ncd frontend \u0026\u0026 pnpm install\npnpm dev\npnpm test \u0026\u0026 pnpm run e2e\n```\n\n## What's inside\n\n### Market data\nRate-limited async Binance client (honors `X-MBX-USED-WEIGHT-1M`, backs off at 80%, retries 429/418 with `Retry-After`). Backfill is **gap-detection-driven**: it diffs the expected candle grid against the DB and fetches only what's missing, so re-runs are no-ops and holes self-repair. The WS worker streams klines for 6 intervals × 10 symbols, aggTrades, tickers, mark prices and liquidations, and maintains local order books using Binance's documented sync algorithm — any sequence gap triggers a full resync, never a patch.\n\n### Analytics\nEverything is computed on demand and cached in Redis, keyed by the last closed candle, so caches invalidate naturally. Indicators match TradingView (Wilder-seeded RMA, golden-tested against canonical fixtures). The statistical workbench covers return distributions (skew/kurtosis/Jarque-Bera/QQ), close-to-close / Parkinson / Garman-Klass volatility, rolling Hurst, z-scores, ADF and pairs cointegration. A composite **regime classifier** (ADX + Hurst + vol percentile + funding extremity) labels every market, e.g. `Trending · High Vol · Crowded Shorts`.\n\n### Backtesting\nHand-rolled vectorized engine — positions decided on a bar's close take effect the next bar (no look-ahead, proven by test), costs charged on turnover. Strategies declare parameter schemas, so the UI renders their forms and the walk-forward optimizer grid-searches them automatically. Metrics: total/annualized return, Sharpe, Sortino, Calmar, max drawdown, win rate, profit factor, exposure, turnover.\n\n### Paper trading\nA runner subscribes to closed candles and evaluates every running strategy instance: signal → max-position clamp → market order on **testnet.binance.vision** (signed, server-time-synced) or internal sim fills when no keys are configured. Daily-loss guard halts an instance for the day; the kill switch is honored within one evaluation cycle; state persists in Postgres so restarts resume cleanly.\n\n## Tech stack\n\n| Layer | Choice |\n|---|---|\n| Backend | Python 3.12 · FastAPI · SQLAlchemy 2 (async) · pandas/numpy/scipy/statsmodels · APScheduler |\n| Storage | PostgreSQL 16 + TimescaleDB (hypertables, compression) · Redis 7 (hot state, pub/sub) |\n| Frontend | React 19 · TypeScript · Vite · Tailwind v4 · TradingView Lightweight Charts · Plotly · Zustand · TanStack Query |\n| Quality | ruff · mypy --strict · pytest (vs real TimescaleDB+Redis) · eslint · vitest · Playwright E2E · gitleaks |\n| Ops | Docker Compose · GitHub Actions · multi-stage non-root prod images · structured JSON logs with request IDs |\n\n**290+ automated checks** run on every push: 150 backend tests, 33 frontend tests, 6 full-stack E2E tests (hermetic — synthetic data, no exchange dependency), plus lint/type/secret gates.\n\n## Configuration\n\nCopy `.env.example` to `.env`. Everything degrades gracefully when optional keys are absent.\n\n| Variable | Required | Purpose |\n|---|:--:|---|\n| `DATABASE_URL` | ✅ | `postgresql+asyncpg://…` (TimescaleDB) |\n| `REDIS_URL` | ✅ | hot cache + pub/sub |\n| `TRADING_MODE` | ✅ | must be `testnet` — no other value exists |\n| `SECRET_KEY` | auth | JWT signing + Fernet key derivation |\n| `APP_PASSWORD_HASH` | auth | argon2 hash of the single-user password¹ |\n| `CORS_ORIGINS` | prod | allowed frontend origin(s) |\n| `WATCHLIST` | — | defaults to ten majors |\n| `BINANCE_TESTNET_API_KEY/SECRET` | — | real testnet fills (else simulated) |\n| `WHALE_THRESHOLD_USD` | — | whale feed threshold (default 250k) |\n| `JSON_LOGS` | prod | structured logs with request IDs |\n| `TELEGRAM_BOT_TOKEN/CHAT_ID` | — | alert delivery to Telegram |\n| `ENVIRONMENT` | prod | `production` refuses to boot without auth (fail closed) |\n| `SENTRY_DSN` | — | error reporting |\n\n¹ Generate with `uv run python -c \"from app.core.security import hash_password; print(hash_password('yourpw'))\"`\n\n## Security model\n\nSingle-tenant by design. Argon2 + 24h JWTs protect every route and the WebSocket; CORS is locked to the frontend origin; Binance keys are Fernet-encrypted at rest, never returned to clients, and leak-tested in CI; the trading path is hard-gated to testnet. V2 hardening: per-IP login rate limiting, `ENVIRONMENT=production` fails closed without auth, WebSocket auth via first message (no JWTs in URLs or proxy logs), CSP and security headers in the prod image. Always put a public instance behind TLS.\n\n## Project log\n\nThe entire platform was built stage-by-stage with acceptance criteria verified at each step — [BUILD_LOG.md](BUILD_LOG.md) is the full engineering journal, including bugs found en route (Binance pagination quirks, dead array streams in combined WS URLs, and more).\n\n## License\n\n[MIT](LICENSE) — do whatever you like, no warranty.\n\n\u003cdiv align=\"center\"\u003e\n\u003csub\u003eResearch tool · Not financial advice · No live trading\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteliosk98%2Fbinance-quanttradingdashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteliosk98%2Fbinance-quanttradingdashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteliosk98%2Fbinance-quanttradingdashboard/lists"}