Quant with Vahab
Quant Systems Lab · Control Systems for Quantitative Finance

Scenario and Stress Engine

Scenarios apply coherent shocks to market snapshots and revalue portfolios for risk and regulation.

Explanation

Scenarios define joint shocks to risk factors, such as parallel rate shifts, equity crashes, or spread widens.

A stress engine transforms a base market snapshot according to a scenario and calls the pricing library for revaluation.

Regulatory and internal stress tests rely on consistent scenario definitions across desks and legal entities.

Efficient scenario engines batch valuations and reuse common precomputations to handle thousands of scenarios.


scenariosstress testingriskvaluation
Interactive visualisation

This diagram applies a joint stress scenario to three risk factors (equity, rates, credit) and shows the resulting stressed P&L. Use the presets and sliders to see how coherent factor shocks propagate through exposures into total stress loss.

Total stress P&L ≈ +4.90m
0 P&LStressed P&L (per factor and total)Equity shock-8.0 %EquityRates shock40.0 bpsRatesCredit shock60.0 bpsCreditTotal stress P&L4.90mscenario shocks (per factor)positive / negative stress P&Lscenario engine = shocks ⊗ exposures
Numbers
Equity: shock -8.0% · P&L ≈ 8.00m
Rates: shock 40 bps · P&L ≈ -1.60m
Credit: shock 60 bps · P&L ≈ -1.50m
Total scenario P&L ≈ +4.90m
Interpretation

A scenario is a vector of coherent shocks, not a pile of unrelated tweaks. The stress engine takes this vector, applies it to the market snapshot, and lets the pricing stack convert exposures into factor P&L and total loss.

The practitioner’s view: a good scenario engine makes it trivial to express regulatory and internal shocks as reusable objects and to run them across many portfolios. The key is consistency of factors (the axes) and deterministic wiring, so that “Equity crash” means the same thing everywhere and stress results can be compared across desks and time.