# Market Making P&L Attribution and Markouts

Splitting a maker's P&L into spread capture, adverse selection, inventory and fees, with markout curves, fill ratios and the numbers a desk watches.

A market maker's day ends with one number, the profit and loss, and that number alone says almost nothing about what to change. A desk that earned 23 USD may have earned 27 from the spread and lost 17 to informed customers, or the other way round. This lesson splits the P&L exactly into spread capture, adverse selection, inventory and fees, using the markout from "Adverse selection and informed trading" and the inventory view from "Inventory risk and quote skewing", and then lists the few monitoring numbers a desk reads to decide whether to widen, skew or pull its quotes.

## Marking to market

Let the maker's **cash** be the money it has received minus the money it has paid, its **inventory** $I$ the net number of shares it holds, and $m_T$ the mid price at the end of the session. Valuing the inventory at the mid, the **total P&L** is

$$
\text{P\&L} = \text{cash} + I\,m_T + \text{fees}.
$$

A fill of $q$ shares at price $p$ changes cash by $-\varepsilon\,p\,q$ and inventory by $\varepsilon\,q$, where $\varepsilon = +1$ if the maker bought and $\varepsilon = -1$ if it sold. Fees are positive for a rebate and negative for a charge. This is the number the exchange statement agrees with, but it mixes three different stories: what the maker charged, what the price did next, and what it still holds.

## Spread capture

Let $m_t$ be the mid price just before the fill at time $t$. The **spread capture** of the fill is how far from the mid the maker traded, signed so that a good price is positive:

$$
S = \varepsilon\,(m_t - p)\,q.
$$

A maker who buys below the mid, or sells above it, captures the spread. Note the word *before*: if the mid is read after the fill, the price move that the fill itself caused leaks into the spread term and flatters it.

## Adverse selection

Choose a **markout horizon** $h$, for example 10 seconds. The **adverse selection** of the fill is the mid price move over the next $h$ seconds, signed from the maker's side, as in the lesson on markouts:

$$
A = \varepsilon\,(m_{t+h} - m_t)\,q.
$$

It is negative when the maker bought just before the price fell or sold just before it rose: the customer knew something. Averaged over many fills and divided by shares, $A$ is the markout. After noise customers it averages zero; after informed customers it is negative and eats the spread capture.

## Inventory

The fill is not over after $h$ seconds: the maker still holds the shares until it trades them away, and the mid keeps moving until the end $T$ of the session. For one fill, split the total change in value at $t$ and $t+h$:

$$
-\varepsilon\,p\,q + \varepsilon\,q\,m_T = \underbrace{\varepsilon\,(m_t - p)\,q}_{S} + \underbrace{\varepsilon\,(m_{t+h} - m_t)\,q}_{A} + \underbrace{\varepsilon\,(m_T - m_{t+h})\,q}_{\text{inventory}}.
$$

The identity holds because the mid terms telescope: $m_t$ and $m_{t+h}$ cancel. Summing over all fills and adding the fees gives

$$
\text{P\&L} = \sum S + \sum A + \sum \varepsilon\,(m_T - m_{t+h})\,q + \text{fees}.
$$

The third sum is the **inventory** term: the profit or loss from holding the position beyond the markout window. The four parts sum to the total exactly, with nothing left over, which is why the desk can trust the split. If the price is a random walk, the inventory term has mean zero but a wide spread, and it is the part that skewing the quotes aims to control.

### Worked example: Splitting the P&L of one fill

1. The maker buys 100 at 99.99 while the mid is 100.00. Spread capture:
   $$S = (100.00 - 99.99)\times 100$$ → **1**
2. Ten seconds later the mid is 99.95 and stays there. Adverse selection:
   $$A = (99.95 - 100.00)\times 100$$ → **-5**
3. The mid does not move after the markout window, so the inventory term is zero:
   $$(99.95 - 99.95)\times 100$$ → **0**
4. With no fees the total is the sum of the parts:
   $$1.00 - 5.00 + 0 + 0$$ → **-4**
5. Direct check with cash plus inventory times the mid:
   $$-9999 + 100\times 99.95$$ → **-4**
6. With a maker rebate of 0.002 per share the fees are 0.20 and the total improves to:
   $$-4.00 + 0.002\times 100$$ → **-3.8**

## Fees and rebates

Exchanges often pay a small **rebate** to the side that posts a resting order and charge a **taker fee** to the side that removes liquidity. A maker earns the rebate on every fill, so it adds to the total independent of the price path, and it can make a thin-spread strategy viable. When the maker hedges its inventory with a market order, it pays the taker fee and also crosses the spread: the hedge is a fill with a **negative** spread-capture term, because the maker trades away from the mid. The decomposition handles hedges with no extra rules, as one more fill with its own $S$, $A$ and fee.

## What a desk watches

The split is only useful if it is read every day. Try the figure below: it runs a five-minute session of a maker against the crowd flow, and lets you change the informed share, the quote distance and the markout horizon. Raise the informed share and watch the adverse selection bar and the markout curve fall; move the quotes further from the mid and watch the fills, and with them every bar, shrink. In the default state, 67 fills give 27.16 USD of spread capture, −16.98 of adverse selection, 2.90 of inventory and 10.43 of rebates, for a total of 23.51 USD.

*[Interactive figure: pnl attribution](https://quantsandbox.dev/guide/microstructure/market-making-pnl)*

Five numbers do most of the monitoring.

- **Markout curve.** The average markout against the horizon. A curve that sinks and stays negative means the flow is informed: widen the quotes or stop quoting to the toxic customers. A curve that returns to zero means the move was temporary pressure on the book, not information.
- **Fill ratio.** Fills divided by orders placed, the practical measure of queue position from "Queue position and fill probability". A very high ratio usually means the quotes are too tight; a very low one means the maker is far back in the queue or too wide.
- **Quote-to-trade ratio.** Quote updates per fill. It measures the cost of staying at the touch and is often capped by the exchange.
- **Inventory turnover.** How quickly the position cycles back to flat. Slow turnover with large swings in the inventory term is a signal to skew quotes harder, as in "Optimal quoting: the Avellaneda–Stoikov model".
- **Limits.** Maximum inventory and loss per day. A breach means pulling quotes, for example before a scheduled news release when adverse selection is highest.

## The attribution in the desk game

The Market Making Desk game at /market-making/desk reports exactly this split at the end of each round, with the markout horizon you choose. The lab linked below lets you change the quotes and the flow and see the four parts move.

## Summary

- Total P&L is cash plus inventory times the mid, plus fees, and it splits exactly into spread capture, adverse selection, inventory and fees.
- Spread capture $\varepsilon(m_t - p)q$ uses the mid before the fill; adverse selection $\varepsilon(m_{t+h} - m_t)q$ is the markout over the horizon; the inventory term is the rest of the holding period.
- The four parts sum to the total because the mid terms telescope.
- Hedges are fills with negative spread capture and a taker fee; rebates add a path-independent income.
- A markout curve, fill ratio, quote-to-trade ratio, inventory turnover and limits tell the desk whether to widen, skew or pull quotes.

[Open the market making lab](https://quantsandbox.dev/market-making)

## Interactive labs

- [Market Making Simulator: Spread and Inventory](https://quantsandbox.dev/market-making)

## Practice questions

### 1. The maker sells 200 shares at 50.03 when the mid price is 50.00. What is the spread capture in USD?

**Answer:** 6

A sale has $\varepsilon = -1$, so $S = -(50.00 - 50.03)\times 200 = 0.03 \times 200 = 6$ USD. The maker sold 3 cents above the mid on every share.

### 2. A maker's spread capture is +500 USD a day, but its adverse selection is −650 USD. What is the first thing to try?

- a) Widen the quotes, or quote less to the toxic flow
- b) Quote tighter to get more fills
- c) Hedge every fill immediately
- d) Stop charging fees

**Answer:** a) Widen the quotes, or quote less to the toxic flow

Adverse selection larger than spread capture means each fill loses money on average within the markout window. Tighter quotes would add fills at an even smaller spread; hedging pays the spread again; fees do not enter the comparison. The fix is a wider spread or less quoting to the customers who cause it.

---

Source: https://quantsandbox.dev/guide/microstructure/market-making-pnl

Previous lesson: [Avellaneda–Stoikov: Reservation Price, Optimal Spread](https://quantsandbox.dev/guide/microstructure/avellaneda-stoikov)
