An open API service indexing awesome lists of open source software.

https://github.com/gblack98/digital-lending-analytics-dbt

Data warehouse & BI for digital lending โ€” dbt models for loan portfolio analytics, KPIs and cohort analysis
https://github.com/gblack98/digital-lending-analytics-dbt

analytics business-intelligence data-warehouse dbt lending sql

Last synced: 2 months ago
JSON representation

Data warehouse & BI for digital lending โ€” dbt models for loan portfolio analytics, KPIs and cohort analysis

Awesome Lists containing this project

README

          

# ๐Ÿ“Š Digital Lending Analytics โ€” dbt Data Warehouse

![dbt](https://img.shields.io/badge/dbt-1.7-orange) ![SQL](https://img.shields.io/badge/SQL-Analytics-blue) ![Lending](https://img.shields.io/badge/Domain-Digital_Lending-green) ![BI](https://img.shields.io/badge/BI-Portfolio_Analytics-purple)

> dbt data warehouse for digital lending platforms โ€” loan portfolio KPIs, cohort analysis, NPL tracking, and operational dashboards. Inspired by **Rubyx.io** (โ‚ฌ125M disbursed, 0.55% NPL rate).

## Models

### Risk Mart
| Model | Description |
|-------|-------------|
| `loan_portfolio_risk` | DPD buckets, NPL identification, loan status |
| `cohort_analysis` | Repayment rates by cohort month ร— product ร— country |

### Finance Mart
| Model | Description |
|-------|-------------|
| `revenue_recognition` | Interest income, fees, provisions |
| `portfolio_summary` | AUM, at-risk exposure, coverage ratios |

### Operations Mart
| Model | Description |
|-------|-------------|
| `disbursement_funnel` | Application โ†’ approval โ†’ disbursement rates |
| `collections_efficiency` | Recovery rates by DPD bucket |

## Key Metrics Tracked

| KPI | Formula | Target |
|-----|---------|--------|
| **NPL Rate** | Loans > 90 DPD / Total Portfolio | < 2% |
| **PAR30** | Loans > 30 DPD / Total Portfolio | < 5% |
| **Repayment Rate** | Closed loans / Matured loans | > 92% |
| **Cost of Risk** | Provisions / Average Portfolio | < 3% |

## Loan Status Buckets (DPD)

```sql
'active' โ†’ not yet matured
'dpd_1_30' โ†’ 1-30 days past due (early warning)
'dpd_31_60' โ†’ 31-60 days (collection triggered)
'dpd_61_90' โ†’ 61-90 days (escalation)
'npl' โ†’ > 90 days (non-performing, provisioned)
'closed' โ†’ fully repaid
```

## Setup

```bash
pip install dbt-postgres
dbt deps
dbt run
dbt test
dbt docs generate && dbt docs serve # Interactive docs at localhost:8080
```

## Author

**Ibrahima Gabar Diop** โ€” [GitHub](https://github.com/Gblack98) ยท [Kaggle](https://www.kaggle.com/ibrahimagabardiop)