DMA routing quality must be measured

0
14

XCore HFT / Trading Lab

DMA routing quality must be measured

Quantitative execution, market-microstructure, and risk-control research from XTRSK.

What this problem really is

Direct market access (DMA) is often equated with “best execution” because the order leaves the trader’s gateway and appears on an exchange within a few micro‑seconds. The intuition is simple: the shorter the network latency, the better the price that will be obtained. In practice the relationship between latency and execution quality is far more subtle. A venue may have a millisecond‑level advantage in round‑trip time, yet its order book could be dominated by a deep queue of passive orders that absorb liquidity for several seconds. Conversely, a slightly slower route may encounter a thin book with standing depth that can be crossed instantly. The core thesis, therefore, is that a direct connection is not automatically the optimal execution route; venue‑specific rules, queue dynamics and the distribution of displayed liquidity together determine the realised price.

When a prop‑trading desk evaluates a routing decision it must compare three reference points. The decision price is the theoretical price that would have been obtained if the order had been routed to the venue offering the best instantaneous price at the moment of the routing decision. The arrival price is the first executable price observed after the order reaches the venue, and the final fill price is the price at which the order is completely executed or cancelled. The gap between decision and arrival prices captures latency and queue entry delay, while the gap between arrival and final fill captures market impact and adverse‑selection risk.

A naïve latency‑only metric will therefore miss the dominant component of execution cost: the cost of standing in a queue that does not move quickly enough. The challenge for a DMA system is to recognise, in real time, when a “fast” venue is actually a “slow” venue from the perspective of order fulfilment, and to re‑route or cancel before the cost becomes material.

DMA routing quality must be measured: mechanism
Figure 1. How the components of this idea connect

How the mechanism works, step by step

The first step is the generation of a benchmark decision price. The order management system (OMS) receives market data from all subscribed venues, normalises timestamps, and computes the best bid/ask across the universe. That price, adjusted for any applicable transaction‑cost model, becomes the decision price against which execution will be measured.

Next the OMS selects a primary venue based on a routing matrix that incorporates latency, fee schedule, and historical fill‑rate statistics. The order packet is transmitted over a dedicated fibre or microwave link, and the network stack records the exact send timestamp. The venue acknowledges receipt with a sequence number; the acknowledgement timestamp is logged as the arrival time.

Once the order is in the venue’s order book, the exchange’s matching engine places it at the back of the price‑time queue for the chosen price level. The order now begins to accrue queue position value, which can be decomposed into two components: the expected spread capture if the order is filled before the price moves, and the adverse‑selection cost that accrues as the queue is “picked off” by faster, better‑informed participants. The system must monitor depth updates, trade prints and any changes to the venue’s matching rules (e.g., introduction of a maker‑taker rebate that alters the incentive to provide depth).

If the order is partially filled, the OMS records the fill price, size and timestamp, and recomputes the remaining quantity’s expected execution quality. The time‑to‑completion metric is updated continuously. Should the queue position deteriorate—signalled by a widening spread, a sudden increase in order‑book depth ahead of the order, or a change in the venue’s cancellation policy—the OMS may trigger a cancellation request. The cancellation outcome (accepted, rejected, or partially executed) is logged together with the final fill price, completing the execution trail for that order.

A worked example with real numbers

Consider a 10 000‑share limit buy order for XYZ at a decision price of £20.00. The routing matrix flags Venue A as the fastest link, with a measured one‑way latency of 45 µs, while Venue B is 70 µs slower but historically offers tighter depth. At 09:30:12.345 000 the OMS sends the order to Venue A. The acknowledgement from Venue A arrives at 09:30:12.345 080, establishing an arrival price of £20.01 because a small sell order at that price had just entered the book.

Venue A’s order book at the £20.01 level contains 2 000 shares already queued ahead of our order, followed by a total displayed depth of 12 000 shares. The matching engine places our 10 000‑share order at the back of the queue. Over the next 1.2 seconds the market moves up to £20.03, and a series of aggressive market sells consume 1 800 shares from the front of the queue, leaving 200 shares ahead of us. At 09:30:13.560 000 the first 2 000 shares of our order are filled at £20.03, establishing a partial fill price of £20.03.

Meanwhile, Venue B, despite the longer latency, shows a solitary sell order of 5 000 shares at £20.02 with no queue ahead. At 09:30:13.100 000 the OMS receives a market‑depth refresh indicating that the £20.02 level is still intact. The routing logic, configured to reassess after any partial fill, decides to cancel the remaining 8 000 shares on Venue A and re‑route them to Venue B. The cancellation request is accepted at 09:30:13.610 000; the new order reaches Venue B at 09:30:13.680 000, and the remaining 8 000 shares are filled instantly at £20.02.

Summarising the metrics: decision price £20.00, arrival price £20.01, final fill price £20.02 (weighted average of £20.03 for 2 000 shares and £20.02 for 8 000 shares). The total time to completion is 1.335 seconds, but the critical observation is that the shortest network route (Venue A) contributed a higher average price because of a long queue, whereas the slightly slower venue delivered a better overall execution.

The same idea on a live price series
Figure 2. Real intraday FX candles from the trading feed Data: live FX feed.

Where it breaks in live markets

In a live, high‑frequency environment the assumptions that underpin the routing matrix can deteriorate within milliseconds. Queue length is not a static attribute; a surge of algorithmic participants can add thousands of orders to the same price level in a fraction of a second, turning a previously thin queue into a deep one. Moreover, venue‑specific rules such as “price‑level protection” or “minimum order size” can be altered without prior notice, changing the effective liquidity available to a given order size.

Latency spikes caused by network congestion, hardware interrupts, or operating‑system jitter can also widen the gap between decision and arrival prices. When the arrival price is already worse than the decision price, the order may be “stale” before it even reaches the book, leading to immediate cancellation or sub‑optimal fills.

Finally, market impact is amplified when multiple desks simultaneously target the same venue with similar routing preferences. The resulting crowding can fill the queue faster than anticipated, and the adverse‑selection component of the queue value becomes dominant. In such scenarios the DMA system’s static routing logic fails, and the execution quality degrades despite the underlying network being technically optimal.

The operating path, stage by stage

The execution pipeline can be divided into three distinct stages. The first stage is market‑data ingestion, where the OMS consolidates order‑book snapshots, trade prints and quote updates from every subscribed venue. Timestamp normalisation is performed here to ensure that the decision price reflects a common reference clock.

The second stage is routing decision. The algorithm evaluates latency measurements, fee schedules, historical fill ratios, and current queue depth estimates to produce a ranked list of candidate venues. A weighting function, typically a convex combination of latency cost and expected spread capture, yields a primary venue and a set of fallback venues.

The third stage is post‑routing monitoring. Once the order is in the venue’s book, the system subscribes to incremental depth updates for the specific price level. It calculates the expected time to fill based on the observed rate of order consumption ahead of the order, adjusts for any changes in the venue’s matching rules, and decides whether to keep the order alive, amend its price, or cancel and re‑route.

Each stage generates a rich audit trail: market‑data timestamps, routing decision timestamps, send/receive timestamps, fill timestamps, and cancellation outcomes. The trail is essential for later performance analysis and regulatory reporting.

Execution and control path
Figure 3. Where the decision is made, checked and confirmed

Controls that act before the damage

A robust DMA implementation must embed preventative controls that intervene before an order incurs excessive cost. The first line of defence is a pre‑trade queue‑depth filter. Before an order is dispatched, the OMS queries the venue’s depth API for the target price level and rejects the routing if the depth ahead of the order exceeds a configurable threshold relative to the order size.

The second control is a dynamic latency guard. Real‑time latency probes are run continuously; if the measured one‑way latency for a venue deviates beyond a pre‑set band, the venue is temporarily removed from the routing matrix.

A third safeguard is a “price‑drift monitor”. If the best‑bid/ask moves by more than a tick or a defined basis‑point amount during the interval between decision and arrival, the order is automatically cancelled and re‑evaluated.

Finally, an adaptive cancellation policy caps the maximum time an order may remain in a queue. If the expected time‑to‑fill, derived from the observed consumption rate of the queue, exceeds the cap, the system issues a cancellation request. These controls together form a ladder of protection that reduces the probability of a slow venue causing a costly fill.

Control ladder
Figure 4. Warn, reduce, stop — decided before the pressure arrives

How to measure whether it is working

Measurement must be anchored to the three benchmark prices introduced earlier. The primary metric is the “execution slippage”, defined as the difference between the final fill price and the decision price, expressed in basis points. A secondary metric is “queue‑time cost”, the time between arrival and final fill multiplied by the instantaneous spread, which captures the opportunity cost of waiting in a queue.

Partial‑fill analysis is essential. For each order the system records the proportion of volume filled at each price tier and the associated timestamps. By aggregating across a trading day, one can compute the average time‑to‑completion for each venue and compare it against the theoretical time‑to‑completion derived from queue‑depth estimates.

Cancellation outcomes provide another diagnostic. A high rate of cancellations that are subsequently re‑routed to a different venue, coupled with a reduction in slippage, indicates that the monitoring logic is correctly identifying deteriorating queues. Conversely, a high rate of “cancel‑rejects” suggests that the venue’s cancellation policy is more restrictive than anticipated, and the routing matrix must be adjusted.

Statistical significance should be assessed using a rolling window of at least 10 000 orders to smooth out the noise inherent in high‑frequency data. Confidence intervals around the mean slippage and queue‑time cost allow the desk to determine whether observed improvements are genuine or merely stochastic fluctuations.

The portfolio view

From a portfolio perspective, execution quality aggregates across many instruments, order sizes and market conditions. The desk must therefore translate per‑order metrics into portfolio‑level risk and cost metrics. One useful construct is the “execution cost variance”, which captures the dispersion of slippage across the portfolio and feeds into the overall risk‑adjusted return calculation.

When the routing logic is altered—say, by giving a higher weight to queue‑depth rather than pure latency—the portfolio view reveals whether the change improves the Sharpe ratio after accounting for execution costs. If the average slippage falls but the variance rises because the system occasionally routes to a venue with an unexpected queue collapse, the net effect may be neutral or negative.

A holistic dashboard should display, for each venue, the cumulative slippage, average queue‑time cost, and the proportion of total volume routed. Overlaying these figures with market‑impact estimates derived from order‑size‑to‑average‑daily‑volume ratios enables the desk to see whether the routing policy is inadvertently increasing market impact in pursuit of lower latency.

In practice, the portfolio manager will set a target execution‑cost budget, expressed as a percentage of gross P&L, and the DMA team must ensure that the routing system stays within that envelope while still delivering the desired fill‑rate and latency characteristics. Continuous feedback between the two functions is essential for maintaining a sustainable edge.

Do you have a systematic way to reassess queue position and expected spread in real time, or does your current DMA setup rely solely on static latency measurements?


About the research behind this lesson

The seminar frames electronic markets as price-time-priority queues. It separates queue value into spread capture versus adverse-selection cost and the option value of retaining a place in line.

Applied to this lesson: An order lifetime therefore cannot be based on elapsed time alone: the system must reassess whether its queue position, expected spread and adverse-selection risk still justify keeping the order alive.


Two live systems, one desk

PULSE-X — power-packed HFT: high-frequency momentum on XAUUSD and EURUSD. System details · Live account

NIC-X — ultra-low drawdown: displaced-print arbitrage for large capital. System details · Live account

Start now: leave your email and request a free trial — we will send the pricing, the connection route and the trial terms. Pricing

Join the market discussion: Telegram @squawklive

Source: High-Frequency Trading and Modern Market Microstructure

Educational content only. Trading leveraged products involves risk.

Chat with XTRSK

Chat ready

Start a chat and the XTRSK team will be notified immediately.

LEAVE A REPLY

Please enter your comment!
Please enter your name here