All Work

SA-CCR Calculator

A risk calculator helps financial teams estimate exposure if a trading counterparty fails to pay. It combines trade data and collateral-agreement terms into reviewable calculations, making the inputs and assumptions easier to check.

Finance & QuantRole: Architect & LeadLive

Problem

Banks and financial institutions must calculate counterparty credit risk exposure under the Standardised Approach for Counterparty Credit Risk (SA-CCR), mandated by Basel III (BCBS 279, BCBS 424). The methodology is complex — involving replacement cost, potential future exposure across 5 asset classes, netting sets, and margin agreements. Most implementations are locked inside proprietary risk systems. There's no accessible, auditable tool for understanding or validating SA-CCR calculations.

Solution

A comprehensive regulatory risk calculator that implements the full SA-CCR methodology, plus complementary risk measures (PFE, VaR, Initial Margin). Includes an AI-powered VM-CSA document analyzer that extracts margin agreement parameters from legal documents.

Key Technical Decisions

Zod for calculation validation — Financial calculations must be auditable. Every input is validated through Zod schemas before entering the calculation pipeline. This catches data quality issues at the boundary (negative notionals, mismatched currency pairs, invalid asset class codes) rather than producing silently wrong numbers downstream.

Client-side computation, no backend — SA-CCR calculations are deterministic and don't require server state. Running everything client-side means: zero latency on recalculation, no API cost, works offline, and the user's trade data never leaves their browser. The only server call is the optional AI document analysis.

Recharts for regulatory reporting — The output includes waterfall charts showing how each component contributes to the final EAD. Regulators and risk managers expect specific visual formats. Recharts' composability made it straightforward to build the exact chart types that match regulatory reporting standards.

Impact

  • Full BCBS 279 / BCBS 424 SA-CCR implementation with 5 asset class add-ons
  • AI-powered VM-CSA analysis — extracts margin parameters from legal documents
  • Complementary risk measures: PFE, VaR, Initial Margin calculators
  • Zero-backend architecture — all calculations client-side, trade data never transmitted
  • Audit trail for every calculation step — shows intermediate values, not just final EAD

Technical Stack

LayerTechnology
FrontendNext.js 15, React 19, TypeScript, Recharts, Tailwind CSS
ValidationZod
AIOpenAI (VM-CSA document analysis)
InfrastructureVercel

How engagements like this are scoped and delivered: How I Work.