Arbitrage is exposed between the legs

0
14

XCore HFT / Trading Lab

Arbitrage is exposed between the legs

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

What this problem really is

Arbitrage spreads are often presented as “market‑neutral” because the theoretical profit is the difference between a long and a short leg that, when both are executed, cancel each other’s exposure. In practice the two legs are submitted to separate order books, sometimes on different venues, and the execution of each leg is a stochastic event. The interval between the first fill and the second fill is a window in which the trader is no longer neutral: the filled leg carries directional exposure, and the unfilled leg is exposed to both liquidity shortage and adverse price movement.

The risk is not merely a timing inconvenience; it is a material component of the expected P&L. If the price moves unfavourably while the trader waits for the second leg, the realised spread can shrink, disappear or even reverse. Moreover, the cost of unwinding the unmatched leg—whether by market order, aggressive cancellation, or rerouting to a less favourable venue—adds a liquidity premium that must be accounted for in any realistic arbitrage model.

Arbitrage is exposed between the legs: mechanism
Figure 1. How the components of this idea connect

How the mechanism works, step by step

The first step is to construct a synthetic spread by posting a buy order on venue A and a sell order on venue B, each sized to the intended arbitrage quantity. The order management system (OMS) records the target quantity, the venue‑specific minimum size, and the acceptable price deviation from the quoted spread.

When an execution event arrives, the OMS updates two counters: the filled quantity on the active leg and the remaining quantity on the passive leg. Each update triggers a reassessment of the hedge threshold – the point at which the profit from the completed portion no longer offsets the risk of the outstanding exposure.

If the remaining quantity falls below a predefined cancel threshold, the system may either cancel the open order, reroute it to a deeper venue, or hedge the exposure with a market order. The decision is driven by a model of completion‑time distribution that incorporates venue latency, order‑book depth, and recent fill rates.

Finally, once both legs are filled, the spread is closed and the realised profit is booked. If the second leg never materialises, the trader must absorb the directional loss and any slippage incurred when neutralising the unmatched position.

A worked example with real numbers

Assume a statistical arbitrage strategy that exploits a 0.5 % price discrepancy between a futures contract on Venue X and the same contract on Venue Y. The trader posts a buy order for 10 000 contracts on X at 100.00 and a sell order for the same size on Y at 100.50, expecting a gross spread of 0.50 points (≈ $5 000). Both venues enforce a minimum order size of 2 000 contracts, and the OMS sets a hedge threshold of 3 000 contracts and a cancel threshold of 1 000 contracts.

The buy order on X fills 6 000 contracts within 120 ms, leaving a remaining 4 000‑contract exposure on the sell side. The sell order on Y, however, receives only a partial fill of 2 000 contracts after 250 ms before the order book depth evaporates. At this moment the trader holds a long position of 6 000 contracts on X with no offsetting short on Y. The market moves against the long leg by 0.3 points in the next 500 ms, eroding the anticipated spread to 0.20 points.

The OMS now evaluates the hedge threshold: the filled 6 000 contracts represent a potential loss of 6 000 × 0.3 = $1 800 if left unhedged. Because the remaining sell quantity (2 000 contracts) is below the cancel threshold, the system cancels the outstanding sell order and immediately sells the 6 000 contracts on the market at 99.80, incurring a slippage of 0.20 points (≈ $1 200). The net result is a realised loss of $3 000, turning an apparent arbitrage of $5 000 into a negative outcome.

The example highlights three quantitative elements: the need to track filled versus remaining quantity after every event, the importance of venue‑specific minimum sizes that force partial fills, and the cost of neutralising an unmatched leg when the price moves unfavourably.

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 order‑driven market the queue position is fluid. A high‑frequency participant that arrives earlier may be displaced by a burst of aggressive orders, causing the expected time‑to‑fill to lengthen dramatically. When the spread is thin, even a few milliseconds of queue erosion can shift the expected capture from positive to negative.

Liquidity can also disappear abruptly. A large hidden order on the opposite side may be withdrawn, or a venue may impose a sudden increase in tick size, both of which reduce the probability that the passive leg will be filled within the acceptable window. The model that assumes a static completion‑time distribution therefore breaks, and the trader is left with an exposed leg that must be dealt with under market conditions.

The operating path, stage by stage

Stage 1 is order creation, where the algorithm calculates the theoretical spread, the target size, and the venue‑specific constraints. The OMS writes these parameters to a state object that will be consulted after each market event.

Stage 2 is execution monitoring. Every acknowledgement, partial fill, or rejection updates the state object. The system recomputes the expected residual spread by multiplying the remaining quantity by the current best‑bid/best‑ask differential, adjusted for the probability of future fills derived from the empirical completion‑time distribution.

Stage 3 is decision making. If the expected residual spread falls below the hedge threshold, the OMS initiates a mitigation action: either a hedge order, a cancellation, or a reroute to a venue with a deeper queue. The decision logic incorporates the cost of each action, including the option value of staying in line versus the immediate loss from an aggressive market order.

Stage 4 is finalisation. When both legs are filled, the spread is closed and the profit is recorded. If one leg remains unfilled beyond the cancel threshold, the system executes the pre‑defined neutralisation path and logs the slippage incurred for later performance analysis.

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

Controls that act before the damage

A first line of defence is the dynamic hedge threshold. Rather than a static profit target, the threshold is a function of the current market volatility, the time elapsed since the first fill, and the observed fill rate on the counterpart venue. When volatility spikes, the threshold tightens, prompting earlier cancellation.

A second control is the reroute rule. If the probability of completion on the original venue drops below a calibrated level, the OMS automatically withdraws the order and re‑submits it on an alternative venue with a more favourable queue depth, even if the quoted spread is marginally smaller. This mitigates the risk of being stuck with a large unmatched leg.

A third safeguard is the minimum‑size filter. Before an order is sent, the system checks whether the venue’s minimum order size will force a partial fill that could leave the trader below the hedge threshold after the first execution event. If so, the order is either split into multiple smaller orders that respect the minimum or the entire arb is abandoned.

These controls are enforced in real time by a low‑latency decision engine that ingests market data, updates the state object, and issues order‑modification messages within microseconds. The engine also logs every threshold breach for post‑trade diagnostics.

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

How to measure whether it is working

The primary metric is the realised spread capture versus the theoretical spread at order entry. By aggregating the difference across a large sample of arb attempts, the trader can quantify the average slippage introduced by the interval between fills.

A secondary metric is the distribution of completion times for each venue. By fitting an exponential or Weibull distribution to observed fill intervals, the model can be back‑tested to see whether the hedge and cancel thresholds were set appropriately. A high proportion of trades that required emergency hedges indicates that the thresholds are too loose.

Both metrics should be reported alongside the frequency of partial fills that fall below the minimum size, as this directly impacts the probability of ending up with an unmatched leg. Continuous monitoring allows the parameters to be retuned without disrupting the live strategy.

The portfolio view

When the arbitrage desk operates multiple spreads simultaneously, the directional exposure from unmatched legs can aggregate into a net market bias. A portfolio‑level risk engine therefore tracks the net long and short positions arising from partially filled spreads, applying a VaR or stress‑test to the combined exposure.

If the net exposure exceeds a pre‑defined limit, the engine can automatically flatten the most vulnerable legs, even if the individual spread still appears profitable. This ensures that the desk’s overall market‑neutral stance is preserved, preventing a cascade of losses when several spreads experience simultaneous fill delays.

The portfolio perspective also informs capital allocation. Venues that consistently deliver faster completion times for a given instrument can be weighted more heavily, while those with chronic queue erosion are deprioritised, improving the expected realised spread across the whole book.

The portfolio view

(Already covered in previous heading; this heading will instead summarise the strategic implications.)

A disciplined approach to the interval‑risk problem transforms an apparent arbitrage into a repeatable source of alpha. By treating each leg as a contingent claim whose value decays with time and market movement, the desk can price the risk of non‑completion explicitly and embed that price in the spread target.

The result is a set of operational rules—track‑and‑update, dynamic thresholds, venue‑aware rerouting, and portfolio‑level exposure limits—that together keep the realised spread close to the theoretical one. When the system respects these rules, the desk can sustain a high turnover of market‑neutral spreads without leaking profit to the very liquidity risk it sought to avoid.

What steps will you take today to embed real‑time fill‑tracking and dynamic hedge thresholds into your arbitrage workflow?


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