---
title: "Market Quality and Regulation"
book: "Microstructure and Execution"
subject: quant
language: en
chapter: 24
exercises: 8
source: https://one-course.com/books/quant/10/en/chapter/24-market-quality-and-regulation
---

# Chapter 24 — Market Quality and Regulation

Twenty years of automation have narrowed spreads and multiplied messages, and regulators still disagree about whether markets are better for it. The evidence is abundant; what it measures, and what it cannot, is the subject of this chapter. It defines the measures, reads the main studies of algorithmic and [high-frequency trading](#def-mx-market-quality-and-regulation-hft), the flash crash and latency races, and then evaluates a planted rule on a simulated panel of stock-days, where the rule’s true effect is known, to show what a [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) estimate recovers and what a before-and-after comparison gets wrong.

## 24.1 Measuring liquidity and market quality

**Definition 24.1 (Market quality).**

*Market quality* is the set of properties by which a market serves those who trade in it: the cost of trading (quoted, effective and realised spreads, price impact), the quantity available (depth, resilience), and the informativeness of prices (how close they stay to a random walk, how fast they incorporate information).

The measures are those of earlier chapters and books: the [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) (chapter 5), the effective and realised spreads and their difference, the price impact (One Quant Book 1, chapter 10), depth and resilience (chapter 3), Amihud’s illiquidity ratio (One Quant Book 7, chapter 7), and the variance ratio, the variance of returns over a long interval against the sum of the variances over the short intervals within it (one for a random walk, below one when prices bounce between bid and ask). `firm_mktquality.day_measures` computes them for a stock-day from a top-of-book path, the trades and the number of order messages.

**Definition 24.2 (Order-to-trade ratio).**

The *order-to-trade ratio* of a participant or a stock is the number of order messages (new orders, modifications, cancellations) per trade over a period.

## 24.2 Algorithmic and high-frequency trading in the evidence

**Definition 24.3 (Algorithmic trading, high-frequency trading).**

*Algorithmic trading* is trading in which a computer algorithm determines the parameters of orders (whether to send them, their timing, price or quantity, how to manage them afterwards) with little or no human intervention. *High-frequency trading* is algorithmic trading that relies on infrastructure minimising latency (co-location, proximity hosting or high-speed direct access), decides without human intervention for individual orders, and sends many orders, quotes or cancellations within the day.

The definitions follow MiFID II’s article 4(1)(39) and (40), which exclude systems that only route orders or process them without deciding their parameters. The evidence is mostly favourable to liquidity in normal times. Hendershott, Jones and Menkveld (2011) used the New York Stock Exchange’s automation of quote dissemination in 2003, which increased [algorithmic trading](#def-mx-market-quality-and-regulation-hft), as an instrument: for large stocks, [algorithmic trading](#def-mx-market-quality-and-regulation-hft) narrowed spreads, reduced adverse selection and made quotes more informative. Brogaard, Hendershott and Riordan (2014) found that high-frequency traders facilitate price efficiency by trading in the direction of permanent price changes and against transitory pricing errors, mainly through their liquidity-demanding orders, while their liquidity-supplying orders are adversely selected. Menkveld (2013) characterised one large high-frequency trader: it lost on its inventory, earned the spread, took part in 8.1% of trades on the incumbent market and 64.4% on an entrant, and was passive in four trades out of five.

## 24.3 The flash-crash literature

**Definition 24.4 (Hot-potato trading).**

*Hot-potato trading* is intermediaries passing the same positions rapidly back and forth among themselves, which inflates volume without transferring risk to anyone who wants to hold it.

On 6 May 2010 (One Quant Book 1, chapter 31), a mutual fund complex began to sell 75 000 E-mini contracts, about USD 4.1 billion, with an algorithm set to trade 9% of the previous minute’s volume without regard to price or time: chapter 16’s [participation algorithm](https://one-course.com/books/quant/10/en/chapter/16-benchmark-algorithms#def-mx-benchmark-algorithms-vwap), with the feedback that chapter described. The CFTC and SEC staff report found that, lacking fundamental buyers, high-frequency traders began to buy and resell contracts to each other; between 2:45:13 and 2:45:27 they traded over 27 000 contracts, about 49% of volume, while buying only about 200 net: a hot-potato volume effect that the volume-following algorithm read as liquidity. Kirilenko, Kyle, Samadi and Tuzun (2017), with the audit trail of the E-mini, found that the most active non-designated intermediaries did not change their trading pattern when prices fell. Volume is not liquidity: a market-quality measure that counts trades would have scored the flash crash’s worst minutes as its most liquid.

## 24.4 Latency races and speed bumps in the evidence

Aquilina, Budish and O’Neill (2022) used exchange message data, which record failed attempts to trade or cancel as well as successful ones, to see latency-arbitrage races directly: for FTSE 100 stocks, about one race per minute per symbol, a modal race lasting 5 to 10 millionths of a second, and about a fifth of all trading volume. Chapter 10 showed that [frequent batch auctions](https://one-course.com/books/quant/10/en/chapter/10-auction-mechanics-and-theory#def-mx-auction-mechanics-and-theory-fba) remove the race by design; speed bumps and the economics of the race itself are One Quant Book 11’s subject. For this chapter the lesson is methodological: the races were invisible in the order-book data most studies use, and a measure can only see what its data record.

## 24.5 Rules on algorithms and order-to-trade ratios

The SEC’s 2010 concept release on equity market structure asked for comment on [high-frequency trading](#def-mx-market-quality-and-regulation-hft), order routing, market data linkages and undisplayed liquidity; MiFID II followed with its definitions and with a requirement on venues to track each member’s ratio of unexecuted orders to transactions.

**As of September 2026 — Order-to-trade ratios in the EU.**

Commission Delegated Regulation (EU) 2017/566 (RTS 9 under MiFID II) requires trading venues to calculate the ratio of unexecuted orders to transactions of each member and participant, for every financial instrument traded in a continuous order book, quote-driven or hybrid system; it applies from the date MiFID II applied. The text quoted is the regulation as adopted.

Whether such a rule improves the market is an empirical question, and the simulation answers it where the truth is known. Twenty stocks of different activity trade for sixteen ten-minute days in `firm.agentmkt`. From day 8 two things happen: every stock’s market becomes more volatile and its liquidity providers send a quarter fewer orders (a market-wide change, the confounder); and every other stock, ordered by activity, comes under an order-to-trade cap that makes its liquidity providers send 30% fewer orders and cancel less. Each treated stock-day after the event is also run without the cap, with the same order flow, so the rule’s effect is measured directly.

![The mean quoted spread of the ten treated and ten control stocks, day by day. Both rise at the event (the market-wide change); the treated rise more (the rule). Data: mx_mq.study.](https://one-course.com/images/onecourse/chapters/quant-10/mx-market-quality-and-regulation/fig-93aba160edd9.svg)

***Figure 24.1.** The mean [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) of the ten treated and ten control stocks, day by day. Both rise at the event (the market-wide change); the treated rise more (the rule). Data: `mx_mq.study`.*

The treated stocks’ [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) rose by 1.60 basis points (standard error 0.08) from before to after; the [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) estimate (chapter 6’s method, with stock and day effects and errors clustered by stock, `firm_mktquality.did`) is 0.89 (0.09); the truth is 0.87 (0.03). The before-and-after comparison attributes the market-wide change of 0.71 basis points to the rule ([Table 24.1](#tab-mx-market-quality-and-regulation-did)).

```python

def _dummies(x):
    _, inv = np.unique(np.asarray(x), return_inverse=True)
    return np.eye(inv.max() + 1)[inv]


def did(y, treated, post, unit, period) -> dict:
    y = np.asarray(y, float)
    tp = np.asarray(treated, float) * np.asarray(post, float)
    x = np.c_[tp, _dummies(unit), _dummies(period)[:, 1:]]
    b, v = cluster_ols(y, x, unit)
```

***Listing 24.1.** The difference-in-differences estimate with two-way fixed effects: the treated-after indicator, stock and day dummies, and standard errors clustered by stock. code/firm/mktquality/firm_mktquality.py*

| measure | before-after (s.e.) | [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) (s.e.) | truth (s.e.) |
| --- | --- | --- | --- |
| [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) (bp) | 1.60 (0.08) | 0.89 (0.09) | 0.87 (0.03) |
| effective spread (bp) | 2.74 (0.12) | 1.31 (0.14) | 1.36 (0.06) |
| realised spread (bp) | 1.81 (0.08) | 1.06 (0.10) | 1.15 (0.07) |
| price impact (bp) | 0.93 (0.09) | 0.25 (0.10) | 0.21 (0.07) |
| depth (shares) | $-138$ (8) | $-20$ (13) | $-31$ (2) |
| variance ratio | $-0.19$ (0.02) | $-0.13$ (0.06) | $-0.14$ (0.03) |
| [order-to-trade ratio](#def-mx-market-quality-and-regulation-otr) | $-2.64$ (0.05) | $-1.18$ (0.07) | $-1.19$ (0.02) |

***Table 24.1.** The rule’s effect on the treated stocks: the before-and-after change, the [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) estimate and the true effect from the same days run without the rule. Data: `mx_mq.study`.*

The rule did what it was meant to do (1.2 fewer messages per trade) and made the market worse on every other measure: wider spreads, less depth, more bid-ask bounce. The event study ([Figure 24.2](#fig-mx-market-quality-and-regulation-event)) checks the design: before the event the treated and control stocks’ spreads move together (the seven coefficients are within 0.07 basis points of zero), and after it the gap opens at once and stays.

![Event study of the quoted spread: the treated-minus-control difference each day relative to the day before the rule, with stock and day effects and 95% intervals clustered by stock. Data: mx_mq.study.](https://one-course.com/images/onecourse/chapters/quant-10/mx-market-quality-and-regulation/fig-c5091c43526d.svg)

***Figure 24.2.** Event study of the [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted): the treated-minus-control difference each day relative to the day before the rule, with stock and day effects and 95% intervals clustered by stock. Data: `mx_mq.study`.*

## 24.6 Tutorial: did the rule make the market better?

**Goal.** Build a stock-day panel of market-quality measures in the simulated market, plant a rule on half the stocks, and estimate it by [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) against the before-and-after comparison and the truth. **End state:** Figures [24.1](#fig-mx-market-quality-and-regulation-daily) and [24.2](#fig-mx-market-quality-and-regulation-event), [Table 24.1](#tab-mx-market-quality-and-regulation-did).

1. **Measures.** `firm_mktquality.day_measures(top, trades, messages)` .
2. **Panel.** `mx_mq.config(i, d, rule)` , `session_day` , `panel()` .
3. **Estimate.** `did` , `before_after` , `event_study` ; `study()` ; draw with `fig_mq.py` .

**What to change next.** Treat the ten least active stocks instead of every other one and watch the parallel-trends assumption fail (exercise 7); compute the measures on SEC MIDAS data for a real rule change.

## 24.7 Build: market quality

**Purpose.** Measuring markets and rules: the panel measures and estimators behind this chapter and chapter 25’s circuit breakers.

**Interface.** `day_measures(top, trades, messages, h, grid, px_per_ccy)`, `did(y, treated, post, unit, period)`, `before_after(y, treated, post, unit)`, `event_study(y, treated, period, unit, base)`.

**Rules.** Spreads in basis points of the mid; firm.tape’s trade and top-of-book fields; errors clustered by the unit of treatment.

**Acceptance tests.** `code/firm/mktquality/tests/`: the measures on a hand market; a planted effect recovered by [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) and missed by before-and-after; a flat pre-period in the event study.

**Stretch.** Resilience; synthetic controls; staggered adoption.

Sources and further reading

- CFTC and SEC staff, “Findings regarding the market events of May 6, 2010”, 2010.
- SEC, Concept release on equity market structure, Release No. 34-61358, 2010.
- T. Hendershott, C. M. Jones and A. J. Menkveld, “Does algorithmic trading improve liquidity?”, *Journal of Finance* 66(1), 2011.
- A. J. Menkveld, “High frequency trading and the new market makers”, *Journal of Financial Markets* 16(4), 2013.
- J. Brogaard, T. Hendershott and R. Riordan, “High-frequency trading and price discovery”, *Review of Financial Studies* 27(8), 2014.
- A. Kirilenko, A. S. Kyle, M. Samadi and T. Tuzun, “The flash crash: high-frequency trading in an electronic market”, *Journal of Finance* 72(3), 2017.
- M. Aquilina, E. Budish and P. O’Neill, “Quantifying the high-frequency trading ‘arms race”’, *Quarterly Journal of Economics* 137(1), 2022.
- Directive 2014/65/EU (MiFID II), article 4(1)(39)–(40); Commission Delegated Regulation (EU) 2017/566.

## 24.8 Exercises

**Exercise 24.1 ★.**

From the four group means of the [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) (treated 1.58 before and 3.18 after, control 1.56 and 2.27), compute the [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did).

**Solution of Exercise 24.1.**

$(3.18-1.58)-(2.27-1.56)=1.60-0.71=0.89$ basis points.

**Exercise 24.2 ★.**

A stock-day has 900 order messages and 250 trades. What is its [order-to-trade ratio](#def-mx-market-quality-and-regulation-otr), and what would the rule’s effect of $-1.18$ make it?

**Solution of Exercise 24.2.**

$900/250=3.6$ messages per trade; with the rule’s effect, about 2.4.

**Exercise 24.3 ★.**

Why is a variance ratio below one a sign of bid-ask bounce, and what did the rule do to it?

**Solution of Exercise 24.3.**

Trades alternate between bid and ask, so short-interval returns are negatively autocorrelated and their variances add up to more than the long interval’s. The rule lowered the ratio by 0.14 (0.13 estimated): wider spreads, more bounce.

**Exercise 24.4 ★★.**

Why do the standard errors cluster by stock and not by stock-day?

**Solution of Exercise 24.4.**

A stock’s days share its unobserved characteristics and its errors are correlated over time; the rule is assigned by stock, so the effective number of independent observations is the number of stocks, not of stock-days.

**Exercise 24.5 ★★.**

Why did high-frequency traders’ volume during the flash crash mislead a [participation algorithm](https://one-course.com/books/quant/10/en/chapter/16-benchmark-algorithms#def-mx-benchmark-algorithms-vwap)?

**Solution of Exercise 24.5.**

It targeted 9% of the previous minute’s volume, and the intermediaries’ [hot-potato trading](#def-mx-market-quality-and-regulation-hotpotato) inflated that volume without absorbing any of the selling: the algorithm sold faster into a market that was not buying.

**Exercise 24.6 ★★.**

Why can order-book data not show latency races, and what data can?

**Solution of Exercise 24.6.**

Order-book data show only the orders that changed the book: the losers of a race (failed trades and cancels) leave no trace. Exchange message data, with every message and its outcome, do.

**Exercise 24.7 ★★★.**

*Coding.* Treat the ten least active stocks instead of every other one. What does [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) estimate for the [quoted spread](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted), and why does it miss the truth?

**Solution of Exercise 24.7.**

1.11 basis points (standard error 0.06) against a truth of 0.94: the least active stocks suffer more from the market-wide change than the controls, so the control group understates what the treated stocks’ spreads would have done without the rule; parallel trends fail.

**Exercise 24.8 ★★★.**

*Find the flaw.* “Since the rule, spreads on the stocks it covers have risen by 1.6 basis points: the rule cost investors 1.6 basis points.”

**Solution of Exercise 24.8.**

The 1.6 basis points include the market-wide change that hit every stock (0.71 on the controls); the rule’s own effect, by [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did), is 0.89, close to the true 0.87.

## 24.9 Problem: Did the Rule Make the Market Better?

**Problem 24.1.**

Weekend problem — did the rule make the market better?

A regulator capped [order-to-trade ratios](#def-mx-market-quality-and-regulation-otr) on half the stocks of a market. You are asked to evaluate it.

**Part I — Measures.**

1. Define [market quality](#def-mx-market-quality-and-regulation-quality) and list its measures.
2. How are the effective and realised spreads and the price impact related?
3. Define the [order-to-trade ratio](#def-mx-market-quality-and-regulation-otr) , [algorithmic trading](#def-mx-market-quality-and-regulation-hft) and [high-frequency trading](#def-mx-market-quality-and-regulation-hft) .
4. What does the variance ratio measure?

**Part II — The evidence.**

5. What did Hendershott, Jones and Menkveld find, and how did they identify it?
6. What did Brogaard, Hendershott and Riordan find about [price discovery](https://one-course.com/books/quant/10/en/chapter/8-fragmentation-and-routing#def-mx-fragmentation-and-routing-discovery) ?
7. Describe the flash crash’s sell programme and the hot-potato volume.
8. What did Aquilina, Budish and O’Neill measure, and why could they?

**Part III — The simulated rule.**

9. Describe the panel, the confounder and the rule.
10. How is the truth measured?
11. Write the two-way fixed-effects regression.
12. *State the named result* : the [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) estimate of the rule’s effect on [quoted spreads](https://one-course.com/books/quant/10/en/chapter/5-decomposing-the-spread#def-mx-decomposing-the-spread-quoted) with its standard error, against the before-after estimate that ignores the control group.
13. What does the event study show before the event, and why does it matter?

**Part IV — Judgement.**

14. Did the rule make the market better? Use the table.
15. What happens if the treated stocks are the least active ones?
16. Which measure moved most in relative terms, and why?
17. What would you need to evaluate such a rule on real data?
18. Why is volume a poor measure of liquidity?
19. What does the dated box say about [order-to-trade ratios](#def-mx-market-quality-and-regulation-otr) in the EU?
20. In one sentence: what does a control group buy an evaluation?

**Solution of Problem 24.1.**

**1.** Costs, depth and price informativeness: quoted, effective and realised spreads, impact, depth, resilience, Amihud, the variance ratio. **2.** Effective = realised + price impact. **3.** See the definitions. **4.** How far prices are from a random walk over short intervals: below one with bid-ask bounce. **5.** [Algorithmic trading](#def-mx-market-quality-and-regulation-hft) narrowed spreads, reduced adverse selection and made quotes more informative for large stocks; identified by the NYSE’s 2003 automation of quote dissemination as an instrument. **6.** High-frequency traders trade in the direction of permanent price changes and against transitory errors, mostly with their aggressive orders. **7.** 75 000 E-mini contracts at 9% of volume without regard to price or time; high-frequency traders then traded over 27 000 contracts among themselves in 14 seconds, about 49% of volume, buying about 200 net. **8.** Latency-arbitrage races (about one a minute per FTSE 100 symbol, modal duration 5–10 microseconds, about 20% of volume), seen in message data that record failed attempts. **9.** 20 stocks, 16 ten-minute days; from day 8 a market-wide rise in volatility and fall in quoting for all, and an order-to-trade cap on every other stock. **10.** By running each treated stock-day after the event also without the rule, with the same order flow. **11.** $y_{id}=\alpha_i+\gamma_d+\beta\,\text{treated}_i\times\text{post}_d+\varepsilon_{id}$, errors clustered by stock. **12.** *Named result*: [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) 0.89 basis points (standard error 0.09) against a before-and-after 1.60 (0.08) that ignores the control group; the truth is 0.87 (0.03). **13.** Coefficients within 0.07 of zero before the event: the groups moved together, supporting parallel trends. **14.** It cut messages but widened spreads (0.9 quoted, 1.3 effective), reduced depth and increased bounce: worse by every trading-cost measure. **15.** [Difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) overstates: 1.11 against 0.94. **16.** The [order-to-trade ratio](#def-mx-market-quality-and-regulation-otr) (down about a quarter), the rule’s target. **17.** A comparable control group (or staggered adoption), pre-period data to check trends, and measures from message-level data. **18.** [Hot-potato trading](#def-mx-market-quality-and-regulation-hotpotato) inflates it without anyone taking risk, as in the flash crash. **19.** Venues must calculate each member’s ratio of unexecuted orders to transactions for every instrument. **20.** A measure of what would have happened anyway.

## 24.10 Interview questions

**Interview question 24.1 ★ trader.**

Spreads in your stock doubled after a rule change. How do you know the rule did it?

**Solution of Interview question 24.1.**

Compare with stocks the change did not cover over the same days, check that they moved together before, and control for volatility and volume; a [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) with an event study.

*What the interviewer is looking for: A control group; pre-trends.*

**Interview question 24.2 ★★ researcher.**

Explain [difference-in-differences](https://one-course.com/books/quant/10/en/chapter/6-tick-size-queues-and-priority#def-mx-tick-size-queues-and-priority-did) and its key assumption. How would you test it?

**Solution of Interview question 24.2.**

The treated group’s change minus the control group’s; it assumes both would have changed alike without the treatment (parallel trends), tested by the event study’s pre-period coefficients and by placebo dates.

*What the interviewer is looking for: Parallel trends; placebo tests.*

**Interview question 24.3 ★★ researcher.**

Does [high-frequency trading](#def-mx-market-quality-and-regulation-hft) improve [market quality](#def-mx-market-quality-and-regulation-quality)? What does the evidence say, and what does it not?

**Solution of Interview question 24.3.**

In normal times, mostly yes: narrower spreads, more informative prices (Hendershott, Jones and Menkveld; Brogaard, Hendershott and Riordan). It does not settle behaviour in stress (the flash crash), the cost of latency races (Aquilina, Budish and O’Neill), or who bears adverse selection.

*What the interviewer is looking for: Balance; stress and races.*

**Interview question 24.4 ★★ risk.**

What lessons does the flash crash hold for an [execution algorithm](https://one-course.com/books/quant/10/en/chapter/16-benchmark-algorithms#def-mx-benchmark-algorithms-algo)?

**Solution of Interview question 24.4.**

A participation or volume-following algorithm needs a price limit and a check that volume is real liquidity; monitor the book’s depth, not just volume, and slow down when prices move fast.

*What the interviewer is looking for: Price awareness; volume versus depth.*

**Interview question 24.5 ★★ developer.**

Your firm must stay under a venue’s [order-to-trade ratio](#def-mx-market-quality-and-regulation-otr). How would you monitor and enforce it in your trading systems?

**Solution of Interview question 24.5.**

Count messages and trades per instrument and account in the order gateway, compute the venue’s ratio on its own formula intraday, throttle quoting strategies as they approach the limit, and alert before breaches.

*What the interviewer is looking for: Real-time counting; throttles; the venue’s definition.*

**Interview question 24.6 ★★★ researcher.**

How would you measure latency races on a venue, and what would you need from it?

**Solution of Interview question 24.6.**

From message data with every order, cancel and failed attempt and exchange timestamps: group messages that hit the same [price level](https://one-course.com/books/quant/10/en/chapter/1-the-limit-order-book#def-mx-the-limit-order-book-tick) within microseconds, with at least one winner and one loser; the venue must provide failed messages, not just the book.

*What the interviewer is looking for: Message-level data; defining a race.*
