Level 3 — ProductionMarket Microstructure

Market Microstructure

45 minutes60 marksprintable — key stays hidden on paper

Chapter: 6.3 Market Microstructure Difficulty: Level 3 — Production (from-scratch derivations, code-from-memory, explain-out-loud) Time limit: 45 minutes Total marks: 60

Instructions: Show all working. Derivations must start from first principles. Where code is asked, write it from memory (Python/pseudocode acceptable, syntax leniency applies). Use ...... notation for math.


Question 1 — Order Book Reconstruction & Depth (10 marks)

You receive the following resting limit orders for stock XYZ (price × size):

Bids (price, qty) Asks (price, qty)
(100.02, 300) (100.05, 200)
(100.01, 500) (100.06, 400)
(100.00, 800) (100.07, 700)

(a) State the best bid, best ask, mid-price, and quoted spread (in currency and in basis points). (4)

(b) Define cumulative market depth and compute the cumulative depth available on the ask side up to and including price 100.06. (3)

(c) A market buy order of 500 shares arrives. Walk through (explain-out-loud) exactly how the matching engine fills it, and compute the volume-weighted average execution price (VWAP) and the resulting new best ask. (3)


Question 2 — Price Impact from Market Depth (10 marks)

(a) From first principles, derive an expression for the execution cost (slippage) of a market buy order of size QQ that sweeps nn ask levels, where level ii has price pip_i and available quantity qiq_i (with i=1nqiQ\sum_{i=1}^{n} q_i \ge Q). Define slippage relative to the mid-price mm. (5)

(b) Assume a linear ask-side depth profile: price at cumulative depth xx is p(x)=m+λxp(x) = m + \lambda x, where λ\lambda is Kyle's-lambda-style impact coefficient. Derive the total cost and the average price impact per share for buying quantity QQ. (5)


Question 3 — Bid-Ask Spread Decomposition (12 marks)

(a) Name and explain the three canonical components of the bid-ask spread. For each, explain the economic mechanism in one or two sentences. (6)

(b) Derive the Roll (1984) implied spread estimator from the assumption that the effective half-spread cc bounces price around an efficient mid-price via i.i.d. trade-direction indicators qt{+1,1}q_t \in \{+1,-1\} with P(+1)=P(1)=12P(+1)=P(-1)=\tfrac12 and independent of the efficient price. Show that Cov(Δpt,Δpt1)=c2\text{Cov}(\Delta p_t, \Delta p_{t-1}) = -c^2 and hence give the spread estimator SS. (6)


Question 4 — Adverse Selection & Glosten–Milgrom (10 marks)

A dealer faces a fraction α\alpha of informed traders (who know the true value V{VH,VL}V \in \{V_H, V_L\}, each equally likely) and 1α1-\alpha uninformed traders (who buy or sell with probability 12\tfrac12 each, independent of VV).

(a) Explain out loud why adverse selection forces a positive spread even when the dealer has zero inventory cost and zero order-processing cost. (3)

(b) Derive the dealer's ask price as E[Vbuy]\mathbb{E}[V \mid \text{buy}] using Bayes' rule. Then compute the numeric ask if VH=101V_H = 101, VL=99V_L = 99, and α=0.4\alpha = 0.4. (7)


Question 5 — Iceberg Orders & Auction Clearing (10 marks)

(a) Explain what an iceberg order is and, in an explain-out-loud manner, describe two ways a fast trader might detect one from the order book / trade tape. (4)

(b) A single-price call auction collects the following orders. Buy orders are cumulative-demand at-or-above price; sell orders are cumulative-supply at-or-below price:

Price Cumulative Buy Qty Cumulative Sell Qty
50.0 900 200
50.1 700 450
50.2 500 500
50.3 300 750

Determine the auction clearing price (the price that maximizes executable volume) and the matched (executed) quantity. Justify the rule you used. (6)


Question 6 — Latency, Co-location & Tick Size (8 marks)

(a) Explain out loud how co-location reduces latency and why sub-millisecond advantages are economically valuable at the top of the book. (3)

(b) A minimum tick size of \0.01constrainsthespread.Ifthe"true"competitivespreadwouldbeconstrains the spread. If the "true" competitive spread would be$0.006$, explain what happens and describe the queue / time-priority effect this creates. (3)

(c) Give one reason exchanges use larger tick sizes for some securities despite raising trading costs. (2)


Answer keyMark scheme & solutions

Question 1 (10)

(a) (4)

  • Best bid = 100.02, best ask = 100.05. (1)
  • Mid-price =(100.02+100.05)/2=100.035= (100.02 + 100.05)/2 = \mathbf{100.035}. (1)
  • Quoted spread = 100.05 - 100.02 = \mathbf{\0.03}$. (1)
  • In bps: 0.03100.035×1043.0 bps\dfrac{0.03}{100.035}\times 10^4 \approx \mathbf{3.0\ \text{bps}}. (1)

(b) (3)

  • Cumulative depth = total resting quantity available from the best price up to a stated price. (1)
  • Ask side to 100.06 inclusive: 200+400=600 shares200 + 400 = \mathbf{600\ \text{shares}}. (2)

(c) (3)

  • Fill 200 @ 100.05 (exhausts level 1), remaining 300 @ 100.06. (1)
  • VWAP =200(100.05)+300(100.06)500=20010+30018500=50028500=100.056= \dfrac{200(100.05) + 300(100.06)}{500} = \dfrac{20010 + 30018}{500} = \dfrac{50028}{500} = \mathbf{100.056}. (1)
  • Level 100.06 had 400; 300 consumed, 100 remain. New best ask = 100.06 (100 shares). (1)

Question 2 (10)

(a) (5)

  • Order sweeps levels until filled. Let kk be the level where QQ is exhausted; for full levels 1..k11..k-1 take qiq_i, at level kk take residual r=Qi<kqir = Q - \sum_{i<k} q_i. (2)
  • Total cash paid C=i=1k1piqi+pkrC = \sum_{i=1}^{k-1} p_i q_i + p_k r. (1)
  • VWAP =C/Q= C/Q. (1)
  • Slippage (cost vs mid) =Q(VWAPm)=CmQ= Q\cdot(\text{VWAP} - m) = C - mQ; per-share impact =VWAPm= \text{VWAP} - m. (1)

(b) (5)

  • With continuous linear depth p(x)=m+λxp(x)=m+\lambda x, cost to buy QQ: C=0Q(m+λx)dx=mQ+12λQ2C=\int_0^Q (m+\lambda x)\,dx = mQ + \tfrac12\lambda Q^2. (3)
  • Slippage =CmQ=12λQ2= C - mQ = \tfrac12 \lambda Q^2. (1)
  • Average impact per share =12λQ2Q=12λQ= \dfrac{\tfrac12\lambda Q^2}{Q} = \tfrac12 \lambda Q (half the marginal impact λQ\lambda Q). (1)

Question 3 (12)

(a) (6, 2 each)

  1. Order-processing cost — fixed operational/clearing/exchange costs the dealer recovers per round-trip. (2)
  2. Inventory-holding cost — dealers demand compensation for price risk of holding unwanted positions and skew quotes to manage inventory. (2)
  3. Adverse-selection cost — the risk of trading against better-informed counterparties; the dealer widens the spread to offset expected losses to informed flow. (2)

(b) (6)

  • Model: observed price pt=mt+cqtp_t = m_t + c\,q_t, with efficient price mtm_t a random walk, qt=±1q_t=\pm1 i.i.d. equal prob, independent of mm. (1)
  • Δpt=Δmt+c(qtqt1)\Delta p_t = \Delta m_t + c(q_t - q_{t-1}). (1)
  • Assume Δmt\Delta m_t white noise, independent of qq's. Then Cov(Δpt,Δpt1)=c2Cov(qtqt1,qt1qt2).\text{Cov}(\Delta p_t,\Delta p_{t-1}) = c^2\,\text{Cov}(q_t-q_{t-1},\,q_{t-1}-q_{t-2}). Only overlapping term is c2Var(qt1)=c21-c^2\,\text{Var}(q_{t-1}) = -c^2\cdot 1. (2)
  • So Cov(Δpt,Δpt1)=c2c=Cov\text{Cov}(\Delta p_t,\Delta p_{t-1}) = -c^2 \Rightarrow c = \sqrt{-\text{Cov}}. Full spread S=2c=2Cov(Δpt,Δpt1)S = 2c = \mathbf{2\sqrt{-\text{Cov}(\Delta p_t,\Delta p_{t-1})}}. (2)

Question 4 (10)

(a) (3)

  • Some counterparties know VV; they buy only when V=VHV=V_H (asset undervalued) and sell only when V=VLV=V_L. (1)
  • A buy order is therefore informative: it raises the conditional expected value. (1)
  • Posting a single price = mid would systematically lose to informed traders, so the dealer must set ask > mid and bid < mid → positive spread, even with no processing/inventory cost. (1)

(b) (7)

  • Prior P(VH)=P(VL)=12P(V_H)=P(V_L)=\tfrac12. On a buy: informed buys iff VHV_H; uninformed buys w.p. 12\tfrac12. (1)
  • P(buyVH)=α1+(1α)12=1+α2P(\text{buy}\mid V_H) = \alpha\cdot1 + (1-\alpha)\tfrac12 = \tfrac{1+\alpha}{2}. (1)
  • P(buyVL)=α0+(1α)12=1α2P(\text{buy}\mid V_L) = \alpha\cdot0 + (1-\alpha)\tfrac12 = \tfrac{1-\alpha}{2}. (1)
  • Bayes: P(VHbuy)=121+α2121+α2+121α2=1+α2.P(V_H\mid \text{buy}) = \frac{\tfrac12\cdot\tfrac{1+\alpha}{2}}{\tfrac12\cdot\tfrac{1+\alpha}{2}+\tfrac12\cdot\tfrac{1-\alpha}{2}} = \frac{1+\alpha}{2}. (2)
  • Ask =E[Vbuy]=1+α2VH+1α2VL= \mathbb{E}[V\mid\text{buy}] = \tfrac{1+\alpha}{2}V_H + \tfrac{1-\alpha}{2}V_L. (1)
  • Numeric: α=0.4\alpha=0.4: 1.42(101)+0.62(99)=0.7(101)+0.3(99)=70.7+29.7=100.4\tfrac{1.4}{2}(101)+\tfrac{0.6}{2}(99)=0.7(101)+0.3(99)=70.7+29.7=\mathbf{100.4}. (1)

(By symmetry bid = 99.6, spread = 0.8.)


Question 5 (10)

(a) (4)

  • Iceberg = large order that displays only a small "peak" quantity; when the peak fills, a new peak is automatically refreshed from the hidden reserve. (2)
  • Detection (any two): (i) Repeated refills at the same price — trades keep executing at a level whose displayed size seemingly never depletes. (ii) Post-fill instant reappearance of a same-size quote at that price. Also acceptable: pinging with small orders, timestamp regularity of refresh. (2)

(b) (6)

  • Executable volume at each price = min(cum buy,cum sell)\min(\text{cum buy}, \text{cum sell}):
    • 50.0: min(900,200)=200\min(900,200)=200
    • 50.1: min(700,450)=450\min(700,450)=450
    • 50.2: min(500,500)=500\min(500,500)=500
    • 50.3: min(300,750)=300\min(300,750)=300 (3)
  • Maximum executable volume =500=500 at price 50.2. (2)
  • Rule: single-price auction chooses the price that maximizes matched volume (tie-breaks by minimum imbalance / reference price). Clearing price =50.2=\mathbf{50.2}, matched qty =500=\mathbf{500}. (1)

Question 6 (8)

(a) (3) Co-location places the trader's servers physically inside/adjacent to the exchange's matching engine, minimizing signal propagation and network hops → lower round-trip latency. At the top of book, order priority is time-based, so being microseconds faster wins the queue, captures fleeting price edges, and avoids being picked off on stale quotes.

(b) (3) Since \0.006 < $0.01,thespreadcannotnarrowbelowonetickitisbindingat, the spread cannot narrow below one tick — it is **binding at $0.01$**. The excess (would-be) competition instead expresses itself through queue length: many traders post at the same best price and compete on time priority, so speed determines fills rather than price.

(c) (2) A larger tick reduces the incentive to "step ahead" by an economically trivial amount, thickening displayed depth/queues and reducing quote-flickering (lower message/adverse-selection load) — improving displayed liquidity stability.


[
  {"claim":"Q1c VWAP for 200@100.05 + 300@100.06 over 500 = 100.056","code":"vwap=(200*100.05+300*100.06)/500; result = (vwap==100.056)"},
  {"claim":"Q1a spread in bps approx 3.0","code":"bps=(0.03/100.035)*10000; result = abs(bps-3.0)<0.05"},
  {"claim":"Q2b slippage for linear depth is (1/2)*lambda*Q^2","code":"from sympy import symbols,integrate; m,lam,x,Q=symbols('m lam x Q',positive=True); C=integrate(m+lam*x,(x,0,Q)); slip=C-m*Q; result = (slip.simplify()==(lam*Q**2/2))"},
  {"claim":"Q4b ask price with alpha=0.4,VH=101,VL=99 equals 100.4","code":"a=0.4; VH=101; VL=99; ask=(1+a)/2*VH+(1-a)/2*VL; result = (abs(ask-100.4)<1e-9)"},
  {"claim":"Q5b max matched volume is 500 at price 50.2","code":"buy=[900,700,500,300]; sell=[200,450,500,750]; vols=[min(b,s) for b,s in zip(buy,sell)]; result = (max(vols)==500 and vols.index(500)==2)"}
]