K-Risk Engines / Market risk

Understand the risk.
Trace the capital.

A transparent implementation of the FRTB standardized approach.

Follow market risk inputs through sensitivities, default risk and residual risk to a capital requirement. Inspect the calculation and its intermediate results in an open-source Excel/VBA prototype.

Illustrative K-FRTB-SA sample portfolio: capital, correlation scenarios and risk-class contributions
Reviewable VBA sourceIndependent Python referenceTraceable intermediate resultsMIT licensed

01 / The calculation

Three components. One traceable result.

K-FRTB-SA supports benchmarking, model challenge, research and education. Sensitivities and positions are inputs; the prototype makes netting, weighting and aggregation visible.

Capital = SBM + DRC + RRAO

01 / Sensitivities

Sensitivities-based method

Delta, vega and curvature across general interest rate risk, non-securitization credit spread risk, equity, commodity and foreign exchange risk.

Aggregate across risk classes under low, medium and high correlation scenarios, then take the largest total.

02 / Default

Default risk charge

Non-securitization jump-to-default exposures, with maturity scaling, obligor netting by seniority and a hedge benefit ratio for each bucket.

Inspect net exposures and bucket contributions in the workbook outputs.

03 / Residual risk

Residual risk add-on

A separate add-on for instruments bearing exotic or other residual risks, based on the applicable gross notional amounts.

Keep residual risk contributions distinct from SBM and DRC.

The prototype uses the Basel MAR21–MAR23 framework. Securitization and correlation trading portfolio coverage are outside the current prototype. Check the full scope ↗

02 / Inside the workbook

Every step leaves an explanation.

  1. 01 / INPUT

    Provide risk inputs

    Enter sensitivities and positions. Unknown classifications and invalid amounts are rejected and logged with their reasons.

  2. 02 / CALCULATE

    Inspect the assumptions

    Review risk weights and correlations on the parameter sheets, alongside their Basel paragraph references.

  3. 03 / RECONCILE

    Follow the outputs

    Inspect bucket-level results, default risk netting and the final totals. Compare outputs with the independent reference.

Open the workbook guide ↗

03 / Get started

Build from reviewable source.

1. Clone the repository

Use a Git clone to preserve the VBA checkout conventions. Current prototype development uses the integration branch below.

git clone --branch release/v0.2.0 https://github.com/danielep71/K-FRTB-SA.git cd K-FRTB-SA

2. Follow the Windows build guide

The repository contains a macro-free template and exported VBA modules. The PowerShell build script assembles the macro-enabled workbook locally; the template alone does not run the engine.

Open the full setup instructions ↗

Choose your starting point

Review the VBA modules ↗

Inspect the macro-free template ↗

Explore the Python reference ↗

Read the roadmap ↗

04 / Evidence and boundaries

Know what has been checked.

Evidence available

The project documents hand-calculated formula tests, an independent Python reference, headless LibreOffice runs of the VBA and static source checks. These establish different kinds of evidence; they do not substitute for Excel host testing or regulatory validation.

Read validation evidence ↗

Work still outstanding

Excel compilation and runtime evidence, the final platform decision and broader methodology decisions remain tracked in the repository. Consult the live issue tracker for current progress.

View open work ↗

05 / The ecosystem

Part of K-Risk Engines.

Explore the wider portfolio of transparent financial risk models, from counterparty credit risk to interest rate risk in the banking book.

Explore K-Risk Engines ↗