QuantEval — Real-Time Quant Analytics Platform
A full-stack analytics system for evaluating pair trading signals, live tick ingestion, alerts, replay mode, and mini-backtester.
🚀 Overview
This project implements a real-time analytical application designed for evaluating candidate quant developers. It demonstrates the ability to:
Ingest live Binance tick data
Sample & store data (1s, 1m, 5m)
Compute key statistical arbitrage analytics
Display real-time charts & summary stats
Trigger server-side alerts via rules
Replay uploaded OHLC files
Run a mini mean-reversion backtest
Provide an extensible and modular architecture
This codebase includes a FastAPI backend, Next.js frontend, candlestick charts using TradingView Lightweight Charts, and a clean dark UI.
🧱 Architecture Summary Backend (FastAPI + Socket.IO)
Binance WebSocket tick ingestion
Tick buffering & sampling (1s / 1m / 5m resampling)
OLS hedge ratio (intercept + beta)
Spread & z-score
ADF test (stationarity check)
Rolling correlation
Server-side rule-based alert engine
OHLC upload + parsing + replay mode
Mini mean-reversion backtester
CSV export
WebSocket push for alerts + ticks
Frontend (Next.js App Router + Tailwind + Lightweight Charts)
Live candlestick price chart
Spread & Z-score charts
Dark theme, collapsible panels
Alerts creation/deletion
Replay mode panel
Backtester panel
Summary statistics
CSV export
Toast notifications using react-hot-toast
▶ How To Run Locally Prerequisites
Python 3.10+
Node.js 18+
Windows PowerShell (or use .bat)
One-click startup
Use the included run_all.ps1:
.\run_all.ps1
This script automatically:
✔ Creates backend virtual environment ✔ Installs Python dependencies ✔ Starts FastAPI on localhost:8000 ✔ Installs Node dependencies ✔ Starts Next.js frontend on localhost:3000
📂 Folder Structure quant-eval/ │── backend/ │ ├── app.py │ ├── analytics/ │ ├── alerts/ │ ├── replay/ │ ├── backtester/ │ └── requirements.txt │ │── frontend/ │ ├── app/ │ ├── components/ │ ├── utils/ │ ├── styles/ │ └── package.json │ │── run_all.ps1 │── architecture.drawio │── architecture.png │── README.md │── ChatGPT_Usage.md
📊 Analytics Provided ✔ Hedge Ratio (OLS regression) ✔ Spread series ✔ Z-score (standardized spread) ✔ ADF test (stationarity check) ✔ Rolling correlation ✔ Summary stats ✔ Mean-reversion backtest (z>2 entry, z<0 exit) ✔ Replay mode from OHLC uploads ✔ Real-time candlestick chart 🔔 Alerts Engine
Server-side rules run continuously:
Examples:
latest_z > 2 rolling_corr_latest < 0.5 latest_spread > 10
Alerts are:
Evaluated on backend
Broadcast via Socket.IO
Shown as styled toast notifications
💾 Data Export
You can download:
Processed data
Spread & Z-score series
Full OLS/regression output
🧩 Extensibility
Designed so the following can be added without refactor:
Kalman filter hedge estimation
Robust regression (Theil-Sen, Huber)
Orderbook ingestion
Cross-correlation heatmaps
Multi-pair scanning
🎯 Final Notes
This system is designed as a professional demonstration of real-time quant engineering, analytics computation, data visualization, and modular system design.