Skip to content

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.

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 ViewDealer 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 BTC

Here, -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 BTC

Now 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.

In this chapter, the dealer tracks three BTC quantities:

SymbolMeaning
I_clientI means inventory. The _client subscript means this is the dealer’s inventory created by customer trades. The sign convention is explained below.
H_externalH 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_residualR 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_client decreases. When I_client is 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_client increases. When I_client is above zero, the dealer is long from customer flow;
  • when the dealer buys BTC externally, H_external increases. This can offset a negative I_client;
  • when the dealer sells BTC externally, H_external decreases. This can offset a positive I_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

Customer 0.0 flat
Dealer’s book the counterparty Green
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.

1. Customer trade
2. External hedge
Green

Book is flat. Quote normally. No hedge is needed.

Book tape 0 events

    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.

    Production firms use richer risk systems than this, but a small toy model is enough to make the mechanics visible.

    BandToy RuleEngine Bias
    Greenabs(R_residual) <= 1.0 BTCQuote normally.
    Amber1.0 < abs(R_residual) <= 2.5 BTCSkew quotes and consider a partial hedge.
    Redabs(R_residual) > 2.5 BTC or fair value looks staleReduce 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].

    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.

    Interactive dealer book

    BTC replay: inventory, hedge, residual risk

    Residual delta 0.0 BTC
    Risk band Green
    Cumulative PnL $0
    Volatility regime

    Selected event

    Start flat

    The dealer starts with no client inventory, no hedge, and no residual delta.

    Reference: fresh Claims: C016

    Live book

    Balance sheet state

    Client inventory 0.0 BTC
    External hedge 0.0 BTC
    Residual delta 0.0 BTC
    Risk proxy $0

    R_residual = I_client + H_external

    Toy quote engine

    Inventory-adjusted quote

    Reference fair $100,000
    Reservation shift $0
    Suggested bid $99,950
    Suggested ask $100,050

    Flat book, normal spread, no skew.

    Control decision

    Quote normally

    The residual delta is inside the green band.

    quote_normal normal volatility

    PnL attribution

    Cumulative buckets

    Start flat:

    I_client = 0 BTC
    H_external = 0 BTC
    R_residual = 0 BTC
    fair value = $100,000

    The dealer quotes:

    bid = $99,950
    ask = $100,050

    A 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 BTC
    H_external = 0 BTC
    R_residual = -1 BTC

    The 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) = +$50

    But 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.

    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) = +$100

    But the dealer’s customer-created inventory is now:

    I_client = -3 BTC
    H_external = 0 BTC
    R_residual = -3 BTC

    The 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 BTC
    H_external = +2 BTC
    R_residual = -1 BTC

    The 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) = -$140

    That 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.

    BTC fair value rises to $100,500.

    The remaining residual short of 1 BTC loses:

    1 * ($100,500 - $100,020) = -$480

    Now a customer sells 1.5 BTC to the dealer at the bid, $100,450.

    The dealer buys from the customer:

    I_client = -1.5 BTC
    H_external = +2.0 BTC
    R_residual = +0.5 BTC

    The new customer sale gives the dealer +$75 of bid edge:

    1.5 * ($100,500 - $100,450) = +$75

    The 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.

    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 BTC
    H_external = +2.0 BTC
    R_residual = +2.5 BTC

    Two 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) = -$500

    Second, 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,900

    This 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 BTC
    H_external = +0.5 BTC
    R_residual = +1.0 BTC

    The protective hedge costs another $60 relative to fresh fair:

    1.5 * ($99,460 - $99,500) = -$60

    The 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) = +$300

    That 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.

    Here is the whole replay separated into buckets:

    ComponentToy CalculationMeaning
    Client spread edge+$50 + $100 + $75 = +$225Edge on ordinary client fills before the toxic stale-fill treatment.
    Residual inventory markout-$20 - $480 - $500 + $300 = -$700PnL from carrying unhedged residual delta through fair-value moves.
    External hedge cost-$140 - $60 = -$200Cost of reducing risk through external execution.
    Toxic stale-fill markout-$1,900Loss from buying at a stale bid against faster or better-informed flow.
    Net lesson+$225 - $700 - $200 - $1,900 = -$2,575Positive 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].

    The first interactive block should let the reader step through each trade and watch the three book quantities change:

    I_client
    H_external
    R_residual = I_client + H_external

    Required behavior:

    ActionState Change
    Customer buys from dealerI_client -= quantity
    Customer sells to dealerI_client += quantity
    Dealer buys external hedgeH_external += quantity
    Dealer sells external hedgeH_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.

    The second interactive block should show the book as three lanes:

    LaneWhat It Shows
    Client laneCustomer buys and sells.
    Dealer laneInternal inventory and residual delta.
    Hedge laneExternal 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.

    The third interactive block should show how the preferred action changes as the environment changes.

    InputLowHigh
    Client flow balanceTwo-sided offsetting flowOne-sided flow
    Toxicity scoreBenign/random flowStale-quote or informed flow
    VolatilityCalmStressed
    Hedge costCheap/deep venueExpensive/thin venue
    Latency riskFresh referenceStale reference

    The output can be one of:

    internalize
    skew
    partial_hedge
    full_hedge
    widen
    pause

    For the first implementation, the risk proxy can stay simple:

    inventoryRiskProxy = abs(R_residual) * fairPrice * volatilityShock

    This 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.

    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.

    The claim IDs below point into claim-register.md, which points into the verified source ledger.

    Claim IDUsed Here For
    C016Market maker role as standing ready to buy and sell at quoted prices.
    C021Adverse selection as one source of bid-ask spread.
    C022Toxic flow as flow that adversely selects liquidity providers.
    C023Stale-quote sniping/racing in continuous serial limit order books.
    C024Inventory-sensitive market-making intuition and quote skew.
    C031CFD provider conflict risk where provider is counterparty and does not hedge.
    C034IG-specific hybrid model: internalized matching flow, residual risk, external hedging near limits.
    C035IG-specific market-risk controls and hedging trigger language.
    C052, C053Control-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.