# ovcgit/irrbb_model architecture

> Architecture diagram of the GitHub repository ovcgit/irrbb_model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ovcgit/irrbb_model
- Repository: https://github.com/ovcgit/irrbb_model

## Overview

This repository is an IRRBB risk-analysis framework for banking-book portfolios. The principal workflow takes balance-sheet, market and behavioral data through parsing and preparation, then calculates EVE and NII sensitivities under rate scenarios, checks risk limits, and produces reports or dashboards. The architecture separates input handling, financial modeling and outputs, with configuration controlling analysis and reporting. The README documents several capabilities whose internal wiring is not shown in the sampled excerpts; links are limited to documented workflow and described module responsibilities.

Main entry points: [`irrbb_model/main.py`](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/main.py) (Framework entry point), [`irrbb_model/core.py`](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/core.py) (IRRBB calculation engine), [`irrbb_model/data_management/parsers.py`](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/parsers.py) (Input parsers), [`irrbb_model/data_management/transformers.py`](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/transformers.py) (Data transformers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Data preparation"]
  node_parsers["Input parsers<br/>[parsers.py]"]
  node_transformers["Data transformers<br/>[transformers.py]"]
  node_validation["Data validation<br/>[validation.py]"]
end

subgraph group_model["Risk modeling"]
  node_framework["Framework entry point<br/>[main.py]"]
  node_core["IRRBB calculation engine<br/>[core.py]"]
  node_instruments["Banking instruments<br/>[fixed_income.py]"]
  node_instrument_base["Instrument abstractions<br/>[base.py]"]
  node_cashflows["Cash-flow schedules<br/>[cash_flows.py]"]
  node_term_structure["Rate scenarios<br/>[term_structure.py]"]
  node_behavior["Behavioral models"]
end

subgraph group_outputs["Risk outputs"]
  node_risk["Risk-limit monitoring<br/>[risk_management.py]"]
  node_reporting["Reports and dashboards<br/>[reporting.py]"]
end

subgraph group_settings["Configuration"]
  node_config["Analysis configuration<br/>[config.py]"]
end

node_analyst(("Analyst or CLI user"))
node_data_files["Portfolio and market files"]
node_report_consumer(("Report consumer"))

node_analyst -->|"runs analysis"| node_framework
node_framework -->|"loads settings"| node_config
node_framework -->|"loads input"| node_parsers
node_data_files -->|"provides data"| node_parsers
node_parsers -->|"standardizes data"| node_transformers
node_transformers -->|"prepares data"| node_validation
node_framework -->|"runs calculations"| node_core
node_core -->|"builds instruments"| node_instruments
node_instruments -->|"extends"| node_instrument_base
node_core -->|"models rate scenarios"| node_term_structure
node_core -->|"models behavior"| node_behavior
node_core -->|"analyzes cash flows"| node_cashflows
node_framework -->|"checks limits"| node_risk
node_framework -->|"generates reports"| node_reporting
node_reporting -->|"delivers results"| node_report_consumer

click node_framework "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/main.py"
click node_parsers "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/parsers.py"
click node_transformers "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/transformers.py"
click node_validation "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/validation.py"
click node_config "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/config.py"
click node_core "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/core.py"
click node_instruments "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/financial_instruments/fixed_income.py"
click node_instrument_base "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/financial_instruments/base.py"
click node_cashflows "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/cash_flows.py"
click node_term_structure "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/term_structure.py"
click node_behavior "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/behavioral_models.py"
click node_risk "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/risk_management.py"
click node_reporting "https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/reporting.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parsers,node_transformers,node_validation,node_analyst toneBlue
class node_framework,node_core,node_instruments,node_instrument_base,node_cashflows,node_term_structure,node_behavior toneAmber
class node_risk,node_reporting toneMint
class node_config toneRose
class node_data_files,node_report_consumer toneIndigo
```

## Components

### Data preparation

- [Input parsers](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/parsers.py): `irrbb_model/data_management/parsers.py`
- [Data transformers](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/transformers.py): `irrbb_model/data_management/transformers.py`
- [Data validation](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/data_management/validation.py): `irrbb_model/data_management/validation.py`

### Risk modeling

- [Framework entry point](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/main.py): `irrbb_model/main.py`
- [IRRBB calculation engine](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/core.py): `irrbb_model/core.py`
- [Banking instruments](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/financial_instruments/fixed_income.py): `irrbb_model/financial_instruments/fixed_income.py`
- [Instrument abstractions](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/financial_instruments/base.py): `irrbb_model/financial_instruments/base.py`
- [Cash-flow schedules](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/cash_flows.py): `irrbb_model/cash_flows.py`
- [Rate scenarios](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/term_structure.py): `irrbb_model/term_structure.py`
- [Behavioral models](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/behavioral_models.py): `irrbb_model/behavioral_models.py`

### Risk outputs

- [Risk-limit monitoring](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/risk_management.py): `irrbb_model/risk_management.py`
- [Reports and dashboards](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/reporting.py): `irrbb_model/reporting.py`

### Configuration

- [Analysis configuration](https://github.com/ovcgit/irrbb_model/blob/main/irrbb_model/config.py): `irrbb_model/config.py`

### Other components

- **Analyst or CLI user**
- **Portfolio and market files**
- **Report consumer**

## Connections

- Analyst or CLI user → Framework entry point: runs analysis
- Framework entry point → Analysis configuration: loads settings
- Framework entry point → Input parsers: loads input
- Portfolio and market files → Input parsers: provides data
- Input parsers → Data transformers: standardizes data
- Data transformers → Data validation: prepares data
- Framework entry point → IRRBB calculation engine: runs calculations
- IRRBB calculation engine → Banking instruments: builds instruments
- Banking instruments → Instrument abstractions: extends
- IRRBB calculation engine → Rate scenarios: models rate scenarios
- IRRBB calculation engine → Behavioral models: models behavior
- IRRBB calculation engine → Cash-flow schedules: analyzes cash flows
- Framework entry point → Risk-limit monitoring: checks limits
- Framework entry point → Reports and dashboards: generates reports
- Reports and dashboards → Report consumer: delivers results
