Skip to content

Skpkush/mf-analytics-platform

Repository files navigation

Mutual Fund Analytics Platform

Production-style, enterprise-grade Mutual Fund Analytics Platform demonstrating end-to-end Data Engineering, Advanced Analytics, Cloud Architecture, and Executive BI Reporting.

Built by: Sumit Kumar Prajapat | GitHub: Skpkush

Status: ✅ Complete — End-to-end pipeline live (ingestion → Azure ADF → Star Schema → Power BI)

🔴 Live Demo: mf-analytics-platform.streamlit.app

Live Demo Python Pandas PostgreSQL Azure Power BI Prophet Streamlit License


📊 Key Metrics

Metric Value
NAV rows processed ~100K NAV observations
Fund schemes covered 14,384
Funds with computed metrics 16 (Yahoo ETF universe)
AMCs covered 51
Power BI dashboard pages 4
Cloud ETL Azure Data Factory pipeline (✅ Succeeded)
DAX measures authored 25+
Data model Star schema — 5 dimension + 4 fact tables

🎯 Business Problem

Asset Management Companies, Wealth Advisors, and FinTech firms need a unified analytics platform that ingests multi-source mutual fund data, computes risk-adjusted performance metrics, segments investors, forecasts NAV trends, and surfaces executive-level insights — all in a scalable cloud architecture.

This platform delivers exactly that.


🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  Data Sources   │───▶│   Azure Blob    │───▶│  Azure Data     │
│  Yahoo Finance  │    │   (Raw Layer)   │    │   Factory       │
│  AMFI India     │    └─────────────────┘    │  (✅ Succeeded) │
│  Kaggle         │                           └─────────────────┘
└─────────────────┘                                     │
                                                        ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  Streamlit App  │◀───│  Power BI       │◀───│  Azure SQL DB   │
│(Streamlit Cloud)│    │  4-Page         │    │  Star Schema    │
└─────────────────┘    │  Dashboard      │    │  5 Dim + 4 Fact │
        ▲              └─────────────────┘    └─────────────────┘
        │                                              │
        │                                              ▼
        │                                     ┌─────────────────┐
        └─────────────────────────────────────│  Python ML      │
                                              │  Prophet NAV    │
                                              │  Forecasting    │
                                              └─────────────────┘

Data flow: Raw multi-source data lands in Azure Blob → Azure Data Factory orchestrates ingestion → transformation/cleaning in Python → load into a star schema (5 dimension + 4 fact tables) on Azure SQL Database (PostgreSQL locally) → 25+ DAX measures power a 4-page Power BI dashboard → Prophet forecasts NAV trajectories → Streamlit surfaces client-facing analytics.

Full diagram: docs/architecture/architecture.md

Star Schema (5 Dim + 4 Fact)

  • Dimensions: Dim_Date, Dim_AMC, Dim_Category, Dim_Fund, Dim_Investor
  • Facts: Fact_NAV, Fact_Transactions, Fact_SIP, Fact_Returns

DDL: scripts/sql/ddl/ · Views: scripts/sql/views/ · Procs: scripts/sql/procs/


🛠️ Tech Stack

Layer Technology
Cloud Azure (Blob Storage, SQL Database, Data Factory, Functions, Key Vault)
Database Azure SQL Database (cloud) + PostgreSQL 15 (local/fallback)
ETL Azure Data Factory + Python (pandas 2.x, sqlalchemy)
Analytics Python (numpy, scipy, statsmodels)
ML Prophet (NAV forecasting)
BI Power BI Desktop — 4 pages, 25+ DAX measures
App Streamlit (deployed on Streamlit Community Cloud)
Orchestration ADF pipelines + Azure Functions
Version Control Git + GitHub

📊 Dashboard Pages (Power BI)

📥 Download: Power BI Dashboard (.pbix) (Git LFS) · 🖼️ Screenshots: docs/screenshots/

  1. Executive Overview — AUM, top funds, market summary, KPIs
  2. Fund Performance Analytics — CAGR, rolling returns, benchmark comparison
  3. Investor Analytics — SIP trends, segmentation, retention
  4. Risk & Volatility — Sharpe heatmaps, drawdown, risk-return scatter

🖼️ Dashboard Screenshots

Page 1 — Executive Overview Executive Overview

Page 2 — Fund Performance Analytics Fund Performance

Page 3 — Investor Analytics Investor Analytics

Page 4 — Risk & Volatility Risk & Volatility

Azure Data Factory Pipeline — Succeeded Azure ADF Pipeline — Succeeded


📈 Financial Metrics Implemented

  • CAGR (Compound Annual Growth Rate)
  • Rolling Returns (1Y, 3Y, 5Y)
  • Alpha, Beta (vs Nifty 50 benchmark)
  • Sharpe Ratio, Sortino Ratio, Treynor Ratio
  • Standard Deviation, Volatility
  • Maximum Drawdown
  • Information Ratio

🤖 ML Module

NAV Forecasting (Prophet) — Forecasts 30/60/90-day NAV trajectories with confidence-interval bands for the Yahoo ETF/benchmark universe (≥ 200 trading days of history). Implemented in scripts/ml/forecast_nav.py and served live through the Streamlit app (streamlit/), deployed on Streamlit Community Cloud with a Supabase PostgreSQL backend.

python scripts/ml/forecast_nav.py --fund-code NIFTYBEES.NS   # CLI forecast
streamlit run streamlit/app.py                               # interactive app

▶️ How to Run

1. Setup

# Clone repo
git clone https://github.com/Skpkush/mf-analytics-platform.git
cd mf-analytics-platform

# Create virtual environment
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env            # Windows: copy .env.example .env
# Edit .env with your Azure / PostgreSQL credentials

2. Ingest data

python scripts/ingestion/fetch_yahoo_finance.py
python scripts/ingestion/fetch_amfi_nav.py

3. Transform & load (build the star schema)

# Clean and validate NAV / transaction history
python scripts/transformation/clean_nav.py
python scripts/transformation/clean_transactions.py

# Create the schema (DDL), then load dimensions and facts
python scripts/etl/run_ddl.py
python scripts/etl/load_dimensions.py
python scripts/etl/load_facts.py

4. Compute analytics

python scripts/analytics/metrics_returns.py        # CAGR, rolling returns
python scripts/analytics/metrics_risk.py           # volatility, drawdown
python scripts/analytics/metrics_risk_adjusted.py  # Sharpe, Sortino, Treynor, alpha/beta
python scripts/analytics/metrics_market.py         # market/AUM aggregates

5. Forecast NAV (Prophet)

python scripts/ml/forecast_nav.py --list                  # forecastable funds
python scripts/ml/forecast_nav.py --fund-code NIFTYBEES.NS # 30/60/90-day forecast

6. Explore the dashboard & app

  • Power BI: open powerbi/mf_analytics_dashboard_p4.pbix (apply theme powerbi/theme_mf_analytics.json).
  • Streamlit: streamlit run streamlit/app.py → open http://localhost:8501 (interactive NAV forecasting; deploy notes in streamlit/README.md).

Cloud path: the Azure Data Factory pipeline orchestrates the ingestion → blob → SQL load in the cloud (pipeline run Succeeded — see screenshot above). Run the cloud ETL via scripts/etl/run_azure_etl.py / scripts/etl/trigger_adf_pipeline.py.


📁 Project Structure

mf-analytics-platform/
├── azure/
│   ├── adf_pipelines/        # ADF JSON pipeline definitions
│   ├── alerts/               # ADF failure alert configurations
│   ├── arm_templates/        # Infrastructure as code
│   ├── datasets/             # ADF dataset definitions
│   ├── functions/
│   │   └── fn_compute_daily_metrics/  # Azure Function daily refresh
│   ├── pipelines/            # ADF pipeline JSON definitions
│   └── triggers/             # ADF schedule triggers
├── data/
│   ├── processed/            # Cleaned, transformed data (gitignored)
│   └── external/             # Benchmark + risk-free rate data (gitignored)
├── docs/
│   ├── architecture/         # Architecture diagrams + Mermaid
│   ├── case_study/           # Case study PDF (planned)
│   ├── screenshots/          # Dashboard + pipeline screenshots
│   ├── daily_log.md          # Day-by-day build log
│   └── data_dictionary.md    # Schema + field definitions
├── notebooks/
│   └── 01_data_exploration.ipynb  # EDA notebook
├── powerbi/
│   ├── mf_analytics_dashboard_p4.pbix  # 4-page dashboard (gitignored — built locally)
│   └── theme_mf_analytics.json         # Navy theme file
├── scripts/
│   ├── ingestion/            # AMFI + Yahoo Finance data acquisition
│   ├── transformation/       # Cleaning, validation, feature engineering
│   ├── etl/                  # DDL run, dimension/fact load, Azure ETL
│   ├── analytics/            # CAGR, Sharpe, Beta, Drawdown metrics
│   ├── ml/                   # Prophet NAV forecasting
│   └── sql/
│       ├── ddl/              # CREATE TABLE scripts (star schema)
│       ├── views/            # Analytical views (vw_fund_performance)
│       └── procs/            # Stored procedures
├── streamlit/
│   ├── .streamlit/           # Theme + secrets template
│   ├── pages/                # 5 app pages (Explorer, Forecast, Risk, SIP, Portfolio)
│   ├── utils/                # DB, metrics, charts utilities
│   ├── app.py                # Home page + KPI cards
│   ├── Dockerfile            # Container definition
│   ├── docker-compose.yml    # VPS deployment config (alternative)
│   ├── requirements.txt      # App-only dependencies
│   └── README.md             # Deploy instructions
├── tests/
│   ├── conftest.py           # Pytest fixtures
│   └── test_data_quality.py  # Data quality unit tests
├── .env.example              # Environment variable template
├── .gitignore                # Secrets + venv excluded
├── CLAUDE.md                 # Claude Code project context
├── PROJECT_PLAN.md           # Week-by-week execution plan
├── requirements.txt          # Full Python dependencies
└── README.md

📄 Documentation


📜 License

MIT License — see LICENSE file.


👤 Author

Sumit Kumar Prajapat Data Analyst | Analytics Engineer | 📧 sumitkprajapat29@gmail.com 🔗 GitHub


Last updated: June 2026

About

Production-grade Mutual Fund Analytics Platform - Azure + Python + Power BI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors