You must report the latency of an order path to a risk committee. Explain what the median, the 99th percentile and the maximum each tell you, and why a desk that optimises the median can lose money while the median improves.
You must report the latency of an order path to a risk committee. Explain what the median, the 99th percentile and the maximum each tell you, and why a desk that optimises the median can lose money while the median improves.
Approach: Connect each statistic to the population of orders it describes, then consider which orders are the ones that carry adverse selection.
The median describes a typical quiet moment, the 99th percentile describes what happens during bursts, and the maximum is the one order that was late when the market moved, so a desk optimises the tail. Latency in a trading system is not independent of market state: message rates spike exactly when prices move, queues fill exactly then, and so the slow orders and the important orders are the same orders. That correlation is why a median improvement can coexist with worse profit and loss. If a change adds batching that halves typical latency and doubles the 99.9th percentile, every trade you lose is one where the quote was stale and the counterparty knew more than you did, which is adverse selection, and the cost of those fills exceeds the value of being marginally faster the rest of the time. Report all three, report them conditioned on message rate rather than pooled across the day, and report the count of messages above a stated threshold since that number maps directly onto orders at risk. Averages should not appear at all, because a distribution with a heavy tail has a mean that describes none of its samples.
Follow-up: You have 10 million samples and want the 99.99th percentile per minute without storing every sample. What structure do you use and what error does it guarantee?
Key concepts: percentile, tail latency, adverse selection, median.