RWA Calculator Specifications¶
This section contains the formal specifications for the RWA Calculator. These specifications serve as:
- Living documentation - Human-readable descriptions of business rules and regulatory treatments
- Acceptance criteria - Clear definition of expected behaviour for each scenario
- Traceability - Each scenario maps to acceptance tests via scenario IDs
Specification Index¶
CRR Framework (Current - Until December 2026)¶
| Specification | Description | Regulatory Reference |
|---|---|---|
| SA Risk Weights | Standardised Approach risk weights by exposure class and CQS | CRR Art. 112-134 |
| Supporting Factors | SME (0.7619) and infrastructure (0.75) factors | CRR Art. 501, 501a |
| F-IRB Calculation | Foundation IRB with supervisory LGD | CRR Art. 153-154, 161-163 |
| A-IRB Calculation | Advanced IRB with internal estimates | CRR Art. 153-154 |
| Credit Conversion Factors | CCF for off-balance sheet items | CRR Art. 111, 166 |
| Credit Risk Mitigation | Collateral haircuts, guarantees, and overcollateralisation | CRR Art. 192-241 |
| Slotting Approach | Specialised lending categories | CRR Art. 147(8), 153(5) |
| Provisions | Provision treatment and EL comparison | CRR Art. 159; PRA Rulebook Art. 158 |
| Equity Approach | SA equity (Art. 133), IRB Simple (Art. 155), CIU treatment | CRR Art. 132-133, 155 |
| SA-CCR (Counterparty Credit Risk) | EAD = α·(RC + PFE) for derivatives; adjusted notional (adjusted-notional.md), FX hedging-set treatment (fx-treatment.md), supervisory delta, maturity factor, RC/PFE, WWR, CCP exposures, failed trades | PRA PS1/26 Part Three Title II Chapter 6 (Art. 271–311) |
Basel 3.1 Framework (From January 2027)¶
| Specification | Description | Regulatory Reference | Test Group |
|---|---|---|---|
| SA Risk Weights | ECRA/SCRA, corporate sub-categories, RE loan-splitting, SA specialised lending | Art. 112–134 | B31-A |
| Foundation IRB | Reduced senior LGD (40%), higher PD floor (0.05%), covered bond LGD, 1.06 removal | Art. 153–163 | B31-B |
| Advanced IRB | LGD floors, post-model adjustments, CCF floor, double default removal | Art. 153–154, 161, 164, 166D | B31-C |
| Credit Risk Mitigation | Revised 5-band haircuts, equity haircuts, IRB parameter substitution | Art. 191A–241 | B31-D, B31-D7 |
| Slotting Approach | Revised weights, maturity split removal, no pre-op PF distinction | Art. 147(8), 153(5) | B31-E |
| Output Floor | PRA 4-year transitional floor, OF-ADJ capital adjustment | Art. 92(2A)–(2D) | B31-F |
| Provisions | EL with revised LGD, Art. 158(6A) monotonicity, shortfall/excess | Art. 158–159 | B31-G |
| Defaulted Exposures | Provision-coverage split (100%/150%), RESI RE exception, IRB defaulted | Art. 127, 153(1), 154(1) | B31-K |
| Equity Approach | New SA equity regime (250%/400%), IRB removal, transitional, CIU | Art. 133, 147A, Rules 4.1–4.8 | B31-L |
| Model Permissions | Art. 147A approach restrictions: FSE, large corporate, institution, equity | Art. 147A; PS1/26 Glossary (LFSE, CRR Art. 142(1)(4)) | B31-M |
See also the CRR vs Basel 3.1 section for comparison documentation.
Common (Framework-Agnostic)¶
| Specification | Description |
|---|---|
| Hierarchy & Classification | Counterparty hierarchy resolution and exposure classification |
| Stress Testing | Pipeline integrity tests at 10K–100K scale across all framework/permission combinations |
Project¶
| Specification | Description |
|---|---|
| Overview | Executive summary, scope, users, technology stack |
| Architecture | Pipeline stages, design decisions, data model |
| Configuration | Framework toggle, IRB permissions, PD/LGD floors |
| Output & Reporting | Aggregation, output floor, COREP, export |
| Interfaces | Python API, Marimo UI, CLI |
| Observability | Logging contract, correlation IDs, format, enforcement |
| Audit cache | Opt-in per-run parquet snapshots of CRM intermediate frames + manifest |
| NFRs | Performance, correctness, reliability targets |
| Milestones | Release plan, risks |
| Regulatory Compliance | CRR + Basel 3.1 compliance matrix, acceptance tests |
| Glossary | Regulatory terms |
Scenario Coverage by Test Group¶
Group A: Standardised Approach¶
Covers risk weight determination for all SA exposure classes:
- Sovereigns (CQS 1-6 and unrated)
- Institutions (CQS-based per Art. 120)
- Corporates (rated and unrated)
- Retail (fixed 75%)
- Residential mortgages (LTV-based split at 80%)
- Commercial real estate (LTV-based with income cover test)
Group B: Foundation IRB¶
Covers F-IRB calculation components:
- PD floor (0.03%)
- Supervisory LGD (45% senior, 75% subordinated)
- Corporate correlation formula with PD-dependent decay
- SME firm-size correlation adjustment
- Maturity adjustment
- Expected loss calculation
- 1.06 scaling factor
Group C: Advanced IRB¶
Covers A-IRB with internal estimates:
- Internal LGD application
- Internal CCF application
- FI scalar (1.25x) for large financial institutions
Group D: Credit Risk Mitigation¶
Covers CRM techniques:
- Basic CRM (D1–D6): Financial collateral haircuts (Art. 224), FX mismatch (8%), overcollateralisation (Art. 230), guarantee substitution (Art. 213-217), multi-level collateral, maturity mismatch (Art. 238)
- Advanced CRM (D7–D14, D9b): non-beneficial guarantees, sovereign guarantees, CDS restructuring exclusion/inclusion, gold/equity collateral, overcollateralisation floor, full CRM chain, mixed collateral types
- Provision-CRM interaction (G4–G6): SA provision deduction (Art. 110), multiple provisions, provision + collateral combined waterfall
Group E: Slotting¶
Covers specialised lending:
- Slotting categories (Strong to Default)
- HVCRE elevated risk weights
- Project/Object/Commodities/IPRE finance types
Group F: Supporting Factors¶
Covers CRR-specific factors:
- SME supporting factor (tiered: 0.7619 / 0.85)
- Infrastructure supporting factor (0.75)
Group G: Provisions¶
Covers provision treatment:
- SA provision deduction from exposure
- IRB expected loss comparison
Group H: Complex/Combined¶
Covers multi-approach and combined scenarios:
- Mixed SA/IRB portfolios
- Multi-level hierarchy with CRM
- Combined supporting factors with output floor
Group I: Defaulted Exposures¶
Covers defaulted exposure treatment:
- F-IRB defaulted (K=0, CRR Art. 153(1)(ii))
- A-IRB defaulted (K=max(0, LGD−BEEL), CRR Art. 154(1)(i))
- Defaulted with CRM adjustments
Group J: Equity¶
Covers equity exposure treatment:
- SA equity flat 100% (CRR Art. 133(2)) — listed, unlisted, PE/VC
- IRB Simple risk weights (CRR Art. 155(2)) — exchange-traded 290%, PE diversified 190%, other 370%
- CIU treatment — mandate-based, look-through, fallback (CRR Art. 132)
- RWA arithmetic validation
Group CCR: Counterparty Credit Risk (SA-CCR)¶
Covers the Standardised Approach for Counterparty Credit Risk on derivative transactions
(PRA PS1/26 Part Three Title II Chapter 6, Art. 271–311). The pipeline computes
EAD = α · (RC + PFE) with α = 1.4 and feeds the resulting exposure into the SA / IRB
credit risk calculators alongside on-balance-sheet exposures:
- EAD aggregation formula (Art. 274) —
EAD = 1.4 · (RC + PFE) - Replacement Cost (Art. 275) — margined vs unmargined RC, threshold + MTA
- PFE multiplier (Art. 278) — over-collateralisation / negative-MtM dampener
- Adjusted notional (Art. 280–280f) — asset-class specific notional adjustments
- Supervisory delta (Art. 279a) — directional adjustment for options and CDOs
- Maturity factor (Art. 279c, 285) — unmargined cap and margined MPOR scaling
- Hedging-set partition (Art. 277, 277a) — IR (per currency), FX (per pair), credit/equity (per reference), commodity (per type)
- Wrong-way risk (Art. 291) — specific WWR (legal connection) and general WWR alpha multiplier
- CCP exposures (Art. 306–307) — QCCP trade leg 2% RW + default fund contribution treatment
- Failed trades (Art. 378–380) — unsettled transactions and free deliveries
- Legal-enforceability gate (Art. 272(4), 295–297) — netting set recognition criteria
Basel 3.1 Groups¶
Basel 3.1 scenarios mirror the CRR structure with additional framework-specific tests:
- B31-A through B31-H: Same structure as CRR groups with Basel 3.1 rule changes
- B31-D7: Parameter substitution (IRB guarantor PD substitution, new in Basel 3.1)
- B31-F: Output floor phase-in (60%–72.5%, 2027–2030)
- B31-K: Defaulted exposures (provision-coverage split, RESI RE exception, IRB K=0)
- B31-L: Equity approach (SA 250%/400%, IRB removal, transitional phase-in, CIU treatment)
- B31-M: Model permissions (Art. 147A restrictions — FSE, large corporate, institution, equity routing)
Stress Testing Groups¶
Pipeline integrity tests at scale (framework-agnostic):
- STRESS-1 to STRESS-14: Row count preservation, column completeness, numerical stability, risk weight bounds, approach routing, exposure class coverage, output floor at scale, error accumulation, summary consistency, EAD consistency, determinism, framework comparison, large-scale 100K, reference uniqueness
See the Stress Testing Specification for full scenario definitions.
Comparison Groups¶
Dual-framework comparison scenarios:
- M3.1: Side-by-side CRR vs Basel 3.1 RWA comparison
- M3.2: Capital impact analysis with delta decomposition by driver
- M3.3: Transitional floor schedule modelling (2027–2030)
Scenario ID Convention¶
Each scenario is tagged with an identifier for traceability:
| Prefix | Scenarios | Description |
|---|---|---|
CRR-A |
A1–A9, A11 | CRR Standardised Approach |
CRR-B |
B1–B7 | CRR Foundation IRB |
CRR-C |
C1–C3 | CRR Advanced IRB |
CRR-D |
D1–D14, D.CCF1–CCF4 | CRR Credit Risk Mitigation and CCFs |
CRR-E |
E1–E8 | CRR Slotting Approach |
CRR-F |
F1–F7 | CRR Supporting Factors |
CRR-G |
G1–G3, G4–G6 | CRR Provisions (G4–G6 in CRM spec) |
CRR-H |
H1, H3 | CRR Complex/Combined |
CRR-I |
I1–I3 | CRR Defaulted Exposures |
CRR-J |
J1–J20 | CRR Equity |
CCR-A |
TBD (pending engine batch P8.35–P8.38) | Counterparty Credit Risk — SA-CCR (Art. 271–311) |
B31-A |
A1–A11 | Basel 3.1 Standardised Approach |
B31-B |
B1–B7 | Basel 3.1 Foundation IRB |
B31-C |
C1–C3 | Basel 3.1 Advanced IRB |
B31-D |
D1–D6, D7–D7e, D.CCF1–CCF8 | Basel 3.1 Credit Risk Mitigation and CCFs |
B31-E |
E1–E4 | Basel 3.1 Slotting Approach |
B31-F |
F1–F3 | Basel 3.1 Output Floor |
B31-G |
G1–G3 | Basel 3.1 Provisions |
B31-H |
H1, H3 | Basel 3.1 Complex/Combined |
B31-K |
K1–K12 | Basel 3.1 Defaulted Exposures |
B31-L |
L1–L23 | Basel 3.1 Equity Approach |
B31-M |
M1–M12 | Basel 3.1 Model Permissions |
M3.1 |
— | Dual-framework comparison |
M3.2 |
— | Capital impact analysis |
M3.3 |
— | Transitional floor modelling |
STRESS |
1–14 | Pipeline stress tests (10K–100K scale) |
HIER |
1–6 | Hierarchy resolution scenarios |
CLASS |
1–8 | Classification scenarios |
CONFIG |
1–6 | Configuration scenarios |
For Developers¶
These specifications are verified through acceptance tests in tests/acceptance/. See the Testing Guide for details on running tests.