The next-generation open-source platform for quantitative FX risk modeling, scenario analysis, and regulatory stress testing.
Note: This is an extract of a live, ongoing project for advanced FX risk management. The codebase is actively developed and extended with new features, analytics, and integrations.
This project provides a highly modular, high-performance framework for developing, maintaining, and validating advanced FX risk models. Each domain (models, scenario_modelling, stress_testing, bau_metrics, backtesting, api, reporting, streamlit_app) is strictly separated for maintainability and scalability. Scenario analysis is parallelized for large-scale, real-time risk analytics.
Business-As-Usual (BAU) risk metrics are essential for monitoring and managing FX risk under normal market conditions. They provide a quantitative foundation for day-to-day risk oversight, including measures such as Value at Risk (VaR) and Expected Shortfall. BAU metrics help institutions:
- Detect and control risk exposures before they escalate
- Satisfy regulatory requirements for ongoing risk management
- Benchmark performance and risk across portfolios By integrating BAU metrics, QuantumFX ensures robust, real-time risk monitoring as a core part of the risk management workflow.
It includes:
- Scenario Modelling
- Stress Testing
- BAU Risk Metrics
- Back-testing & Calibration
- Multi-currency Portfolio Support
- API Integration (FastAPI)
- Advanced Reporting & Visualization
- Strictly modular, extensible architecture
- Production-ready code structure
- Back-testing and calibration for accuracy and compliance
- Designed for regulatory standards
- Portfolio-level stress testing and scenario analysis (parallelized for high performance)
- Live REST API endpoints for model simulation and portfolio valuation
- YAML-based configuration for flexible workflows
fx_risk/models/
— Core model definitions (e.g.,fx_model.py
,heston_model.py
), portfolio logic (portfolio.py
), and configuration loader (config_loader.py
).fx_risk/scenario_modelling/
— Scenario generation and management (e.g.,scenario_generator.py
).fx_risk/stress_testing/
— Stress test modules (e.g.,stress_test.py
).fx_risk/bau_metrics/
— Business-as-usual risk metrics (e.g.,metrics.py
).fx_risk/backtesting/
— Back-testing and calibration tools (e.g.,backtest.py
).fx_risk/api/
— REST API server (server.py
) for integration and automation.fx_risk/reporting/
— Reporting and visualization utilities (e.g.,report.py
).fx_risk/streamlit_app.py
— Interactive Streamlit visualization UI for simulation, portfolio analytics, and scenario analysis.config.yaml
— Example YAML configuration for model parameters.requirements.txt
— All Python dependencies for production deployment.
- Install dependencies:
pip install -r requirements.txt
- Explore all modules in
fx_risk/
(see structure above for file-level details). - Run tests:
pytest
(all modules are covered by unit tests for production reliability). - Launch the API:
uvicorn fx_risk.api.server:app --reload
(for RESTful integration). - Launch the Streamlit app for interactive visualization:
streamlit run fx_risk/streamlit_app.py
. - Edit
config.yaml
to customize model parameters for your use case.
QuantumFX supports a wide range of advanced and research-grade FX risk models. The following models are available for simulation and analytics in the Streamlit dashboard:
- Heston
- Black-Scholes
- Jump-Diffusion
- GARCH(1,1)
- SABR (coming soon)
- Regime-Switching (coming soon)
- Stochastic Local Volatility (SLV) (coming soon)
- Copula (coming soon)
- Neural SDE (coming soon)
- Rough Volatility (coming soon)
All models are accessible from the sidebar dropdown in the Streamlit app. Models marked "coming soon" are included for roadmap visibility and will be enabled in future releases.
Below are screenshots of the QuantumFX Streamlit dashboard, demonstrating the model selection, analytics, and visualization features:





This project is under active development by the author and contributors. Thus, new features and improvements are added regularly.
The Streamlit app (fx_risk/streamlit_app.py
) provides an interactive UI for:
- Simulating FX model paths
- Valuing and analyzing multi-currency portfolios
- Running portfolio stress tests and scenario analysis Launch with:
streamlit run fx_risk/streamlit_app.py
Disclaimer: Majority of features have been truncated by the original author for brevity and clarity.
- GitHub: QuantDevJayson
- PyPI: jayson.ashioya
- LinkedIn: Jayson Ashioya