Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Portfolio & Risk
Risk & Return
CAPM
Fama–French
Portfolio Lab
LabPortfolio desk
Portfolio Optimization
Systemic Risk
NetworkShock simulationHistorical episodes
Connected Guides
  • Credit risk: default probabilities and credit spreads
  • Value at Risk and expected shortfall
  • Systemic risk and contagion

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Systemic Risk: Shock Simulation

Fail an institution and play the contagion day by day through counterparty losses, fire sales and funding runs, then try to stop it with capital.

Shock setup

Start from a scenario

Failed at day 0: Dealer bank C. Click another institution to fail that one instead.

Crash an asset class

What you are about to hit

Assets
$341bn · 9.5% of the system
Leverage
21.2×
Knock-on reach (DebtRank)
41%
Lenders to it
15 · largest: Money market fund A, $31.4bn
Asset classHeld in totalDay-0 loss
Government bondsLargest holder: Dealer bank A$735bn–
Corporate bondsLargest holder: Insurer A$312bn–
Mortgage bondsLargest holder: Dealer bank A$261bn–
EquitiesLargest holder: Hedge fund A$153bn–

No price drop set. The whole system has $246bn of equity to absorb losses.

Contagion channels

Counterparty losses

A failed borrower repays only part of what it owes, so its lenders lose money.

Fire sales

Stressed institutions sell assets to cut leverage; prices fall and every holder loses.

Funding runs

Short-term lenders and depositors pull money from weak institutions, forcing sales.

CCP loss sharing

The clearing house absorbs a member's failure, then passes what is left to the other members.

Contagion on the network

Day 60
Day 0Day 60
Institutions failed
Failed (% of institutions)
Cumulative loss by channel
Counterparty lossesFire salesFunding runsCCP loss sharing
Asset prices (% of start)
Government bondsCorporate bondsMortgage bondsEquities

Outcome after 60 days

Total loss
$147bn
Institutions failed
10
Deepest price drop
−28%
Calm from
Day 48

Where the loss came from

  • Counterparty losses67%
  • Fire sales29%
  • Funding runs0%
  • CCP loss sharing4%

Two surprises

Why?

Turn fire sales on. Can an institution with no exposure to the failed one still fail?

Why?

Switch funding runs off. Fewer institutions fail, but which ones are saved?

How to read this simulation

The network holds stylised institutions: dealer banks, banks, regional banks, money market funds, hedge funds, insurers and one central counterparty. None of them is a real firm and the balance sheets are round numbers chosen to behave like the real thing. Each has cash, loans, securities and liabilities, and the lines between them are loans, repos and derivative contracts. A node turns stressed when its capital falls below four fifths of where it started, critical below half, and failed when it is gone. Failed nodes are hollow with a cross, so colour is never the only signal.

Four channels carry a loss. Counterparty losses travel along the lines: when a borrower fails, its lenders write off a share of what they are owed. Fire sales travel through prices: an institution short of capital sells assets, the price falls a little for every dollar sold, and everyone holding that asset is marked down, including institutions that never dealt with the failed one. Funding runs travel through confidence: short-term lenders and depositors withdraw from institutions that look weak, which forces more selling. Loss sharing at the clearing house passes a failed member's loss to the surviving members. Switch each channel off in turn to see how much of the damage it explains.

The simulation runs once per setup, and playback only moves through the stored days, so scrubbing is instant. Pin a run on the failures chart, change a switch, and the earlier curve stays behind as a ghost. The rescue game asks you to beat a rule of thumb with the same money, and the last mode sweeps network density to show why a system can be sturdy against small shocks and fragile against the wrong one.