All strategies in the current document are temporarily not supported under portfolio accounts
Contents
I. Spot Grid
II. Futures Grid
III. Recurring Buy
IV. Smart Portfolio
V. Arbitrage
VI. Iceberg
VII. Time-weighted Average Price (TWAP)
I. Spot Grid
1. What is Spot Grid trading?
Spot grid trading is an automated strategy to buy and sell assets in a configured price range. It creates a grid of gradual orders (i.e., at incrementally increasing and decreasing prices) with preset intervals, placing them above and below a base price you set.
2. Use cases of Spot Grid trading
The essence of spot grid trading strategy is to profit by "buying low, selling high", and this strategy performs the best in a oscillating bullish market. However, in bearish market using Spot Grid trading might results in losses.
3. How do I set up a spot grid trading bot?
3.1. Steps Overview
-
Enter OKX on your PC or mobile and navigate to Trade, select Trading bot mode (at the top left corner on the web and top right corner on the mobile app), and click Spot grid.
-
Enter parameters manually or use backtested AI parameters on the trading interface, and confirm the total investment amount to create a grid trading bot(After you create a bot, the initial funds will be isolated from your trading account and used for grid trading only).
-
You can view and manage your bots on the Bots page.
-
After the bot starts running, you can withdraw your earnings or stop the bot anytime.
3.2. Options and parameters
Setup Options
Set myself: Set parameters based on your own analysis of the market.
AI strategy: Use the parameters recommended by backtested strategy (The recommended parameters are selected based on the backtesting results over past 7 days using a proprietary smart algorithm)
Grid Trading Parameters
Lower price: The bot will stop placing orders when the market price is lower than the lowest price.
Upper price: The bot will stop placing orders when the market price is higher than the highest price.
Grid quantity: The number of grids represents the corresponding shares divided within the price range. For example, if the price range is 100-400, the mode is arithmetic, and the number of grids is 3, it is divided into three grids: 100-200, 200-300, and 300-400.
Grid - Arithmetic grid: It keeps the same common difference between each grid. (For example: 1, 2, 3, 4.)
Grid - Geometric grid: It keeps the same common ratio between each grid. (For example: 1, 2, 4, 8.)
Asset: Users can choose to invest either in the base currency or the quote currency or invest in both.
Amount: It refers to the amount of quote currency invested in the Trading bot. The maximum available amount of each quote currency equals the current maximum transferable amount of that currency in the Trading account.
Take-profit (TP) price: The Bot will stop working when the price reaches TP price, and the bot will close the position at TP price.
Stop-loss (SL) price: The Bot will stop working when the price falls to the SL price, and the bot will close the position at SL price.
3.3. Sample Case (BTC/USDT)
Bot Parameters
The lower price: 50,000 USDT
The upper price: 100,000 USDT
Grid quantity: 50
Grid mode: Arithmetic
Investment Amount: 5,000 USDT
BTC price when activate strategy: 60,100 USDT
Run the Bot
-
Stage 1 - Initial order placement: The system will calculate the price of each grid, which are 50,000 USDT, 51,000 USDT, 52,000 USDT...98,000 USDT, 99,000 USDT, 100,000 USDT, and then place buy orders in each grid. If the market depth is great, the sell order will be opened in the nearest grid above upon the completion of the buy order, and the buy order will be opened in the nearest grid below. That is, after the Bot starts, there is a buy order at each grid from 50,000 USDT to 60,000 USDT and a sell order at each grid from 62,000 USDT to 100,000 USDT.
-
Stage 2 - Bot operation: A buy order will be executed when the price drops below 60,000 USDT, and in the meantime, a sell order will be opened in the nearest grid above (61,000 USDT). If prices rise above 61,000 USDT, the sell order will be executed, and in the meantime, a buy order (60,000 USDT) will be opened in the nearest grid below.
In this way, the Trading bot helps you make profits by buying and selling orders at predefined price intervals. It allows you to take advantage of fluctuating market prices.
4. Risk reminder and notes
-
If the price falls below the lower price of the defined price range, the bot will not continue to place additional orders. If the price continues to fall and does not return back to the pre-defined range, the crypto asset held at this time will suffer losses. Therefore, it is recommended to set a stop-loss price below the lower price to avoid taking excessive risk on your position.
-
The fund invested in the grid will be isolated from your Trading account and used independently for the Trading bot. Therefore, users need to pay attention to the risk of overall positions in your Trading account after transferring funds.
-
Our system will sell your assets at market price when the Bot is stopped manually or when the stop-loss price is triggered. If the risk management system judges that it will bring risks to the market, it may fail to sell your assets, but you can still decide whether to sell them manually or not.
-
While the spot grid bot is running, if encounters unpredictable circumstances such as suspension or delisting of the underlying crypto asset, the bot will be automatically stopped.
II. Futures Grid
1. What is Futures Grid trading?
Futures grid trading is an automated strategy that trades futures contracts with preset intervals within a specific price range. The strategy will continuously buy low and sell high for each grid defined, and profit from the volatile market.
The futures grid currently supports all USDT-margined contracts and will support crypto-margined contracts in the future.
2. Use cases of Futures Grid trading
The essence of futures grid is "volatility arbitrage", so the strategy is suitable when the market is sideways or volatile with the price continuously fluctuate within a range. Meanwhile, the futures grid strategy can be directional, in which:
-
Long Futures Grid: The bot only possess long positions and earn profit by closing it when the price increases. It works the best in volatile market with bullish outlook.
-
Short Futures Grid: The bot only possess short positions and earn profit by closing it when the price drops. It works the best in volatile market with bearish outlook.
-
Neutral Futures Grid: The both possess both long and short positions, in which the bot will short the futures contracts when price is above the base price and long the futures contracts when the price is below the base price.
User can select the corresponding futures grid strategy based on its insight on the market outlook.
3. How do I set up a Futures Grid trading bot?
3.1. Steps Overview
-
Enter OKX on your PC or mobile and navigate to Trade, select Trading bot mode (at the top left corner on the web and top right corner on the mobile app), and click Futures grid.
-
Enter parameters manually or use backtested AI parameters on the trading interface, and confirm the total investment amount to create a grid trading bot(After you create a bot, the initial funds will be isolated from your trading account and used for grid trading only).
-
You can view and manage your bots on the Bots page.
3.2. Options and parameters
Setup Options
Set myself: Set parameters based on your own analysis of the market.
Set myself - Auto fill: Automatically fill in parameters recommended by the trading bot, based on backtested strategy.
AI strategy: Use the parameters recommended by backtested strategy (These parameters are based on a weekly backtest of this pair).
Grid Trading Parameters
Lower price: The bot will stop placing orders when the market price is lower than the lowest price.
Upper price: The bot will stop placing orders when the market price is higher than the highest price.
Grid quantity: The number of grids represents the number of pending orders divided in the price range. For example, if the price range is 100-400, the mode is arithmetic, and the number of grids is 3, it is divided into three grids: 100-200, 200-300, and 300-400.
Grid - Arithmetic grid: It keeps the same common difference between each grid. (For example: 1, 2, 3, 4.)
Grid - Geometric grid: It keeps the same common ratio between each grid. (For example: 1, 2, 4, 8.)
Leverage: The leverage used when trading contracts in the strategy. The maximum leverage currently allowed is 5x.
Used margin: The actual amount that was invested in this grid strategy. It will be separately used after grid starts working
Advanced - Take-profit (TP)/Stop-loss (SL) price: The bot will stop working when prices reach a predefined TP/SL value, and close all positions by placing a market order.
Open a position when strategy activates: You can open your first position when activating strategy. For example, if you open a position in long grid, the position price will automatically be higher than the current market price. You can profit from closing long when the price increases. Likewise for short position.
Total amount: Total amount with leverage, calculated as Used margin * Leverage.
Estimated liquidation price (Long): Estimated liquidation price of the long position with the maximum opening amount, on the assumption that all long orders in the grid are filled.
Estimated liquidation price (Short): Estimated liquidation price of the short position with the maximum opening amount, on the assumption that all short orders in the grid are filled.
(Order parameter) Estimated liquidation price: Estimated liquidation price of current positions.
(Order parameter) Actual leverage: Measure the actual leverage risk of current positions, calculated as Current positions value / Equity of strategy account.
3.3. Sample Case (BTC/USDT Futures)
Bot Parameters
Grid property: Long grid
Lowest price in range: 50,000 USDT
Highest price in range: 100,000 USDT
Grid Quantity: 50
Grid mode: Arithmetic
Leverage: 2x
Used amount: 5,000 USDT
Open the first position: Yes
BTCUSDT futures price when activate strategy: 60,100 USDT
Run the Bot
-
Stage 1 - Initial order placement: The system will calculate the price of each grid, which are 50,000, 51,000, 52,000...98,000, 99,000, 100,000 USDT, and then place buy orders with 2x leverage in each grid. If the market depth is great, the buy orders will be filled above the market price and position opened, and the close sell orders will be placed at the price of each higher grid.
So, after the Bot starts, there are buy orders at each grid from 50,000 to 60,000 USDT and sell orders at each grid from 62,000 to 100,000 USDT.
-
Stage 2 - Bot operation: A buy order will be filled when prices drop below 60,000 USDT, and in the meanwhile, a sell order will be automatically placed at the price of 61,000 USDT (which is the nearest grid above 60,000 to 61,000 range). If prices rise, after a sell order is filled, in the meanwhile, a buy order will be placed in the nearest grid below.
In this way, the Trading bot helps you make profits by placing and filling orders in a price range. It allows you to take advantage of a volatile market.
4. Risk reminder and notes
-
If the current price falls below the 'Lower Price' defined, the bot will stop placing new orders. If the price continues to fall and is not recovering back to the grid price range, the position held by you will suffer losses, and might result in forced liquidation if leverage is applied. Therefore, it is recommended to set a stop-loss price below the 'Lower Price' of the grid to avoid massive loss under worst scenario.
-
The fund invested in the grid will be isolated from your Trading account and used independently for the Trading bot. Therefore, users need to pay attention to the risk of overall positions in your Trading account after transferring funds.
-
While the futures grid bot is running, if encounters unpredictable circumstances such as suspension or delisting of the underlying crypto asset, the bot will be automatically stopped.
III. Recurring Buy
1. What is Recurring Buy?
Recurring Buy is a dollar-cost averaging (DCA) strategy for investing a fixed amount in crypto at your defined fixed intervals. An appropriate recurring approach in volatile markets allows you to buy crypto at a lower cost.
2. How do I set up a Recurring Buy bot?
2.1. Steps Overview
-
Enter OKX on your PC or mobile and navigate to Trade, select Trading bot mode (at the top left corner on the web or top right corner on the mobile app), then click Recurring buy.
-
Select the asset to be invested and specify your allocation for each asset, then confirm the Frequency, Time, and Amount to create a Recurring buy bot. After the strategy is created, the fund is not reserved and isolated upfront for each cycle from the trading account. Please ensure sufficient fund in the trading account before each investment period.
-
You can view and manage your bots on the Bots page.
2.2. Options and parameters
Crypto allocation: You can choose the crypto assets from the Recurring buy bot, either a single-pair or multi-pairs up to 20 assets. The Recurring buy bot will proportionally invest using the allocation parameters in each period.
Frequency: The frequency of each Recurring buy cycle. You can pick to buy in daily, weekly or monthly manner.
Local Time: The specific timing when the asset will be bought from local time on that day.
Amount: The investment amount used to buy the crypto assets at each recurring buy period. Currently, only USDT and USDC are supported as the quote currency. It will soon be further extended to other quote curencies.
Backtesting of last 2 years: when the sum of the crypto allocation equals to 100%, the bot will calculate the annual percentage yield using the given parameters within 2 years timeframe.
3. Risk reminder and notes
-
Recurring buy won't preempt other assets in your accounts. In each investment cycle, please reserve sufficient funds to avoid the failure operation. In case of insufficient funds, the Recurring buy bot will be halted until the available fund is allocated in the trading account for the next investment cycle.
-
While the Recurring buy bot is running, if encounters unpredictable circumstances such as suspension or delisting of the underlying crypto asset, the bot will be automatically stopped.
-
Recurring buy uses the assets in your Trading account to buy crypto. Please be aware of the forced liquidation risk caused by assets changes in your Trading account.
IV. Smart Portfolio

V. Arbitrage
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
Make an equivalent amount/total between the legs that have been inputted and not been inputted, by tick “Same amount” or “Same total”.
-
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.
VI. Iceberg strategy
1. What is the Iceberg strategy?
The iceberg strategy is an algorithmic order type allowing users to avoid placing a large order and cause slippage. An iceberg order automatically breaks up users' large order into multiple smaller orders. These orders will be placed in the market according to the latest best bid and ask price as well as the parameters set by the user. When one of the smaller orders has completely filled, or the latest market price has deviated significantly from the price of the current order, the others orders will be executed progressively.
2. Sample Case (BTC/USDT)
A user would like to buy BTC at a price below 20,000 USDT and does not want to increase the cost. He can set an iceberg order
Bot Parameters
Range - Ratio (Price Variance): 0.1%
Price limit: 20,000 USDT
Average amount: 2 BTC
Total amount: 100 BTC
Run the Bot
The system will automatically place an iceberg order. The order price will be the latest buy price*(1-Price variance 0.1%), and the amount of each order will be 50% to 100% of the average amount. Once the order completely filled, a new order will be placed.
When the last market price exceeds the highest buy price of 20,000 USDT, the iceberg order would be temporarily halted. After the price falls back to 20,000 USDT, the iceberg order would be resumed.
When the last market price exceeds 2*(Price variance), the previous order would be canceled, and a new one will be placed.
When the total trading volume equals its total amount, the bot will stop the order and end its operation.
VII. Time-weighted Average Price (TWAP)
1. What is the Time-weighted Average Price?
Time-weighted average price (TWAP) strategy splits your order and places smaller orders at regular time intervals.
It is a strategy that will attempt to execute an order which trades in slices of order quantity at regular intervals of time as specified by users. The purpose of TWAP is to minimize the market impact on basket orders. This bot triggers the order based on the predefined time intervals. It calculates the order price based on the current best bid/offer price,then splits the order into smaller ones and places them on the market(If the order is not fully filled, it will be canceled directly according to the IOC order rules).
2. Sample Case (BTC/USDT)
Assume that user A wants to buy BTC contracts below 10,500 USDT as soon as possible without increasing the purchase cost on the current market, so user A sets up a TWAP bot as follows:
Bot Parameters
Price variance: 1%
Price limit: 10,500 USDT
Interval: 20s
Average amount: 500 contracts
Total amount: 10,000 contracts
Run the bot
After the order is placed, the system will place orders at regular time intervals. Assuming the order book is as below:

According to the predefined price range, the highest buy price equals the Best Bid Offer (BBO), which is 10029.99*(1+price range 1.0%) = 10130.29 USDT. The total amount of sell orders below 10130.29 USDT is 570+1+200+1+1+1+1=775,and multiply the random number between 0.5 to 1 (e.g., 0.63) to get the order amount=775*63%=488.25 contracts. The order amount is less than the predefined average amount of 500 contracts, so the bot buys 488 contracts of sliced order at 10130.29 USDT. If the order is not fully filled, it will be canceled directly, which means the sliced order is an IOC order.
The bot will place orders constantly based on the predefined time intervals*random ratio (0.5~1) until the total filled amount reaches the predefined total order amount.
The bot will place the order at the limit price if the order price is higher than the predefined limit price.
If the order amount is more than the predefined average amount, the bot will place the order based on the average amount* random ratio (0.5~1).
The order will be suspended when the last price (20,500 USDT) is higher than the limit price and resumed when the last price is below 10,500 USDT again.
The bot will stop when the total filled amount equals the total order amount.