Home / Tutorials / Margin

Margin & Prime Brokerage — how the margin call is computed

Modules
10
Labs
Every module

About this track

Every margin methodology — from the fixed percentages of Reg T to a prime broker's house model — is an answer to one question: if this client defaults now, and I liquidate over the next few days, how much do I lose?This track walks the whole landscape: rules-based margin, the scenario grids behind portfolio margin and SPAN, the add-ons where real houses differentiate, cross-margining and its correlation traps, what digital assets break, and how the engine is actually built and backtested. There's an interactive lab in every module, and the track connects to the Fixed Income material on VaR, SIMM and repo.

Modules

#ModuleWhat it coversLab 
Module 0

Initial margin vs variation margin

VM settles the past, IM pre-funds the close-out window — the default timeline, the margin period of risk, segregation, SIMM and MVA.🎛 Default-timeline simulatorAvailable
Module 1

The one question every margin model answers

If this client defaults now, how much do I lose before I'm out? Risk measure, liquidation horizon, add-ons — and why Reg T over-margins hedged books.🎛 Reg T vs risk-based labAvailable
Module 2

Portfolio margin & the scenario grid

The OCC/TIMS approach: shock spot and vol across a grid, fully reprice everything, charge the worst cell — the ancestor of every risk-based system.🎛 Interactive scenario gridAvailable
Module 3

SPAN & SPAN 2 — the futures standard

The 16-scenario risk array, the charges that scanning misses (spreads, delivery, the short option minimum), and why SPAN 2 moves to VaR.🎛 Risk array explorerAvailable
Module 4

House margin — where the add-ons live

The base number is commoditized; concentration (√t), liquidity, gap, wrong-way and stress add-ons are where prime brokers differentiate.🎛 Add-on stack builderAvailable
Module 5

Cross-margining & the correlation problem

Offsets are only worth granting if the correlation survives the liquidation scenario — stressed correlations, offset caps, and cross-entity netting.🎛 Correlation stress labAvailable
Module 6

Digital assets — what actually breaks

24/7 markets, vol several times equity scale, venue and custody risk, stablecoin haircuts, and the weekend gap in the margin period of risk.🎛 Crypto scan-range calibratorAvailable
Module 7

Inside a margin engine

The seven-stage pipeline from positions to margin call — reproducibility, caching, add-ons as config, and the millisecond pre-trade what-if API.🎛 Pipeline explorerAvailable
Module 8

Backtesting the margin model

Did losses ever exceed the margin held? Exception counting, Kupiec and Christoffersen tests, and the traffic-light zones — same machinery as VaR backtesting.🎛 Exception counterAvailable
Module 9

Wrong-way risk

Exposure that peaks exactly when the counterparty is most likely to default — specific vs general WWR, the monoline and crypto-collateral cases, and Basel's alpha.🎛 Wrong-way scenario labAvailable

Start with Module 0

Initial margin vs variation margin on the default timeline — the two collateral flows everything else in this track exists to compute.

Open IM vs VM →

Educational analysis, not investment advice.

How are we doing?