Where you are. Module 5 built futures, perpetuals, options and the margin machinery that contains them, all on venues it treated as given. This lesson asks what those venues look like when they are rebuilt on a shared ledger, and finds the design question is simpler and sharper than expected.
Somebody wants to go long with leverage. Somebody has to be short.
On a traditional exchange that somebody is another trader, found through an order book. That is one answer. The other is that a pool of capital stands ready to take whatever side the traders collectively do not want, and it is a genuinely different animal.
The idea in one paragraph
A derivatives venue can match traders against each other through an order book, which needs enough participants on both sides to work at all, or it can put a pool of provider capital on the other side of everything, which works from the first trade but makes those providers the counterparty to the market’s collective view. The order book has no opinion and needs liquidity; the vault supplies liquidity and inherits an opinion it did not choose. Neither is better in the abstract. The vault’s profit and loss is decided entirely by whether the traders it faces are right, which turns out to depend less on the traders than on what kind of market it is.
The two regimes
The exercise runs the same trader behaviour against two kinds of market. The traders lean the way the price just moved, which is not a slur on them; it is the most reliable feature of retail flow there is.
In a choppy, mean-reverting market, that leaning is wrong most of the time. Each move is mostly noise and is half taken back next round, so the position the traders put on loses, and the vault on the other side gains.
In a trending market, the same leaning is right. The traders are long into a rising price, they make money, and the vault that is short into it pays for all of it.
| market | vault profit and loss |
|---|---|
| choppy and mean-reverting | +74 |
| trending in one direction | -52 |
n = 2 trials · 60 rounds, identical trader behaviour, two price regimes
Which venues actually run
That last sentence is the durable part. The mechanisms in this module are stable; the venue names are not, and a course that taught the names would be teaching the thing most likely to be wrong by the time it was read.
Check yourself
1. What is the design question that separates the two architectures?
Who takes the other side of your trade. An order book matches you against another trader and needs enough of them to work; a vault puts pooled provider capital opposite you and works from the first trade, at the cost of making those providers the counterparty to the whole market.
2. Why does the vault make money in a choppy market and lose in a trend?
Because the traders lean the way the price just moved. In a mean-reverting market that signal is mostly noise and their positions lose, so the vault gains. In a trend the same signal is right, the traders gain, and the vault holding the mirror position pays.
3. A vault reports eighteen months of steady returns. What should you ask?
What regime produced them, and what the return would have been through a sustained directional move. A record made entirely in choppy conditions says nothing about the case that generates the losses, and that case arrives in size rather than gradually.
4. Why does this lesson avoid teaching the venue names?
Because they change fast: the leaderboard has reshuffled substantially inside a year, with the previous generation’s leaders falling to low single-digit share. The mechanisms are stable and the names are the part most likely to be wrong by the time anybody reads it.
Do this
Run the vault through both regimes.
python3 code/vault_dex.py
The starter provides the two price paths and the momentum-leaning trader flow, and leaves you vault_pnl: each round the vault holds the negative of the traders’ net position, marked from this price to the next. The assertions check that the vault loses into the trend, gains in the chop, and that the two regimes are not close.
The completed version is in solutions/vault_dex.py.
What you can now do. You can simulate a vault against trader flow, explain why its return is decided by the market’s regime rather than its own skill, and read a vault’s track record for the regime that produced it. The next lesson asks what price the venue should use to decide somebody is out of margin.