← All projects

Counterparty credit · Python · PySide6/Qt6 · Jul 2026

Counterparty Credit Underwriting Workbench icon

Counterparty Credit Underwriting Workbench

A desktop app that teaches the OTC derivatives counterparty-credit underwriting decision (exposure, collateral, limits and CVA) on synthetic data. Give it a proposed trade and it measures the exposure, prices the counterparty risk, checks limits, models collateral and drafts an underwriting memo with a recommendation.

Why: Built after applying for a derivatives underwriting role, to learn what the job involves and to practice it. It includes a 17-stage simulator campaign scored against best play.

Features

Five products: interest rate swaps, FX forwards, CDS, European swaptions and cross-currency swaps, netted under an ISDA masterCounterparty credit from a Merton/KMV distance-to-default and an Altman Z-score, mapped to a rating and PD curveMonte Carlo exposure: EE, EPE, PFE at 95% and 99%, peak PFE and the exposure coneCSA collateral: threshold, MTA, initial margin, margin period of risk and FX haircutsCVA, DVA, BCVA and FVA, with an optional wrong-way-risk tiltCredit limit checks with utilization, headroom and incremental exposureScenario stress tests and DV01, CS01 and FX delta sensitivitiesAn underwriting memo with a recommendation, exportable as HTML and PDFA 17-stage training simulator with a coach, predict-then-reveal and scoring against best playRuns offline on a bundled synthetic market snapshot; reproducible runs with saved seeds

Skills learned: Exposure simulation, credit valuation adjustments, collateral mechanics, and writing a recommendation a reviewer can challenge.

Derivatives Underwriting Workbench Deal overview page in the Graphite theme

Deal overview

Deal header, KPI strip (peak PFE, limit use, EPE, CVA/DVA/FVA, MtM, recommendation), exposure profile, counterparty credit, limit check, the drafted decision and the netting set with today's MtM.

Derivatives Underwriting Workbench Exposure page in the Graphite theme

Exposure

Monte Carlo EE and the PFE 95/99 cone for the netting set including the proposed trade, with the key numbers and a plain-English reading.

Derivatives Underwriting Workbench Collateral & CSA page in the Graphite theme

Collateral & CSA

Threshold, MTA, initial margin and margin period of risk applied to the simulated exposure: collateralized vs uncollateralized EE.

Derivatives Underwriting Workbench XVA page in the Graphite theme

XVA

CVA, DVA and FVA with per-period CVA contributions; wrong-way risk and LGD come from Preferences.

Derivatives Underwriting Workbench Curves & credit page in the Graphite theme

Curves & credit

Editable discount and CDS curves from the market snapshot, plotted and tabulated.

Derivatives Underwriting Workbench Training simulator page in the Graphite theme

Training simulator

A guided underwriting campaign: deals arrive round by round, the coach explains each one, and the run is scored against best play.