Cross-Exchange Futures Spread Arbitrage with Depth-Aware Orders
Summary
This document describes a JavaScript strategy for comparing futures prices across two exchanges and trading a spread when the observed difference reaches configured thresholds. It supports both directions: opening a short position on one venue and a long on the other, or reversing those legs. Spread thresholds, contract quantities, closing thresholds, leverage, and other execution settings are configurable and can be changed while the strategy runs.
The code requests account, ticker, depth, and position data asynchronously. It estimates prices from selected order-book levels, checks for incorrectly ordered quotes, and caps trade size using displayed depth, configured limits, and matched position quantities when closing. These mechanics show how spread comparison and order sizing are implemented, but the document reports no performance tests or realized results. The source is described as an older implementation, and exchange-specific behavior, fees, latency, slippage, funding, and legging risk may affect whether an apparent spread is tradable. The supplied excerpt does not establish that the two legs execute atomically or remain hedged during failures.
Key ideas
- The strategy compares futures prices across two exchanges and opens opposing positions when the spread meets configured thresholds.
- Order quantities are limited by visible depth, configured size caps, and available matched positions when closing.
- It samples multiple order-book levels and rejects quotes that appear incorrectly sorted.
- Spread, quantity, closing thresholds, leverage, and execution settings are configurable.
- The excerpt gives no performance evidence, and execution costs and legging risk remain important uncertainties.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.