How shaurya212121/streamquant works
StreamQuant is a stock-market data and signal application: market history is fetched, cleaned and feature-engineered, then stored; a scheduled worker refreshes it, while the API serves history and model predictions to a Streamlit dashboard. The API can also enqueue a background task. The README describes a broader C++/Redis Streams/FinBERT architecture, but those components are not present in the supplied tree; the excerpts show Celery with a Redis broker and XGBoost inference. Some documented capabilities, including explainability, are present as standalone modules with no shown runtime caller.
Main entry points: data_engine.py Data Engine · main.py FastAPI · database.py DB Connection · models.py Stock Price Schema
Components 16
Market Data
- Market Data Provider
- Data Engine
backend/data_engine.py - Data Cleaner
backend/cleaner.py - Record Validator
backend/stock.py
Async Runtime
- Celery Worker
backend/worker.py - Redis Broker
ML Signals
- XGBoost Prediction
backend/main.py - Trained XGBoost Models
ml_models - Model Training
ml_models/train_xgb.py - Volume Anomaly Detection
ml_models/anomaly.py - Trade Explanation
ml_models/explainability.py
Persistence
- DB Connection
db/database.py - Stock Price Schema
db/models.py - Stock Price Store
API and UI
- FastAPI
backend/main.py - Streamlit Dashboard
frontend/app.py
Connections 21
- Data Engine → Market Data Provider: fetches prices
backend/data_engine.py - Data Engine → Data Cleaner: cleans data
backend/data_engine.py - Data Engine → Record Validator: validates rows
backend/data_engine.py - Data Engine → DB Connection: writes through
backend/data_engine.py - Data Engine → Stock Price Schema: inserts records
backend/data_engine.py - DB Connection → Stock Price Store: connects to
db/database.py - Stock Price Schema → Stock Price Store: defines table
db/models.py - Celery Worker → Data Engine: runs daily job
backend/worker.py - Celery Worker → Redis Broker: uses broker
backend/worker.py - FastAPI → Celery Worker: enqueues task
backend/main.py - FastAPI → Redis Broker: dispatches via
- FastAPI → DB Connection: opens session
backend/main.py - FastAPI → Stock Price Schema: queries records
backend/main.py - FastAPI → XGBoost Prediction: serves forecast
backend/main.py - XGBoost Prediction → Trained XGBoost Models: loads model
backend/main.py - Streamlit Dashboard → FastAPI: requests data
frontend/app.py - Model Training → DB Connection: reads history
ml_models/train_xgb.py - Model Training → Stock Price Schema: selects prices
ml_models/train_xgb.py - Model Training → Trained XGBoost Models: saves models
ml_models/train_xgb.py - Volume Anomaly Detection → DB Connection: reads and updates
ml_models/anomaly.py - Volume Anomaly Detection → Stock Price Schema: queries and updates
ml_models/anomaly.py