Where you are. Module 0’s clerks met at a tavern to square up the day’s cheques. Module 3 built netting hubs for currencies. Module 4 left you with a one-day settlement window and no answer for it. This lesson is the answer, and it is the institution all of those were converging on.
Everybody owes everybody
Twenty firms trade with each other all day. By the close, each one has obligations to most of the others and claims on most of the others, and the whole thing is a web.
Two questions have no good answer in that shape. How much is any firm actually exposed, once you account for the fact that its counterparties are exposed to each other? And if one of them fails tonight, who is affected, and how far does it spread?
Nobody can answer either, because the web is not visible from inside it. Every firm knows its own edges and nobody sees the graph.
The idea in one paragraph
A central counterparty steps into the middle of every trade by novation: one trade between two members becomes two trades, each with the CCP, so no member faces any other member ever again. That collapses a web of bilateral exposures into a hub and spokes, which makes the total legible for the first time and allows all of a member’s obligations to be netted into one position. It also concentrates every exposure in the hub, which would be a catastrophic single point of failure without the protection that comes with it: initial and variation margin from every member, a default fund they all contribute to, the CCP’s own capital, and a strict order in which those resources are consumed. Counterparty risk is not abolished. It is moved somewhere it can be measured, margined and capitalised.
Compression, measured
The exercise novates a seeded day of bilateral trades among three members and computes each one’s single net position against the hub.
The gross obligations total 1,340 across eight trades. After novation the cash that actually needs to move is a fraction of that, and every member has exactly one number to settle rather than a list of counterparties. The nets sum to zero, as they must: the hub is not a participant with a position, it is the point everything is measured against.
That is the same arithmetic as module 3’s multilateral netting, now with a permanent institution attached and margin collected against the residual.
The stack, in order
The protection is a sequence agreed long before anybody needs it, and the order is the whole design.
The defaulter’s own resources go first: the variation margin it owes, then its initial margin, then its contribution to the default fund. Only when all of that is exhausted does the CCP put in its own capital - deliberately ahead of the surviving members, so that the institution has genuine skin in the game and cannot be casual about margining its members. Then, and only then, do the surviving members’ contributions absorb what remains.
Wider than the screen; scroll it sideways.
Read the stack downwards and the design argument is in the ordering rather than in any one layer.
The first three are the defaulter’s own money, which is uncontroversial: a member that fails should exhaust what it put up before anybody else contributes a penny. The fifth layer, the surviving members, is the one everybody agrees should be last. The interesting layer is the fourth, and its position is the whole of the institution’s credibility.
A clearing house sets the margin. If its own capital sat below the survivors in this stack, it could margin its members loosely, collect its fees, and let the membership absorb the consequences of its own laxity. Putting its capital ahead of them means a badly margined book costs the clearing house first, which is the only arrangement under which its incentives and its members’ point the same way. It is the same argument as a maker quoting a price it must honour, and the same argument module 6 will make about an issuer that holds its backing where it cannot spend it: a promise is worth what the promiser loses by breaking it.
The exercise walks a loss of 550 through it: variation margin, initial margin and the defaulter’s default-fund contribution absorb 500, and the CCP’s own capital takes the remaining 50. The survivors are untouched.
What it buys the market
Three things, all of which module 4 lacked. Netting, which cuts the cash and collateral the system needs. Anonymity, since neither side of a trade need care who the other was once the CCP stands between them. And a default procedure that is known in advance, so that a member failing at three in the morning triggers a documented process rather than a negotiation.
That last one is why the one-day settlement window from module 4’s project is survivable at all.
Check yourself
1. What does novation change about a trade, and what does it leave alone?
It leaves the economics untouched - the same price, quantity and dates - and changes who each side depends on. One contract between two members becomes two contracts against the CCP, so neither member has any exposure to the other.
2. Why does the CCP put its own capital in ahead of the surviving members?
So that it has genuine skin in the game. If survivors absorbed losses before the CCP did, the institution could be casual about how it margins its members and let them bear the consequences. Placing its own capital first aligns its incentives with careful risk management.
3. Why does the loss order have to be agreed before anybody needs it?
Because at the moment of a default there is no time to negotiate and every claimant has the same incentive to be paid first. A published sequence makes the outcome computable in advance, which is what allows members to size their exposure to the hub at all - the same argument module 4 made about seniority.
4. A CCP concentrates every exposure in one institution. Why is that an improvement rather than a bigger risk?
Because the exposure becomes measurable, margined and capitalised, where the bilateral web was none of those. The honest answer is that it is a trade rather than a pure improvement: many opaque risks are exchanged for one visible risk, and the system then depends entirely on that one being managed well.
Do this
Novate the trades, measure the compression, and walk a default.
python3 code/ccp.py
The starter leaves you novate, returning each member’s single net position against the hub - what it is owed minus what it owes - and provides the waterfall walk. The assertions check that the nets sum to zero, that the defaulter’s own resources are consumed first, and that a 550 loss stops at the CCP’s capital without touching the survivors. Success prints the net positions, the compression ratio, and the layers consumed.
The completed version is in solutions/ccp.py.
What you can now do. You can novate a set of trades, measure what netting saves, and walk a default through a pre-agreed stack. Every piece of this module now exists separately. The project runs them as one system.