Notes on margin, collateral and risk

Working notes from building a risk platform for digital-asset intermediaries — the arithmetic that is easy to get wrong, and the failures that only show up at the worst moment. No product pitches.