How ennela/nckh-cryptographicanalysis works
This is a multi-service market-data and forecasting product: scheduled collectors acquire Vietnamese equities and Binance crypto candles, ingestion cleans and stores them, training builds and evaluates forecasting models, and the inference API serves predictions and market data to the Next.js dashboard. The README also documents model explainability, multiple model families, MLflow, and cached inference; those capabilities are included where paths are supported. Legacy collector APIs remain separate. Several links between frontend pages and API endpoints, and training-to-inference model registration, are documented or implied but not visible in the sampled calls; such links are dashed where appropriate.
Main entry points: train.py Model training · market_repo.py TimescaleDB market data · main.py Inference API · tasks.py Collection tasks
Components 31
Web experience
- Dashboard
frontend/app/page.tsx - Forecast view
frontend/app/forecast/page.tsx - Symbol browser
frontend/app/symbols/page.tsx - Explainability view
frontend/app/explainability/page.tsx - Market charts
frontend/components/chart.tsx - Navigation
frontend/components/navbar.tsx
Market ingestion
- Ingestion schedule
services/ingestion/app/scheduler.py - Collection tasks
services/ingestion/tasks.py - Binance adapter
services/ingestion/adapters/binance_adapter.py - VNStock adapter
services/ingestion/adapters/vnstock_adapter.py - Clean and store
services/ingestion/app/pipeline.py - Data cleaning
services/ingestion/app/cleaning.py - Legacy Binance collector
api/binance_fastapi/app/binance_client.py - Legacy VNStock collector
api/vnstock_fastapi/app/vnstock_client.py
Shared data platform
- TimescaleDB market data
shared/db/repositories/market_repo.py - DB sessions
shared/db/session.py - OHLCV schema
shared/schemas/ohlcv.py - Locked dataset loader
shared/dataset/loader.py
Model lifecycle
- Model training
services/training/train.py - ARIMA
services/training/models/arima_model.py - GRU
services/training/models/gru_model.py - Random Forest
services/training/models/random_forest_model.py - XGBoost and SHAP
services/training/models/xgboost_model.py - Model evaluation
services/training/evaluate.py - MLflow tracking
services/training/mlflow_utils.py
Forecast serving
- Inference API
services/inference/main.py - Model loader
services/inference/model_loader.py - Prediction cache
services/inference/redis_cache.py
Other components
- Investor
- Redis
- MLflow registry
Connections 36
- Investor → Dashboard: views
README.md - Investor → Forecast view: requests forecasts
README.md - Investor → Symbol browser: browses assets
README.md - Investor → Explainability view: inspects explanations
README.md - Dashboard → Market charts: renders
- Forecast view → Market charts: renders
- Dashboard → Navigation: uses
- Forecast view → Inference API: requests predictions
- Symbol browser → Inference API: requests symbols
- Explainability view → Inference API: requests explanations
- Ingestion schedule → Collection tasks: schedules
- Collection tasks → Binance adapter: fetches crypto
services/ingestion/tasks.py - Collection tasks → VNStock adapter: fetches equities
services/ingestion/tasks.py - Collection tasks → Clean and store: runs cleaning
services/ingestion/tasks.py - Clean and store → Data cleaning: cleans rows
services/ingestion/app/pipeline.py - Clean and store → TimescaleDB market data: upserts candles
services/ingestion/app/pipeline.py - Collection tasks → TimescaleDB market data: writes candles
services/ingestion/tasks.py - Binance adapter → OHLCV schema: produces candles
services/ingestion/adapters/binance_adapter.py - VNStock adapter → OHLCV schema: produces candles
services/ingestion/adapters/vnstock_adapter.py - Legacy Binance collector → TimescaleDB market data: stores candles
- Legacy VNStock collector → TimescaleDB market data: stores candles
- DB sessions → TimescaleDB market data: connects
shared/db/session.py - Model training → Locked dataset loader: loads training data
- Locked dataset loader → TimescaleDB market data: reads snapshot
- Model training → ARIMA: trains
- Model training → GRU: trains
- Model training → Random Forest: trains
- Model training → XGBoost and SHAP: trains
- Model training → Model evaluation: evaluates
- Model training → MLflow tracking: logs runs
- Inference API → Model loader: loads models
services/inference/main.py - Inference API → Prediction cache: checks predictions
services/inference/main.py - Prediction cache → Redis: stores entries
- Inference API → TimescaleDB market data: reads market data
services/inference/main.py - Model loader → MLflow registry: loads registry models
- MLflow tracking → MLflow registry: tracks models