K = LGD × Φ[√(1−R)⁻¹·Φ⁻¹(PD) + √(R/(1−R))·Φ⁻¹(0.999)] − PD·LGD RWA = K × 12.5 × EAD R = 0.12·(1−e⁻⁵⁰·ᴾᴰ)/(1−e⁻⁵⁰) + 0.24·[1 − (1−e⁻⁵⁰·ᴾᴰ)/(1−e⁻⁵⁰)] b = (0.11852 − 0.05478·ln(PD))² MA = (1 + (M − 2.5)·b) / (1 − 1.5·b) Φ(x) = ½·[1 + erf(x/√2)] EL = PD × LGD RW = K · 12.5 CCF × Off-Balance = EAD SA: RWA = EAD × RW% Φ⁻¹(PD) N[(1−R)⁻⁰·⁵ · G(PD)] PD ∈ [0.0003, 1] G(0.999) ≈ 3.0902
open source · regulatory tools · built after hours
OpenAfterHours owl

The boring half of finance,

Open-source tooling for the regulatory work that protects the public but rarely makes the slide deck — written by engineers, for engineers, in the small hours.

2 active repos licence Apache 2.0 since Q4 2025 ~1,915 tests passing Polars · uv · marimo
/// what's in the repo

Two tools, both quietly serious about regulatory plumbing.

🧮
OpenAfterHours / rwa_calculator

UK Credit Risk RWA Calculator

High-performance Risk-Weighted Assets engine for CRR (Basel 3.0) and Basel 3.1 (PRA PS1/26). Standardised, F-IRB, A-IRB, Slotting. Polars all the way down.

python polars marimo basel-3.1 pra-ps1/26
hover for the live read-out
OpenAfterHours / rwa_calculator open on github →
$pip install rwa-calculator
>>>from rwa_calc import CreditRiskCalc
>>>calc = CreditRiskCalc(framework="basel_3_1")
>>>r = calc.load("book.parquet").calculate()
computed 3,418,902 exposures · 847ms
rwa: £94.2bn · capital req: £7.54bn
>>>r.compare("crr").delta_pct
+11.8% uplift under Basel 3.1
🌙
OpenAfterHours / moonlit

Moonlit

Bundle a uv-managed project — or a whole uv workspace — into a single self-contained zipapp per PEP 441. No installer. No host venv. Just one .pyz (or .exe) and a Python.

uv zipapp pep-441 ci-friendly no-installer
hover for the live read-out
OpenAfterHours / moonlit open on github →
$uv add --dev moonlit
$moonlit build --workspace
resolving uv.lock ok
14 wheels · 0 sdist ok
writing app.pyz ok
dist/app.pyz 18.4 MB · sha256:7b…3c
$python app.pyz --check
all green · no host install required
/// open after hours

Regulation protects the public.
It shouldn't cost the bank
millions to comply.

01 / Open source by default

Transparency over secrecy.

Capital adequacy code shouldn't be a black box. Every formula is in the open, every assumption auditable, every result reproducible from the same lockfile.

02 / Lowest possible overhead

Fast enough to be invisible.

Compliance work doesn't generate revenue — every hour spent on it is a tax on the bank. Polars and uv keep that tax small. Millions of exposures in seconds, not hours.

03 / Built after hours

Made by people who've shipped this stuff.

Maintained by ex-bank engineers in the spare hours that don't belong to a quarterly cycle — which is, it turns out, exactly when good infrastructure tends to get written.