Credit Risk Methodology
Instrument-level credit analytics for corporate bond portfolios — spread sensitivity, historical spread VaR, and four custom stress scenarios.
Download PDFOverview
The Credit Risk Methodology documents the analytics behind the Corporate Bond Risk Calculator. The calculator ingests a corporate bond portfolio (CUSIP, face, price, coupon, yield-to-worst, maturity, seniority, sector, rating, call schedule) and outputs:
- Per-position analytics — modified duration, DV01, G-spread (or OAS for callable bonds), CS01
- Portfolio spread VaR/CVaR — 3-day, 99% confidence, using 10 years of ICE BofA OAS history from FRED
- Four custom stress scenarios — Worst Issuer, Sector Contagion, Market-Wide, Jump to Default
- Overall risk summary — blended 50% JTD + worst spread-stress (excluding the JTD issuer)
- Concentration analysis — by issuer, sector, rating, and seniority
This is an instrument-level methodology (bonds, not entities). For entity-level counterparty reviews see Counterparty Credit Review.
Per-position analytics
Modified duration
Computed from the bond's cash-flow schedule using a semi-annual coupon convention and yield-to-worst as the discount rate:
- Macaulay duration = Σ(t · PV(CFₜ)) / Σ(PV(CFₜ))
- Modified duration = Macaulay duration ÷ (1 + y/2)
For inputs that produce a degenerate PV (e.g. negative or zero present value of cash flows), the engine falls back to a duration approximation of years × 0.85.
DV01 and CS01
- DV01 — dollar change in price for a 1bp parallel shift in yield:
DV01 = mv × modDur × 0.0001 - CS01 — dollar change in price for a 1bp shift in credit spread, signed by long/short side:
signedCs01 = side × mv × modDur × 0.0001
CS01 and DV01 are numerically identical at first order; the distinction is interpretive (CS01 isolates the credit-spread component for stress and VaR aggregation).
Spread routing — G-spread, OAS, G-spread(YTM)
The engine selects a spread methodology per bond:
| Bond profile | Method | Label |
|---|---|---|
| Non-callable | YTW minus interpolated Treasury CMT at maturity | G-spread |
| Callable + valid call data + call in future | OAS via Black-Derman-Toy binomial tree | OAS |
| Callable but OAS bisection fails | YTM-based G-spread via Newton's method | G-spread(YTM) |
The effectiveSpreadBps field is always populated; spreadType indicates which method produced it. See web/src/lib/credit/oas-model.ts for the BDT calibration and OAS bisection.
Treasury curve
The Treasury par curve is fetched from the Treasury.gov daily XML feed (no auth required) for tenors 1mo through 30yr. CMT rates are linearly interpolated to each bond's years-to-maturity.
Spread VaR / CVaR
The calculator estimates 3-day 99% portfolio spread VaR and CVaR from historical changes in ICE BofA OAS indices:
- Source — FRED, ICE BofA US Corporate Index OAS series by rating
- Lookback — 10 years (configurable)
- Holding period — 3 trading days (sum of overlapping daily changes)
- Confidence — 99% (VaR is the (1-c) percentile of holding-period P&L; CVaR is the average loss beyond that percentile)
- Aggregation — per-position CS01 is multiplied through the historical spread-change series; results are aggregated by rating bucket then summed at the portfolio level
FRED series used
| Rating | FRED series ID | Description |
|---|---|---|
| AAA | BAMLC0A1CAAA | ICE BofA AAA US Corporate Index OAS |
| AA | BAMLC0A2CAA | ICE BofA AA US Corporate Index OAS |
| A | BAMLC0A3CA | ICE BofA A US Corporate Index OAS |
| BBB | BAMLC0A4CBBB | ICE BofA BBB US Corporate Index OAS |
| HY (BB/B/CCC) | BAMLH0A0HYM2 | ICE BofA US High Yield Index OAS |
| ALL | BAMLC0A0CM | ICE BofA US Corporate Index OAS (fallback) |
If FRED_API_KEY is not configured, the engine substitutes a synthetic OAS series parameterized by per-rating mean spread and vol so the rest of the pipeline still runs (useful for local development without API access).
Stress scenarios
Each scenario produces a StressScenario record with total loss and per-position breakdown. All four scenarios run on every portfolio.
S1 — Worst Issuer
Identifies the issuer with the largest absolute CS01 exposure, then applies a 100% spread widening (the issuer's current G-spread doubles) to every bond from that issuer.
Loss = signedCs01 × current G-spread (bps)
Useful for sizing single-name credit-event impact.
S2 — Sector Contagion
Identifies the sector containing the worst-CS01 issuer, then applies a 50% spread widening to every bond in that sector. Models broad contagion from a single credit event.
S3 — Market-Wide
Applies a 25% spread widening to every bond in the portfolio. Models a generalized risk-off move (recession, liquidity withdrawal).
S4 — Jump to Default
The worst-face-value issuer defaults. Long positions take a loss; short positions on the same issuer gain. Recovery is determined by seniority:
| Seniority | Recovery |
|---|---|
| Secured | 50% |
| Senior Unsecured | 30% |
| Senior Subordinated | 15% |
| Junior / Subordinated | 0% |
Long loss = face × (1 − recovery); short gain = face × (1 − recovery)
JTD exemptions — AAA and AA issuers are excluded from JTD selection (default probability assumed negligible). US Treasuries (debtType = 'UST', or CUSIP/issuer prefixed UST- / UST ) are always exempt.
Overall Risk
A blended summary number that combines default risk with spread risk:
Overall Risk = 50% × JTD loss + worst-of (S1, S2, S3) excluding the JTD issuer
Removing the JTD issuer from the spread scenarios avoids double-counting (the JTD scenario already monetized that issuer's worst case). Reported as OverallRiskSummary with the JTD issuer, the dominant spread scenario, and the blended dollar amount.
Concentration analysis
The calculator buckets exposures four ways and reports ConcentrationBucket records (face, MV, CS01, % of portfolio) for each:
- By issuer — top 10 issuers by absolute CS01
- By sector — all sectors used in the portfolio
- By rating — AAA through D and NR, sorted by rating quality
- By seniority — secured, senior unsecured, senior subordinated, junior
Used to flag single-name, sector, or seniority concentration before applying stress scenarios.
Bond reference data
The calculator ships with a 101-bond reference dataset (web/src/lib/credit/bond-reference.json):
- 82 investment-grade bonds — non-callable (make-whole call assumed economically equivalent), G-spread routing
- 19 high-yield bonds — flagged callable with call prices 103 / 102 / 100 by maturity, OAS routing via BDT tree
User-uploaded positions extend or override the reference set per CUSIP. Unknown CUSIPs are accepted with the user-supplied fields.
Implementation entry points
| File | Purpose |
|---|---|
web/src/lib/credit/engine.ts | Main entry: computeCreditRiskReport(); coordinates enrichment, VaR, stress, concentration |
web/src/lib/credit/oas-model.ts | Black-Derman-Toy binomial tree, OAS bisection, YTM via Newton's method |
web/src/lib/credit/treasury-curve.ts | Treasury.gov XML fetch, CMT interpolation |
web/src/lib/credit/fred-oas.ts | FRED OAS time series, spread VaR/CVaR computation, synthetic fallback |
web/src/lib/credit/types.ts | Type definitions, recovery rates, seniority labels, sector/rating enums |
web/src/lib/credit/bond-reference.json | 101-bond reference dataset |
Related modules
- Corporate Bond Risk Calculator — the UI for this methodology
- Counterparty Credit Review — entity-level (bank, BD, hedge fund) credit profiles
- VaR / CVaR Methodology — multi-asset portfolio VaR (equities, Treasuries, corporates)
- K-Factor (MIFIDPRU) — K-TCD trading counterparty default capital charge