Unit 14, lesson 109

Market making and inventory control

How a market maker with exponential utility prices inventory risk through a certainty equivalent, derives reservation bid and ask prices, and sets approximate quotes from an exponential fill intensity.

  • Video 109
  • Order books, execution and market making

A dealer already holds three units of an asset and posts a price at which it will buy one more and a price at which it will sell one. Should the two quotes sit symmetrically around the current midpoint? A purchase would add to an exposure the dealer already carries and a sale would reduce it, so the two trades are not worth the same to the dealer. This lesson values inventory with a certainty equivalent, derives exact reservation bid and ask prices when inventory is otherwise frozen, and combines them with an exponential model for fills to obtain an approximate pair of quotes whose center moves against the inventory.

Key terms

Market making

Definition A market maker posts a bid price bb at which it will buy and an ask price aa at which it will sell, and trades one standardized unit with each counterparty that arrives. With cash xx and inventory qq, a fill at the bid changes them to x−bx - b and q+1q + 1, and a fill at the ask changes them to x+ax + a and q−1q - 1. Marked at the midpoint ss, its wealth is x+qsx + q s, and the quote distances are δb=s−b\delta^b = s - b and δa=a−s\delta^a = a - s. Inventory risk is the exposure of marked wealth to midpoint moves while q≠0q \ne 0. In this lesson the midpoint follows dSt=σ dWtdS_t = \sigma\,dW_t, where WW is a Brownian motion under the dealer’s physical measure P\mathbb{P}, so it is an arithmetic Brownian motion with zero drift and constant volatility σ\sigma in currency per unit per square root of time, and the interest rate is zero. If the inventory is held fixed until the horizon TT, with H=T−tH = T - t remaining, marked wealth changes by q(ST−s)q(S_T - s), which has mean zero and variance

Var⁡(q(ST−s))=q2σ2H.\operatorname{Var}\bigl(q(S_T - s)\bigr) = q^2 \sigma^2 H .

Tick sizes, fees, queue priority and adverse selection are left out of the model.

In plain words The market maker earns the gap between its two quotes when purchases and sales alternate, but between them it holds inventory whose value moves with the price. If the midpoint does not move, a purchase at the bid followed by a sale at the ask earns a−ba - b and leaves the inventory where it was. The variance of a held position grows with the square of its size.

Example Take the constructed values s=50s = 50, σ=0.5\sigma = 0.5 currency per unit per square root minute and H=2H = 2 minutes, so σ2H=0.5\sigma^2 H = 0.5. A dealer holding q=3q = 3 units with inventory frozen has a marked wealth variance of 9⋅0.5=4.59 \cdot 0.5 = 4.5 squared currency units, a standard deviation of about 2.12132.1213. At q=6q = 6 the variance is 1818, four times as large, and at q=−3q = -3 it is again 4.54.5.

Certainty equivalent

Definition The dealer has exponential utility U(w)=−e−γwU(w) = -e^{-\gamma w} of terminal wealth, with constant absolute risk aversion γ>0\gamma > 0 in inverse currency units. The certainty equivalent of a random terminal wealth Π\Pi with EP[e−γΠ]<∞\mathbb{E}^{\mathbb{P}}[e^{-\gamma \Pi}] < \infty is the sure amount CE⁡\operatorname{CE} with U(CE⁡)=EP[U(Π)]U(\operatorname{CE}) = \mathbb{E}^{\mathbb{P}}[U(\Pi)], that is

CE⁡=−1γln⁡EP[e−γΠ].\operatorname{CE} = -\frac{1}{\gamma} \ln \mathbb{E}^{\mathbb{P}}\bigl[e^{-\gamma \Pi}\bigr].

In the frozen inventory model of the previous card, STS_T is normal with mean ss and variance σ2H\sigma^2 H, and the normal moment generating function gives

EP[−e−γ(x+qST)]=−e−γ(x+qs) eγ2q2σ2H/2,\begin{aligned} &\mathbb{E}^{\mathbb{P}}\bigl[-e^{-\gamma(x + q S_T)}\bigr] \\[0.4em] &\quad = -e^{-\gamma(x + q s)}\, e^{\gamma^2 q^2 \sigma^2 H/2}, \end{aligned}

so for every real qq, exactly,

CE⁡(x,q)=x+qs−12γσ2H q2.\begin{aligned} \operatorname{CE}(x, q) &= x + q s \\[0.4em] &\quad - \tfrac12 \gamma \sigma^2 H\, q^2 . \end{aligned}

The inventory penalty is the last term 12γσ2H q2\tfrac12 \gamma \sigma^2 H\, q^2, the amount by which the certainty equivalent falls short of the marked wealth. For any normal Π\Pi the same computation gives CE⁡=EP[Π]−12γVar⁡(Π)\operatorname{CE} = \mathbb{E}^{\mathbb{P}}[\Pi] - \tfrac12 \gamma \operatorname{Var}(\Pi), and the zero drift of the midpoint is what makes the mean equal to x+qsx + qs.

In plain words The certainty equivalent is the sure amount of cash the dealer would accept in place of its risky position. With normal wealth and exponential utility it is the mean minus a charge proportional to the variance, so the inventory penalty is the dealer’s price for carrying its position to the horizon. The penalty is quadratic, so doubling the position quadruples it, and long and short positions of the same size pay the same.

Example With the constructed risk aversion γ=0.1\gamma = 0.1 per currency unit, x=0x = 0 and q=3q = 3, the penalty is 12⋅0.1⋅0.5⋅9=0.225\tfrac12 \cdot 0.1 \cdot 0.5 \cdot 9 = 0.225 and CE⁡(0,3)=150−0.225=149.775\operatorname{CE}(0, 3) = 150 - 0.225 = 149.775. This is the mean 150150 minus 12⋅0.1\tfrac12 \cdot 0.1 times the variance 4.54.5 of the previous card. At q=6q = 6 the penalty is 0.90.9.

Reservation price

Definition In the frozen inventory model, the reservation bid rbr_b is the price at which buying one unit leaves the certainty equivalent unchanged, CE⁡(x−rb,q+1)=CE⁡(x,q)\operatorname{CE}(x - r_b, q + 1) = \operatorname{CE}(x, q), and the reservation ask rar_a solves CE⁡(x+ra,q−1)=CE⁡(x,q)\operatorname{CE}(x + r_a, q - 1) = \operatorname{CE}(x, q). Since (q±1)2−q2=±2q+1(q \pm 1)^2 - q^2 = \pm 2q + 1,

rb=s−γσ2H(q+12),ra=s−γσ2H(q−12).\begin{gathered} r_b = s - \gamma \sigma^2 H \bigl(q + \tfrac12\bigr), \\[0.4em] r_a = s - \gamma \sigma^2 H \bigl(q - \tfrac12\bigr). \end{gathered}

The reservation price is their midpoint

r=s−qγσ2H,r = s - q \gamma \sigma^2 H,

and the gap ra−rb=γσ2Hr_a - r_b = \gamma \sigma^2 H does not depend on qq. Neither value depends on the cash xx, a property of exponential utility. Because the certainty equivalent is linear in cash, buying at any b<rbb < r_b raises it by rb−br_b - b and selling at any a>raa > r_a raises it by a−raa - r_a. Positive inventory places both values below ss and negative inventory places both above. They are exact indifference values for a single trade after which the inventory stays frozen. A dealer who keeps quoting has dynamic indifference values from the full control problem, which differ from these in general.

In plain words The reservation price is the midpoint as seen by a dealer who already carries risk. A long dealer values one more unit below the market, so it is less eager to buy and more eager to sell, and both effects push its inventory back toward zero.

Example With the constructed inputs γσ2H=0.1⋅0.5=0.05\gamma \sigma^2 H = 0.1 \cdot 0.5 = 0.05. For q=3q = 3 the center shift is 3⋅0.05=0.153 \cdot 0.05 = 0.15, so r=49.85r = 49.85, rb=49.825r_b = 49.825 and ra=49.875r_a = 49.875. The reservation ask lies below the midpoint 5050. Selling one unit at 49.9049.90 raises this dealer’s certainty equivalent by 49.90−49.875=0.02549.90 - 49.875 = 0.025, because it removes 0.225−0.1=0.1250.225 - 0.1 = 0.125 of inventory penalty and gives up only 0.100.10 against the midpoint. For q=−3q = -3 the reservation price is 50.1550.15.

Exponential fill intensity

Definition Given the quote distances δb\delta^b and δa\delta^a, sales to the dealer at its bid and purchases from it at its ask arrive as two counting processes with intensities

λ(δ)=Ae−kδ\lambda(\delta) = A e^{-k\delta}

evaluated at δb\delta^b and at δa\delta^a, where A>0A > 0 is measured in fills per unit of time and k>0k > 0 in inverse currency units. The model takes the two counts to be independent, and while the distances stay fixed they are Poisson processes, as in Limit order books and queueing models, so a fill occurs in a short interval of length dtdt with probability λ dt+o(dt)\lambda\,dt + o(dt), and the expected inventory changes at the rate λ(δb)−λ(δa)\lambda(\delta^b) - \lambda(\delta^a). The intensity equals AA at zero distance and is multiplied by e−ke^{-k} for each additional currency unit of distance. The law is a model of passive quotes. A negative distance, an ask below the midpoint or a bid above it, lies outside the range it is meant for, and a quote that reaches the other side of the book would trade at once instead of waiting for fills.

In plain words Quoting further from the midpoint earns more on each fill but fills less often. The exponential law fixes the exchange rate between the two, and kk measures how fast fills dry up as a quote moves away.

Example With the constructed values A=5A = 5 fills per minute and k=2k = 2 per currency unit, a distance of 0.50.5 gives 5e−1≈1.83945e^{-1} \approx 1.8394 fills per minute and a distance of 11 gives 5e−2≈0.67675e^{-2} \approx 0.6767. Each extra 0.10.1 of distance multiplies the intensity by e−0.2≈0.8187e^{-0.2} \approx 0.8187. A dealer who ignores risk and earns δ\delta per fill on one side maximizes δAe−kδ\delta A e^{-k\delta} at δ=1/k=0.5\delta = 1/k = 0.5, with expected earnings of about 0.91970.9197 per minute on that side.

Bid and ask quotes

Definition Suppose the dealer quotes continuously until TT, fills arrive at the exponential intensities, and the dealer maximizes EP[U(xT+qTST)]\mathbb{E}^{\mathbb{P}}\bigl[U(x_T + q_T S_T)\bigr]. With zero interest the cash is riskless, so the value function satisfies u(x,q)=e−γxu(0,q)u(x, q) = e^{-\gamma x} u(0, q), with ss and tt suppressed. Let the dynamic indifference ask radynr_a^{\text{dyn}} solve u(x+radyn,q−1)=u(x,q)u(x + r_a^{\text{dyn}}, q - 1) = u(x, q). A sale at a=radyn+ca = r_a^{\text{dyn}} + c then changes the value by

u(x+a,q−1)−u(x,q)=−u(x,q)(1−e−γc),\begin{aligned} &u(x + a, q - 1) - u(x, q) \\[0.4em] &\quad = -u(x, q)\bigl(1 - e^{-\gamma c}\bigr), \end{aligned}

where −u(x,q)>0-u(x, q) > 0, and the dynamic programming equation of Dynamic allocation and stochastic control multiplies this gain by the intensity Ae−kδaA e^{-k\delta^a}, with δa=c+radyn−s\delta^a = c + r_a^{\text{dyn}} - s. Apart from factors that do not depend on cc, the ask is chosen to maximize

f(c)=e−kc(1−e−γc).f(c) = e^{-kc}\bigl(1 - e^{-\gamma c}\bigr).

Its derivative

f′(c)=e−kc×(−k+(k+γ)e−γc)\begin{aligned} f'(c) &= e^{-kc} \\[0.4em] &\quad \times \bigl(-k + (k + \gamma) e^{-\gamma c}\bigr) \end{aligned}

is positive below and negative above

c∗=1γln⁡(1+γk),c^* = \frac{1}{\gamma} \ln\Bigl(1 + \frac{\gamma}{k}\Bigr),

so c∗c^* is the unique maximizer over all real cc, and the optimal ask is radyn+c∗r_a^{\text{dyn}} + c^*. In the same way, with the dynamic indifference bid defined by u(x−rbdyn,q+1)=u(x,q)u(x - r_b^{\text{dyn}}, q + 1) = u(x, q), the optimal bid is rbdyn−c∗r_b^{\text{dyn}} - c^*. This step is exact given the dynamic indifference values. To get a closed form, replace them by the frozen inventory values rbr_b and rar_a, which gives the approximate quotes

b=r−12Δ,a=r+12Δ,Δ=γσ2H+2c∗,\begin{gathered} b = r - \tfrac12 \Delta, \qquad a = r + \tfrac12 \Delta, \\[0.4em] \Delta = \gamma \sigma^2 H + 2c^*, \end{gathered}

centered at the reservation price. This replacement is an approximation and not a solution of the full HJB equation, because future fills change the value of the inventory that the frozen values hold fixed. When the formula gives a quote that is not allowed, for example one off the tick grid, one that crosses the book or one that would breach an inventory limit, the quote has to be found by maximizing over the allowed set.

In plain words The surplus c∗c^* balances the extra profit of a wider quote against the fills it loses, and it is the same on both sides. In the approximation, inventory moves the center of the quotes and leaves their width unchanged.

Example With the constructed inputs, c∗=10ln⁡1.05≈0.487902c^* = 10 \ln 1.05 \approx 0.487902 and Δ≈0.05+0.975803=1.025803\Delta \approx 0.05 + 0.975803 = 1.025803. For q=3q = 3 the quotes are b≈49.337098b \approx 49.337098 and a≈50.362902a \approx 50.362902, at distances 0.6629020.662902 and 0.3629020.362902 from the midpoint, with intensities of about 1.32791.3279 and 2.41972.4197 fills per minute. At these quotes the expected inventory falls at about 1.09171.0917 units per minute. For q=−3q = -3 both quotes move up by 0.30.3, to about 49.63709849.637098 and 50.66290250.662902, and the two intensities swap. As γ→0\gamma \to 0, the surplus c∗c^* tends to 1/k=0.51/k = 0.5, the center tends to ss and the width to 2/k=12/k = 1, the quotes of the dealer who ignores risk in the previous card. For q=11q = 11 the approximate ask is about 49.96290249.962902, below the midpoint and outside the range of the fill model.

Check yourself

  1. With the constructed inputs s=50s = 50, γ=0.1\gamma = 0.1, σ=0.5\sigma = 0.5, H=2H = 2, k=2k = 2 and A=5A = 5, find the reservation bid, ask and price, the approximate quotes and the two fill intensities for a dealer holding q=1q = 1 unit.
Show the answer

The shift is qγσ2H=0.05q \gamma \sigma^2 H = 0.05, so r=49.95r = 49.95, rb=50−0.05⋅1.5=49.925r_b = 50 - 0.05 \cdot 1.5 = 49.925 and ra=50−0.05⋅0.5=49.975r_a = 50 - 0.05 \cdot 0.5 = 49.975. Half the approximate width is 12⋅1.025803≈0.512902\tfrac12 \cdot 1.025803 \approx 0.512902, so

b≈49.437098,a≈50.462902.\begin{aligned} b &\approx 49.437098, \\[0.4em] a &\approx 50.462902 . \end{aligned}

The distances are 0.5629020.562902 and 0.4629020.462902, so the intensities are 5e−1.125803≈1.62205e^{-1.125803} \approx 1.6220 at the bid and 5e−0.925803≈1.98115e^{-0.925803} \approx 1.9811 at the ask, fills per minute. Expected inventory falls at about 0.35910.3591 units per minute, more slowly than for q=3q = 3, because the center shift is a third as large.

  1. A dealer holding q=3q = 3 units in the constructed example centers its quotes at 50.1550.15, above the midpoint, arguing that an owner of the asset should ask a higher price. What does the model say about this choice?
Show the answer

The sign is reversed. The reservation price is r=s−qγσ2H=49.85r = s - q\gamma\sigma^2 H = 49.85, below the midpoint for a long position, and 50.1550.15 is the center for q=−3q = -3. With the center at 50.1550.15 and the approximate width 1.0258031.025803, the ask sits 0.6629020.662902 above the midpoint and the bid 0.3629020.362902 below it, so the ask fills at about 1.32791.3279 and the bid at about 2.41972.4197 times per minute. The expected inventory then rises at about 1.09171.0917 units per minute and the inventory penalty grows. Under the model this long dealer gains from any sale above its reservation ask 49.87549.875, even below the midpoint, so it should make selling easier, not harder.

  1. Quotes must be multiples of 0.050.05. Using the approximate quotes for q=3q = 3, which allowed ask and bid maximize the local objectives of the two sides?
Show the answer

On the ask side the local objective is e−k(ra−s)f(a−ra)e^{-k(r_a - s)} f(a - r_a), a positive constant times ff. The function ff increases below c∗≈0.487902c^* \approx 0.487902 and decreases above it, so among allowed asks the best is one of the two grid prices around 50.36290250.362902, namely 50.3550.35 with c=50.35−49.875=0.475c = 50.35 - 49.875 = 0.475 and 50.4050.40 with c=0.525c = 0.525. Then

f(0.475)≈0.0179407,f(0.525)≈0.0178978,\begin{aligned} f(0.475) &\approx 0.0179407, \\[0.4em] f(0.525) &\approx 0.0178978, \end{aligned}

so the best allowed ask is 50.3550.35. On the bid side c=rb−bc = r_b - b, and the grid prices around 49.33709849.337098 give c=0.475c = 0.475 for 49.3549.35 and c=0.525c = 0.525 for 49.3049.30, so the best allowed bid is 49.3549.35. The intensities become about 2.48292.4829 at the ask and 1.36271.3627 at the bid. Here the nearest grid prices win, but ff is not symmetric around c∗c^*, so in general the two neighbors have to be compared rather than rounded.

How this lesson connects