Chapter 1 - The Dealer Book
This chapter begins with one deceptively simple question:
When a customer buys BTC from a dealer, what changes on the dealer’s book?
It’s the right place to start, because the book is where every trade lands first. Once you can follow the dealer’s book, the rest of the system becomes easier to understand: spreads, inventory skew, partial hedging, internalization, toxic flow, liquidation pressure, and why survival controls matter more than average spread capture.
The goal is to understand the operating system inside a professional liquidity providing business.
First, Follow The Trade
Section titled “First, Follow The Trade”To understand the dealer book, we need to follow the trades from the dealer’s side.
Customer A wants long BTC exposure. So Customer A buys 1 BTC from the dealer.
Sounds simple, but it contains the key inversion:
| Customer View | Dealer View |
|---|---|
Customer A bought 1 BTC. | The dealer sold 1 BTC. |
| Customer A is now long BTC. | The dealer is now short BTC. |
The dealer is the counterparty. If the customer buys, the dealer sells. If the customer sells, the dealer buys.
So when we track the dealer’s book, a customer buy creates negative dealer inventory from customer flow.
Customer A buys 1 BTC from the dealer.Dealer sells 1 BTC to Customer A.
Dealer inventory created by customer flow = -1 BTCHere, -1 BTC is the dealer-side inventory created by customer flow. It means
the dealer has sold 1 BTC of exposure to the customer and is now short 1 BTC
from that flow.
Now flip the trade.
Customer B wants to reduce BTC exposure, or wants short BTC exposure. So
Customer B sells 1 BTC to the dealer.
Customer B sells 1 BTC to the dealer.Dealer buys 1 BTC from Customer B.
Dealer inventory created by customer flow = +1 BTCNow the dealer is long 1 BTC from customer flow.
This is the accounting foundation for the rest of the chapter. Hedges, internalization, quote skew, stale quotes, toxic flow, and liquidation pressure all sit on top of this.
The Three Numbers That Matter
Section titled “The Three Numbers That Matter”In this chapter, the dealer tracks three BTC quantities:
| Symbol | Meaning |
|---|---|
I_client | I means inventory. The _client subscript means this is the dealer’s inventory created by customer trades. The sign convention is explained below. |
H_external | H means hedge. The _external subscript means this is the dealer’s hedge position from buying or selling BTC on external venues. The sign convention is explained below. |
R_residual | R means residual. This is the dealer’s remaining unhedged delta after customer-created inventory and external hedges are combined: I_client + H_external. The sign convention is explained below. |
The signs are always from the dealer’s point of view:
- when a customer wants long BTC exposure, they buy BTC from the dealer. The
dealer has sold BTC to the customer, so
I_clientdecreases. WhenI_clientis below zero, the dealer is short from customer flow; - when a customer wants less BTC exposure, or wants short BTC exposure, they
sell BTC to the dealer. The dealer has bought BTC from the customer, so
I_clientincreases. WhenI_clientis above zero, the dealer is long from customer flow; - when the dealer buys BTC externally,
H_externalincreases. This can offset a negativeI_client; - when the dealer sells BTC externally,
H_externaldecreases. This can offset a positiveI_client.
If R_residual is positive, the dealer is net long BTC. If it is negative, the
dealer is net short BTC.
Dealer book trainer
I_client 0.0 + H_external 0.0 = R_residual 0.0 Start flat. A customer trade creates dealer inventory. A hedge changes what risk remains.
Book is flat. Quote normally. No hedge is needed.
A market maker’s basic role is to stand ready to buy and sell at quoted prices, not merely to make a directional price prediction [C016]. But standing ready creates inventory. Inventory creates mark-to-market risk. That is the machine we are about to inspect.
Toy Risk Band
Section titled “Toy Risk Band”Production firms use richer risk systems than this, but a small toy model is enough to make the mechanics visible.
| Band | Toy Rule | Engine Bias |
|---|---|---|
| Green | abs(R_residual) <= 1.0 BTC | Quote normally. |
| Amber | 1.0 < abs(R_residual) <= 2.5 BTC | Skew quotes and consider a partial hedge. |
| Red | abs(R_residual) > 2.5 BTC or fair value looks stale | Reduce size, widen, hedge, or pause. |
These thresholds are synthetic. The source-backed idea is the direction of the control logic: inventory and volatility affect quoting and risk controls [C024]. For a real broker example, IG describes Board-approved limits, stress tests, and hedging triggers, but that example is IG-specific [C035].
Interactive Replay
Section titled “Interactive Replay”Use this widget as the live version of the replay below. Step through the event tape, change the volatility regime, and move the risk-aversion slider. Watch the same client flow produce different quote skew, risk bands, and control actions.
Step 1: A Customer Buys 1 BTC
Section titled “Step 1: A Customer Buys 1 BTC”Start flat:
I_client = 0 BTCH_external = 0 BTCR_residual = 0 BTCfair value = $100,000The dealer quotes:
bid = $99,950ask = $100,050A customer buys 1 BTC from the dealer at the ask, $100,050. The customer
wants long BTC exposure.
From the customer’s view, this is just a buy. From the dealer’s view, it is a
sale. The dealer sold 1 BTC to the customer, so the dealer’s customer-created
inventory is now negative:
I_client = -1 BTCH_external = 0 BTCR_residual = -1 BTCThe dealer is now short 1 BTC. If fair value is still $100,000, the dealer
has a +$50 spread edge on this fill:
1 * ($100,050 - $100,000) = +$50But that +$50 is not a free lunch. The dealer is carrying a short residual.
If BTC jumps before the dealer receives offsetting flow or hedges, the short
inventory loses.
This is the first core lesson: spread capture and inventory risk are different PnL buckets.
Step 2: More One-Sided Flow Arrives
Section titled “Step 2: More One-Sided Flow Arrives”Fair value nudges to $100,020.
Another customer buys 2 BTC from the dealer at $100,070.
The new fill creates another +$100 of spread edge:
2 * ($100,070 - $100,020) = +$100But the dealer’s customer-created inventory is now:
I_client = -3 BTCH_external = 0 BTCR_residual = -3 BTCThe book is past the toy red band. The dealer has captured spread, but the inventory is now large enough that the next BTC move can dominate that spread.
The dealer buys 2 BTC externally at $100,090.
I_client = -3 BTCH_external = +2 BTCR_residual = -1 BTCThe hedge reduced the residual short from 3 BTC to 1 BTC, but it was not
free. The hedge traded $70/BTC above the fair value used by the toy engine:
-2 * ($100,090 - $100,020) = -$140That is the second core lesson: hedging reduces inventory risk, but it creates execution cost, slippage, fees, basis risk, and operational complexity. The toy model hedges back to a band instead of hedging every fill to zero.
Step 3: Flow Flips
Section titled “Step 3: Flow Flips”BTC fair value rises to $100,500.
The remaining residual short of 1 BTC loses:
1 * ($100,500 - $100,020) = -$480Now a customer sells 1.5 BTC to the dealer at the bid, $100,450.
The dealer buys from the customer:
I_client = -1.5 BTCH_external = +2.0 BTCR_residual = +0.5 BTCThe new customer sale gives the dealer +$75 of bid edge:
1.5 * ($100,500 - $100,450) = +$75The book has flipped from residual short to slightly long.
This is where internalized offsetting flow matters. The customer sell partly offsets previous customer buys without requiring a new external hedge trade. That does not make every internalization model good or bad. It just shows the mechanic: opposing customer flow can reduce external hedge activity in a dealer book.
In CFD/provider contexts, the conflict question appears when the provider is also the counterparty and does not hedge client trades; ESMA identifies that as a conflict risk for some providers [C031]. Separately, IG publicly describes a hybrid model in which it internalizes matching client flow, accepts some residual market risk for instant execution, and hedges externally near predefined limits [C034, C035]. Keep that scoped: it is an IG-specific public example, not a universal broker model.
Step 4: A Toxic Stale-Quote Event
Section titled “Step 4: A Toxic Stale-Quote Event”Now the regime changes.
The dealer’s displayed fair value still looks like $100,500, but fresh
external fair value is closer to $99,500. The dealer’s quote is stale.
A fast customer sells 2 BTC into the stale bid at $100,450.
Before any control action, the dealer book becomes:
I_client = +0.5 BTCH_external = +2.0 BTCR_residual = +2.5 BTCTwo losses appear at once.
First, the existing residual long of 0.5 BTC loses on the fair-value drop:
0.5 * ($99,500 - $100,500) = -$500Second, the stale fill itself is badly marked. The dealer bought 2 BTC from
the customer at $100,450 when fresh fair is closer to $99,500:
2 * ($99,500 - $100,450) = -$1,900This is adverse selection in the body, not as a definition. The dealer was picked off at a stale price. Market-structure literature frames adverse selection as one source of bid-ask spread [C021], toxic flow as order flow that adversely selects liquidity providers [C022], and continuous serial order books as vulnerable to stale-quote races after information shocks [C023].
In this toy replay, the engine treats the state as red. It widens, reduces
size, and sells 1.5 BTC externally at $99,460.
I_client = +0.5 BTCH_external = +0.5 BTCR_residual = +1.0 BTCThe protective hedge costs another $60 relative to fresh fair:
1.5 * ($99,460 - $99,500) = -$60The hedge is painful, but the alternative is carrying a larger long book in a stale, stressed, or toxic regime.
Step 5: The Book Recovers, But The Lesson Does Not
Section titled “Step 5: The Book Recovers, But The Lesson Does Not”Fair value recovers from $99,500 to $99,800.
The remaining residual long of 1 BTC gains:
1 * ($99,800 - $99,500) = +$300That gain is inventory PnL. It is not spread capture. This distinction matters because two dealer books with the same total PnL can have completely different diagnoses:
- one made money by repeatedly earning spread while staying near flat;
- one made money because it accidentally carried a directional exposure that happened to move favorably.
Professional risk systems need that decomposition. Otherwise the operator cannot tell whether the quote engine is good, the hedge engine is too slow, the reference price is stale, or the book merely got lucky.
PnL Decomposition
Section titled “PnL Decomposition”Here is the whole replay separated into buckets:
| Component | Toy Calculation | Meaning |
|---|---|---|
| Client spread edge | +$50 + $100 + $75 = +$225 | Edge on ordinary client fills before the toxic stale-fill treatment. |
| Residual inventory markout | -$20 - $480 - $500 + $300 = -$700 | PnL from carrying unhedged residual delta through fair-value moves. |
| External hedge cost | -$140 - $60 = -$200 | Cost of reducing risk through external execution. |
| Toxic stale-fill markout | -$1,900 | Loss from buying at a stale bid against faster or better-informed flow. |
| Net lesson | +$225 - $700 - $200 - $1,900 = -$2,575 | Positive spread edge can be overwhelmed by markout and hedge cost. |
This is why market making is not “earn the spread.” The spread is one revenue line inside a survival machine.
How The Quote Should React In The Toy Model
Section titled “How The Quote Should React In The Toy Model”When the dealer is long residual BTC, the engine wants to reduce long exposure. It can:
- make selling inventory to customers more attractive;
- make buying more BTC from customers less attractive;
- reduce size;
- widen spread;
- hedge externally;
- pause if the quote or fair value is suspect.
When the dealer is short residual BTC, the signs flip.
The precise quote formula belongs in a later widget. The intuition is already enough: inventory moves the dealer’s preferred price away from the mid. In inventory-sensitive market-making models, the quote changes as inventory moves away from target [C024].
Widget: MakerInventory
Section titled “Widget: MakerInventory”The first interactive block should let the reader step through each trade and watch the three book quantities change:
I_clientH_externalR_residual = I_client + H_externalRequired behavior:
| Action | State Change |
|---|---|
| Customer buys from dealer | I_client -= quantity |
| Customer sells to dealer | I_client += quantity |
| Dealer buys external hedge | H_external += quantity |
| Dealer sells external hedge | H_external -= quantity |
The widget should show four PnL bars:
- spread edge;
- residual inventory markout;
- external hedge cost;
- toxic/stale-flow markout.
The widget must never label inventory PnL as spread capture.
Widget: DealerBook
Section titled “Widget: DealerBook”The second interactive block should show the book as three lanes:
| Lane | What It Shows |
|---|---|
| Client lane | Customer buys and sells. |
| Dealer lane | Internal inventory and residual delta. |
| Hedge lane | External hedge trades and hedge cost. |
The important visual moment is Step 3: the customer sell offsets earlier customer buys. That is internalization as a balance-sheet mechanism.
The second important visual moment is Step 4: internalization stops being enough when the fair value is stale and flow is adverse. The engine must switch from ordinary quote logic into protective logic.
Widget: InternalizationHeatmap
Section titled “Widget: InternalizationHeatmap”The third interactive block should show how the preferred action changes as the environment changes.
| Input | Low | High |
|---|---|---|
| Client flow balance | Two-sided offsetting flow | One-sided flow |
| Toxicity score | Benign/random flow | Stale-quote or informed flow |
| Volatility | Calm | Stressed |
| Hedge cost | Cheap/deep venue | Expensive/thin venue |
| Latency risk | Fresh reference | Stale reference |
The output can be one of:
internalizeskewpartial_hedgefull_hedgewidenpauseFor the first implementation, the risk proxy can stay simple:
inventoryRiskProxy = abs(R_residual) * fairPrice * volatilityShockThis is not production VaR. It is a teaching proxy that shows why the same
1 BTC residual is less alarming in calm markets and more alarming in stressed
markets.
What This Chapter Is Not Claiming
Section titled “What This Chapter Is Not Claiming”This chapter deliberately avoids several common overclaims:
- it does not treat “A-book” and “B-book” as formal verified taxonomy;
- it does not claim every CFD broker uses the same internalization model;
- it does not claim every perpetual futures exchange warehouses market risk;
- it does not claim the BTC prices, spreads, thresholds, or hedge costs are real market data;
- it does not recommend any trade, hedge, or retail strategy.
Evidence Notes
Section titled “Evidence Notes”The claim IDs below point into claim-register.md, which points into the
verified source ledger.
| Claim ID | Used Here For |
|---|---|
| C016 | Market maker role as standing ready to buy and sell at quoted prices. |
| C021 | Adverse selection as one source of bid-ask spread. |
| C022 | Toxic flow as flow that adversely selects liquidity providers. |
| C023 | Stale-quote sniping/racing in continuous serial limit order books. |
| C024 | Inventory-sensitive market-making intuition and quote skew. |
| C031 | CFD provider conflict risk where provider is counterparty and does not hedge. |
| C034 | IG-specific hybrid model: internalized matching flow, residual risk, external hedging near limits. |
| C035 | IG-specific market-risk controls and hedging trigger language. |
| C052, C053 | Control-system context: pre-trade controls and operational failure risk. |
Next chapter: order books, maker/taker incentives, queue priority, and how the first spread forms before a dealer ever touches the book.