A powerful, open-source balance sheet projection engine for banks and financial institutions. Built for speed, flexibility, and transparency in capital management, liquidity forecasting, and stress testing.
Traditional banking projection are often in various complex Excel sheets. BankProjections offers:
- 🚀 Blazing Fast: Built on Polars, handles portfolios with millions of instruments efficiently
- 🔧 Highly Flexible: Adapt calculations to your bank's specific needs using configurable registries
- 📊 Comprehensive: Projects balance sheets, P&L, cash flows, and regulatory metrics
- 🎯 Scenario-Based: Run multiple concurrent scenarios with customizable assumptions
- 🔓 Open Source: Full transparency with Apache License 2.0
- 🧪 Test-Driven: Synthetic data generation for safe testing and demonstration
BankProjections enables financial institutions to:
- Project financial statements into the future under various scenarios
- Calculate runoff patterns, amortization, and repayment schedules
- Compute regulatory metrics (Basel IV capital ratios, LCR, NSFR, ROC)
- Perform market valuations based on scenario curves
- Generate income statements and cash flow projections
- Stress test portfolios under adverse conditions
- Multi-scenario Support: Run multiple projection scenarios concurrently with independent assumptions
- Runoff Modeling: Calculate repayments, prepayments, and coupon payments with custom amortization rules
- Market Valuation: Dynamic market value calculations based on scenario yield curves
- Regulatory Compliance: Basel IV capital ratios, LCR, NSFR, and other regulatory metrics
- Synthetic Data Generation: Built-in tools to generate realistic test data without exposing real bank information
⚠️ Work in Progress: This project is under active development and not yet production-ready. Contributions and feedback are welcome!
BankProjections uses a registry-based architecture that allows you to customize calculations without modifying core code:
A few examples:
- BalanceSheetItemRegistry: Define important balance sheet items that should be used in calculations
- BalanceSheetMetrics: Configure which metrics are calculated and how
- Standard metrics: nominal, book value, interest rates, impairments
- Add custom metrics specific to your institution
- Control metric calculation order and dependencies
- AccountingMethodRegistry: Define how book value is determined and income is accounted:
- Amortized cost
- Fair value through P&L
- Fair value through OCI
- MetricRegistry: Defines the output metrics, for example regulatory capital and liquidity ratios
- ValuationRegistry: Defines how items must be reevaluated
- RedemptionRegistry: Defines how items redeem (principal payments)
Most registries correspond to a column in the input balance sheet containing the registry keys. This way the relevant calculations can be orchestrated for each balance item.
This registry approach means you can adapt BankProjections to your bank's specific needs by registering custom handlers rather than forking and modifying the core codebase. Simply extend the registries with your institution-specific logic while maintaining compatibility with updates.
The code is developed in Python 3.13. See configuration in pyproject.toml for more details.
# Clone the repository
git clone https://github.com/woutersolutions/BankProjections.git
cd BankProjections
# Install in development mode with all dependencies
pip install -e ".[dev]"Make sure to add the src directory to your PYTHONPATH.
See the src/examples/ directory for a complete working example:
# Navigate to examples
cd src/examples
# Run the example projection
python main.pyThe example demonstrates:
- Loading a synthetic balance sheet (
example_bs.csv) - Applying scenario parameters
example_scenario.xlsx - Running a projection with this scenario
main.py - Computing regulatory metrics
- Exporting results to Excel
# Run all tests
pytest
# Run with coverage
pytest --cov=src
# Run specific test file
pytest tests/unit/test_projections.pyThe project maintains high code quality standards:
# Format code
ruff format .
# Check linting
ruff check .
# Type checking
mypy src/This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you have feedback, questions or offer/need help:
- Issues: For bug reports or feature requests, please open an issue
- LinkedIn: Wouter van Krieken
Current Status: Alpha - Core functionality is implemented but the API may change
- ✅ Core projection engine with scenario support
- ✅ Amortization and runoff calculations
- ✅ Excel scenario input templates
- ✅ Basic regulatory metrics (capital ratios, liquidity ratios)
- ✅ Synthetic data generation
- ✅ Registry-based customization system
- 🔨 Enhanced documentation and examples
- 🔨 Additional scenario templates
- 🔨 Performance optimizations for large portfolios
- 🔨 Off-balance modelling and hedging
- 🔨 IFRS9 Stage migrations and impairments changes
- 📋 Web-based visualization dashboard
- 📋 Additional regulatory metrics
- Results should be validated against known benchmarks and existing systems
- The tool needs to be tailored to the specific needs of each institution
- No warranty is provided - use at your own risk (see Apache License 2.0)
- Not intended to replace professional financial advice or regulatory compliance systems
Always perform thorough validation and testing before using for any critical decision-making.