**Spot-futures arbitrage** is a classical arbitrage strategy that tries to capitalize on the price difference between an asset (a stock, commodity, currency, etc.) and a futures contract. This is a long known and popular strategy, with low risks being its main advantage. In the following article, we will analyse the reasons behind doing arbitrage, the trading algorithm itself, as well as some quirks and tips for implementing the strategy, which can turn it into a stable income source.

First, let's go over some theory. Futures is a derivative financial instrument, a contract to buy/sell certain assets at the current market price, but at a predetermined time in the future. The time when the underlying asset is to be delivered with the purchase/sale finally taking place in time is called the contract’s expiration date/time. Thus, proceeding from the very definition of the futures, the contract’s price must match the price of the underlying asset at expiration time.

Let's figure out where the price difference comes from. When buying or selling a futures contract, the trader does not have the full amount reserved on his trading account, but only the collateral/margin, which makes up a certain fraction of the total value of the contract, usually about 10% (on most futures exchanges, margin size is calculated based on SPAN algorithm, taking many variables into account, and updated by the exchanges periodically). Thus, if a trader decided to invest in, say, his favorite tech company, and bought a 6-month futures contract, he would have only “used” and had the margin funds blocked on his account, leaving the rest free to invest or trade with. As a result, at the time of expiration, additional (possible) income will/can arise due to trader’s ability to operate and invest the remaining funds, or (in the following case of theoretical futures contract’s price calculation) - keeping it invested on a “bank account” with the current country’s base interest rate.

Usually, the market “considers everything”: futures cost more than the underlying asset by just the premium amount. The longer before expiration, the more potential accrued income, hence futures will be more expensive relative to the asset. So, the very basic formula for calculating the theoretical futures’ price is: its price is considered equal to the current underlying asset’s spot price plus the amount of additional “income”, premium, which in turn is calculated as underlying asset’s price * days until expiration/365 * current interest rate. This formula is naturally supported by market mechanisms of supply and demand: if futures are cheaper than their theoretical value (backwardation, or deport) - buying futures instead of stocks/assets becomes profitable, the demand rises along with a subsequent price increase, with assets’ price falling. With futures becoming more expensive, contango - the opposite is true. In fact, futures’ theoretical price is the equilibrium price at which both the asset and the futures are equally beneficial to invest in.

Based on the information above, the difference between the futures’ and underying asset’s price should fall gradually over time until becoming zero at expiration. However, in reality this difference, called the spread, will only approximately follow its anticipated behavior. The reasons are numerous: different trading activity/volume on both the futures and asset, liquidity differences in market depth/level 2 due to different expectations of traders, and many others, most of them random/too complex to analyze, the spread between futures and the underlying asset will constantly fluctuate around its theoretical values. Sometimes these fluctuations are bigger than trading commissions, allowing profit to be made.

This is the main idea of spot-futures arbitrage: monitoring the spot-futures spread deviating from its theoretical value by an amount greater than trade costs (spread, commission, etc.), and making mean-reversion trades: selling the spread if it exceeds the theoretical value, and vice versa. In this case, selling the spread means two simultaneous orders being initiated - selling the futures contract while going long on shares/assets, and buying - the reverse, purchasing futures while selling the assets. The positions are closed on spread returning to the mean value.

Below is an example chart, a spot-futures spread of Gazprom:

A two-month trend - falling from ~80 to zero - is apparent here.

Our calendar arbitrage strategy can be used for spot-futures arbitrage, also described here. The essence of the algorithm is as follows:

- Assessing the spread’s average value, a moving average with a sufficiently large period is usually used.
- Determining the spread’s deviation from a moving average, with positions opened at the intersections.
- If the spread goes above the moving average by more than some specified deviation level, we go short.
- If the spread drops below by more than specified deviation level, we go long.
- We close the position on the spread returning to the mean value (moving average).

This algorithm can be improved by adding position averaging, spike filtering, AI and so on. More details on the implementation of this algorithm in Megatrader and ways to improve it here.

Inexperienced traders usually try to start using this strategy on “blue chips” and other highly liquid instruments. And, as a rule, they suffer losses. The thing is that the majority of arbitrageurs work on highly liquid instruments in the first place. All of them continuously monitor the market for even the smallest arbitrage situations. Obviously, in this situation, the faster one wins; the bigger shark always eats the fish. To verify this, one isn’t even required to trade, risking his hard-earned dough, testing the strategy on historical data taking execution delays into consideration (as easy as setting a number in Megatrader’s backtester) is plenty enough. All in all - trying to compete with quant traders is a viable thing only if Megatrader is deployed on a colocated VPS or server, just near the exchange, and even then just barely.

Ordinary traders not posessing the opportunity to invest in the infrastructure (we’re usually talking about at least hundreds of dollars per month) can try trading less liquid instruments. Since arbitrageurs usually skip illiquid instruments, being just a few here, large price differences can occur and last much longer than on highly liquid securities, where a price discrepancy may dissapear in a matter or milliseconds (sometimes - microseconds!). However, illiquid instruments have their drawbacks too, due to the lack of liquidity in the first place (huh). First - the spread between bid and ask prices is usually huge, resulting in majority of arbitrage situations occuring "inside" the spread, and real arbitrage opportunities, when it is possible to buy both instruments at market price, are extremely rare. The other is low liquidity itself being not enough limit orders held near the current price by marketmakers/traders, but frankly speaking, low liquidity is often working in our favor, discouraging “big sharks” from entering the asset.

Thus, taking everything stated above into consideration, one can analyze the risks and potential rewards of deploying a spot-futures arbitrage strategy: simultaneously monitoring several futures-asset combinations and catching rare but strong deviations from the mean. This approach is best suited for private traders, since it does not require lightning-speed colocated hardware and a trading account sporting numerous zeros.

A one-legged varitaion is also always a viable option - opening deals on only one instrument when buying or selling the spread, not hedging the arbitrage deal with the second one. An interesting fact this variation seeds on is profit from arbitrage trading sometimes accumulating on one of the assets traded, in opposite to the usual “both assets/account steadily growing, I wonder if I’ll be able to take it anymore”. Therefore, the next best thing to sliced bread is testing the trading algorithm separately with each instrument (again, a click away in Megatrader’s backtester) and seeing for yourself if jumping on one leg (no pun intended (sure)) is viable with this instrument pair.

When choosing one-legged arbitrage, it is worth mentioning and considering that the risks of this variation, as well as possible account drawdown increase significantly, as the deals remain essentially unhedged. Therefore, one should never leave open positions without control even with such a seemingly riskless strategy, and using stop-losses also becomes a nice layer of safety to implement.

Spot-futures arbitrage is a very attractive trading strategy that can captivate one with its simplicity and low risks. But, like many other trading strategies, implemented directly and with a naive approach in mind, it is unlikely to bring any significant profits, unless you have a speed advantage. However, considering the instrument pair, its volatility and liquidity, seasonal and daily patterns, and suiting the strategy correspondingly is more than able to lead to a stable profit stream.