Part 2 of the series "Complex Arbitrage Chains Between Futures and Spot"
In the previous part, we discussed how graph algorithms find complex paths for asset swaps. But the cryptocurrency market offers another dimension of profit—the price difference between the same asset on different types of markets: Spot and Futures.
This is the world of delta-neutral strategies, where the trader's profit does not depend on whether the market goes up or down.
A visualization showing the bridge between spot markets and derivatives. One side shows spot candles, the other shows futures order books and funding rates.
1. The Core Concept: Basis and Convergence
At its heart, futures-spot arbitrage relies on the Basis—the difference between the futures price (F) and the spot price (S):
Basis=F−S
On the expiration date of a futures contract, the futures price MUST equal the spot price (F=S). This is called Convergence.
1.1 Cash-and-Carry
The most classic strategy:
Buy Spot: Buy 1 BTC at $50,000.
Sell Futures: Sell 1 BTC December Futures at $52,000.
Wait: In December, you deliver the BTC. Your profit is exactly $2,000, regardless of the BTC price.
In Rust, we track these spreads across exchanges to find the highest annualized return:
The most popular instrument in crypto is the Perpetual Future (Perp), which never expires. To keep the Perp price close to the Spot price, exchanges use a Funding Rate.
Positive Funding: Longs pay Shorts. Usually happens in a bull market.
Negative Funding: Shorts pay Longs. Happens in a bear market.
2.1 Funding Arbitrage
If the funding rate is 0.01% every 8 hours (about 11% APR), you can:
Buy Spot (1 BTC).
Short Perp (1 BTC).
Collect Funding: You receive 0.01% of the position value three times a day.
This is virtually risk-free income, provided you can manage the liquidation risk of your short position.
3. DeFi-CeFi Arbitrage: The New Frontier
With the rise of Decentralized Exchanges (DEXs) like dYdX or Hyperliquid and Automated Market Makers (AMMs) like Uniswap, a new type of chain has emerged.
3.1 The Chain
Detect Discrepancy: BTC Spot on Binance is 50,000,butBTCPerponaDEXis50,500 with a huge funding rate.
Execute: Buy on Binance (CeFi), Short on DEX (DeFi).
Optimize: Use a "Bridge" to move collateral if needed, or maintain balances on both sides.
3.2 Cross-Chain Complexity
DeFi-CeFi arbitrage adds "Gas Fees" and "L1/L2 Latency" to our previous graph model. Your Rust bot now needs to talk to Ethereum/Solana RPC nodes and Binance API simultaneously.
While the strategy is "Delta-Neutral" (no market direction risk), it is not "No-Risk."
Leg Risk: You buy the spot, but by the time you try to short the future, the price has moved, and the spread is gone.
Liquidation Risk: If the price doubles, your short position might be liquidated if you don't have enough collateral, even though your spot position is in profit.
Exchange Risk: What if the exchange goes down or gets hacked?
5. Conclusion
Futures-spot arbitrage is the "institutional" side of crypto. It requires more capital and better risk management than simple asset swaps, but it scales much better.
In the next part, we will dive into Vine Copulas, a mathematical tool used to model the complex dependencies between dozens of different assets and their derivatives simultaneously.