Arbitrage

Published on Jun 17, 2022Updated on Apr 12, 20245 min read

Arbitrage is temporarily not supported under portfolio accounts.

1. What is Arbitrage?

Arbitrage describes the low-risk act of profiting from the difference of interest rate spreads from different markets by using hedging or swap instruments. The most popular arbitrage strategies are funding rate arbitrage, spot-futures arbitrage and calendar spread arbitrage.

  1. Funding rate arbitrage: Simultaneously buying and selling the same amount of the same spot or perpetual swap to profit from the funding rate spreads in contracts trading.

  2. Spot-futures arbitrage: When the prices spread between spot and futures of a crypto has a big gap, opening positions by buying the instrument with lower price and selling the other one with a higher price. This arbitrage strategy profits from closing positions when the spread gets smaller.

  3. Calendar spread arbitrage: Buying and selling two different dated derivatives of the same crypto, profiting from the spread changes. The calendar spread may not equal to 0, so its risk is higher than Spot-futures arbitrage.

2. Why using Arbitrage Order Strategy?

Usually traders who want to place an arbitrage order need to track two markets simultaneously to avoid slippage. With using the strategy assistance tool that OKX provides, users can improve trading efficiency and accuracy.

3. How do I set up a Arbitrage Order trading bot? (take web for example)

3.1. Steps Overview

Modules of OKX Arbitrage Order Strategy

There are four modules: Portfolio information on the top, Order placement on the left, Order book in the middle, Candlestick charts on the right.

Users can select appropriate arbitrage portfolios based on the arbitrage order placement information which is calculated by OKX.

After selection, the two underlying assets in portfolio will be shown in Order placement, and the arbitrage sides have been selected already.

Assistance functions

  1. The “Switch” button next to underlying assets can help to change the location of left and right leg in Order placement, Order book and Candlestick charts.

  2. When input the price, users can know the trading spread which is the Arbitrage cost, calculated by Price rate tool in the middle of price zone. Users can also calculate right leg price by input left leg price and spread rate.

  3. Make an equivalent amount/total between the legs that have been inputted and not been inputted, by tick “Same amount” or “Same total”.

  4. To ensure one leg can be traded successfully when another leg has been filled, tick the checkbox “One leg will be traded under market price once another leg has been filled”

Explanations of 5 prices

The meaning of Limit price, Market price and Counterparty price are identical to the semantics when used in the Manual Trading mode. Limit price is the price users set. Market price the current price the asset is traded and potentially the order can be filled quickly. Counterparty price (BBO) is the best price (bid or ask) from the opposite side of your order.

Surpassed price

Buy: Order price = Best bid price + Taker range * Tick size, Taker range is set by users

Sell: Order price = Best ask price - Taker range * Tick size

Queuing price

Buy: Order price = Best bid price - Maker range * Tick size, Maker range is set by users

Sell: Order price =Best ask price + Maker range * Tick size

Auto-Tracking

When “Auto-tracing” is on, system will auto track the status of orders on every “tracking interval”. If orders are still unfilled or partially filled, and the order price is far from the queuing price range, the orders will be queued again at latest price after withdrawing the previous order.

When “Pause auto-tracing” is on, system will stop auto-tracking when the latest queuing price has reached the price threshold for suspending the chasing order. The specific pause price = the first pending order price * (1 + threshold)

After orders are placed, users can view the status of orders or cancel orders under the Arbitrage order tab. Besides, users can still view and act on sub-orders in Current or History orders under Manual trading mode.

Closing Arbitrage Order Bot and Book the profit

For Funding rate arbitrage, fees will be settled into your trading account daily;

For Spot-futures arbitrage, users can profit from closing a position when spread in two-leg market gets smaller

When the funding fees profit fulfills your expectation, or there’s no profiting chance, or the profit fulfills due to spread getting smaller in Spot-futures and Calendar spread arbitrages, you can close positions to book your profits. That is, closing the current positions in the opposite side to when the arbitrage orders were placed. The actions and principles are same as the processes above, please be aware to control the slippage. After fully closing positions, congratulations! You have completed an arbitrage trading successfully.