Where you are. Thirteen lessons have produced a set of parts that were each built for their own reason. This lesson notices that they compose into something with a name.
Module 3 spent six lessons on the machinery that moves currency between countries: correspondents, nostro accounts, the versus family, netting hubs. It was a great deal of institutional apparatus assembled over a century.
Look at what this module has built. A quoting engine among vetted firms. A membership rule that decides who may ask. A settlement primitive that is both-or-neither across ledgers that do not trust each other. Put those three together and you have most of a clearing rail, assembled from parts built for other purposes.
The idea in one paragraph
A clearing rail is not one invention. It is a quoting mechanism, a membership boundary, a settlement guarantee and a netting step, and this module has built all four separately. Stacking them gives a stablecoin-to-stablecoin corridor with atomic settlement and vetted counterparties, which is functionally what module 3’s apparatus provides. Netting then does the same job it did there: most of a day’s obligations offset each other, so only the residual has to cross, and the cross-ledger settlement primitive is expensive enough that reducing the number of crossings matters more here than it did within a single ledger.
What netting saves
The exercise nets a seeded day of eight obligations among three members.
The gross total is 1,950. After netting, one member is owed 200, the other two owe 50 and 150, and the value that actually has to cross between ledgers is 200. That is a 90 percent reduction, and the number of settlement events falls from eight to three.
| measure | gross | netted |
|---|---|---|
| value crossing | 1,950 | 200 |
| settlement events | 8 | 3 |
n = 8 trials · one day of obligations among three members
The nets sum to zero, as they must: every obligation has two sides, so the hub is a point of measurement rather than a participant with a position. That is the same check module 3 applied and the same check module 5’s clearing house applied, arriving a third time.
What is genuinely new
Being clear-eyed about this matters, because the temptation is to claim more than has happened.
What is new is not the rail’s structure, which is old. It is that the settlement primitive underneath it works between parties who share no institution: module 3’s netting hub required everyone to hold accounts at a common place, and lesson 13’s locks require nothing of the kind. That removes the hub as a party that must be trusted, capitalised and governed, which is a real change to who has to agree to what before a corridor can exist.
It does not remove the need for members to agree the rules, price the trades or resolve disputes, all of which remain exactly as institutional as they ever were.
The consortium question
There is a question this lesson cannot answer with code, and it is the one that decides whether any of it happens.
A rail that nobody owns needs somebody to run it. Somebody has to admit members, publish the rules, decide what happens when two members disagree about whether a trade occurred, and hold the thing together when a participant fails. Module 3’s correspondent network answered that with a century of accumulated institutional practice; module 5’s clearing house answered it with a capitalised entity and a rulebook.
The token version has removed the need for that party to hold anybody’s assets, which is a genuine reduction in what must be trusted. It has not removed the need for the party. Every consortium in this space is currently arguing about who it is, and the argument is governance rather than engineering, which is why it moves at the speed it does.
Check yourself
1. What four parts make a clearing rail, and where did this module build them?
A quoting mechanism (lesson 5), a membership boundary (lesson 5), an atomic settlement guarantee (lesson 13) and netting (this lesson, following module 3). Three of the four were built for their own reasons before anybody called the result a rail.
2. Netting cuts 1,950 of obligations to 200 crossing. Why does that matter more here than within one ledger?
Because cross-ledger settlement is expensive: each crossing is a lock protocol with deadlines and watching, rather than a single posting. Reducing eight crossings to three is a larger saving here than the same reduction would be inside one book.
3. What does netting reintroduce?
Exposure between the moment obligations are agreed and the moment the net settles, which is exactly what atomic settlement removed. Efficiency and atomicity are in direct tension, and choosing between them is a real decision rather than a detail.
4. What is genuinely new about this rail?
That the settlement primitive works between parties who share no institution. Module 3’s netting required a common hub where everyone held accounts; the locks require nothing of the kind, which removes a party that had to be trusted, capitalised and governed.
Do this
Net the day and count the crossings.
python3 code/fx_rail.py
The starter provides the membership gate and the day’s obligations, and leaves you net_positions: return each member’s net, positive when owed and negative when owing. The assertions check that the nets sum to zero, that netting cuts both the value crossing and the number of crossings, and that the saving on this day exceeds sixty percent.
The completed version is in solutions/fx_rail.py.
What you can now do. You can assemble a clearing rail from parts built for other purposes, measure what netting saves across ledgers, and name the exposure it puts back. The next lesson follows the collateral that moves along it.