What's the Spot Grid bot and how do I use it?

Opublikowano 3 paź 2025Zaktualizowano 3 paź 202520 min czytania

A spot grid bot is a trading bot that you can customise and deploy to automatically place buy and sell orders at set intervals and within a specified price range. The aim of the spot grid bot is to systematically buy at lower prices and sell at higher prices within a specified price range. As with all bots, there's no guarantee that this aim will be achieved. The bot will only operate according to the parameters you set.

The term grid refers to the intervals between trading levels where these orders are placed.

How does the Spot Grid bot work and how do I set it up?

A spot grid bot is designed to buy crypto at low prices and sell it at higher prices within a specified price range, aiming to generate incremental profits. When it's activated, it spends a portion of your allocated trading funds to buy crypto based on your set trading range and the current market price. The bot then places buy orders below the current price and sell orders above it at set intervals, known as grids, which together form your entire trading range.

When the crypto price reaches a buy or sell level, the trade is automatically executed. After this, the bot then places new buy orders below the current price and sell orders above it once again. This setup allows the bot to continuously buy low and sell high.

Grid trading doesn't guarantee profits and has limitations, amongst others: in a strongly trending market, buy or sell orders may remain unfilled, or in a downtrend, filled buy orders may lead to losses. The grid bot may lack flexibility should market conditions suddenly change, and have higher than expected trading costs due to the number of orders being executed, particularly in volatile markets.

What are the Spot Grid bot trading parameters?

You can create a spot grid bot by setting the following key parameters:

  • Price Range: The user needs to define a lower and an upper price for the bot to operate within.

    • Lower price: the lowest price level at which the bot will operate. The bot will stop placing orders if the market price falls below this level.

    • Upper price: the highest price level at which the bot will operate. The bot will stop placing orders if the market price exceeds this level.

  • Grid quantity: this refers to the number of price levels (grids) that your selected price range is divided into. The bot will place buy and sell orders at each level. Having more grids means the bot will execute smaller trades more frequently. Fewer grids result in larger trades but less frequent execution. For example, if the price range is 100-400, and you set the grid quantity to 3 with arithmetic mode, it would create three grids: 100-200, 200-300, and 300-400.

  • Grid mode:

    • Arithmetic: maintains a consistent difference between each grid level so grid levels become (1, 1+r, 1+2r, 1+3r...).

    • Geometric: maintains a consistent ratio between each grid level so grid levels become (1, 1*r, 1*r^2, 1+r^3...).

  • Investment amount: this is the total amount of the selected currency the bot will use to place buy and sell orders across the grids. The maximum amount is usually the available balance in your trading account for the selected currency.

Other optional parameters:

  • Trailing up/down: this option allows the bot to automatically adjust the grid as the price moves, improving flexibility and maximizing capital utilization by adapting to market fluctuations.

  • Take profit (TP) price: an optional price target. If the price reaches this level, the bot will stop trading and sell all base assets at the market price.

  • Stop loss (SL) price: another optional setting aiming to limit losses. If the price drops to this level, the bot will stop trading and sell all base assets at the market price.

Example:

A user sets up a Spot Grid Bot with the following parameters

  • Trading Pair: BTC/USDT

    • BTC is the Base Currency and USDT is the Quote Currency

  • Price Range: 90000 USDT - 120000 USDT

    • 90000 is the lower price range

    • 120000 is the upper price limit

    • The Bot will not place any new orders if the BTC/USDT moves outside this range.

  • Grids: 6

  • Total Investment: 10000 USDT

    • The bot will deploy 10000 USDT across the grids

    • This amount will be reserved specifically for this bot in the user's account

Based on these parameters, there could be two different sets of grids based on grid mode:

  • Arithmetic - Each grid has an equal price difference

    • The grid gap will be (120,000 - 90,000)/6 = 5000

    • Making grid levels to be 90,000, (90000+5000 = 95000), (90000+2*5000 = 100000) and so on

      Arithmetic grid trading setup with 5.56%–4.35% returns across six levels, from 90,000 to 120,000 USDT

  • Geometric - Each grid has an equal price difference ratio

    • The grid ratio will be (120000/90000)^(1/6) = 1.04911506

    • Making grid levels to be 90,000, (90000*1.04911506 = 94,420), (90000*1.04911506^2 = 99058),...

  • Return %: The return for each level will be (upper range level - lower range level)/ lower range level

    Geometric grid trading setup with 4.91% returns across six levels, from 90,000 to 120,000 USDT

How do I manage my Spot grid bots?

From the trading bot dashboard, you can monitor and manage your spot grid bot:

  1. Modify parameters: adjust the bot's price range and grid quantity even after it’s active, allowing flexibility in response to market changes.

  2. Withdraw profits: transfer grid profits earned by the bot directly to your trading account.

  3. Stop your bot: when you stop the bot, all pending orders are cancelled. You can choose to either sell the crypto at the market price or keep it. In both cases, the funds or crypto are transferred to your trading account.

  4. View details: check the bot details page for real-time performance insights and statistics. On this page, you can view the filled orders, which indicate the total number of completed orders, and the matched trades, which represent completed transactions where a buy order and a sell order were executed at a higher price level.

  5. Replicate setup: recreate a bot with the same parameters.

What are the potential risks of using Spot grid bots?

While the Spot Grid bot can be effective in sideways or moderately volatile markets, it carries certain risks:

  • Strong trends: in sharp uptrends or downtrends, the bot may leave many orders unfilled or result in accumulated losses from buy orders.

  • Volatile markets: frequent trades during high volatility may increase transaction costs, eating into profits.

  • Over-optimisation: choosing too many grids or too narrow a range can reduce efficiency and tie up funds.

  • Sudden market shifts: abrupt news or events may cause prices to move beyond your set ranges, limiting the bot’s effectiveness.

What are some examples of trading with Spot grid bots?

Success scenario:

Suppose you set up a Spot Grid bot with a range of $20,000–$24,000 for BTC, divided into 10 grids. As BTC fluctuates within this range, the bot continuously buys near $20,000–$21,000 and sells closer to $23,000–$24,000. Over time, these repeated buy-low/sell-high trades accumulate, netting incremental profits as BTC oscillates within your set range.

Loss scenario:

Using the same setup, if BTC suddenly drops from $22,000 to $18,000 in a steep downtrend, all your lower buy orders will fill, but the price never rebounds to your sell levels. The bot stops placing new trades since the market has moved outside the set range, leaving you with unrealized losses. If you have a stop loss set, the bot will sell at a lower price to limit further losses, but this still locks in a loss.

Example of execution:

While the bot tries to place buy and sell limit orders at grid intervals, the actual price the order gets filled can differ based on the market conditions. Also, each buy order and sell order incurs trading fees. For simplicity, we will ignore fees and slippage in the example below.

Time

Description

Bot Orders

T=0

User defines the Grid Bot Parameters

Grid Bot Parameters

Trading Pair : BTC/USDT

Initial Investment Mode : Quote Currency

Initial Investment Amount : 10000 USDT

Trigger Price : Instant

Current Price (BTC/USDT) : 100000 USDT

Price Range : 90000 - 120000 USDT

Number of Grids : 6

Since the Bot's start condition is Instant, the Bot starts to place order as soon as it's created.

Example of a grid trading setup showing active buy orders and multiple filled buy orders between 90,000 and 120,000 USDT

Time

Description

T=1

Trigger condition met. Bot first divides the range into grids based on the user entered parameters. In this case, iArithmetic grid.

The bot also calculates the quantity of BTC to buy at each grid level. (btc_qty). The bot calculates btc_qty= 0.01709 BTC

The bot will place Buy limit orders at each grid level for btc_qty.

Since the limit orders in grid 3,4,5, and 6 are above and equal to the current_price of 100000 they will be filled. ( group 3,4,5,6)

The remaining buy limit orders will remain unexecuted. The bot will place a hold on the amount of USDT in the user's account that will be necessary USDT to execute these orders if the market touches the trigger price.

NOTE:

Depending on market conditions, the price at which the limit order gets filled might be different from the limit order price.

Each transaction will incur then current trading fees.

As a result of this activity, the user account holdings are BTC = 0.06838 and USDT = 3162

For those orders filled ( group 3, 4, 5, 6) the bot will now place the relevant limit sell orders to capture the profit when the market moves.

Example of a grid trading setup with active buy and sell orders placed between 90,000 and 120,000 USDT

Time

Description

T=2

The user started with 10000 USDT. Now the account has BTC = 0.06838 and USDT = 3162


BTC moves to 102000

The value of the assets in the account is now 10137 USDT.

For each grid the buy and sell price is fixed. However, the limit orders might fill at different prices depending upon market movements. Let's take group 4 as an example. The buy price is 105000 , but it got filled at 100000 since that price was below the limit buy trigger price.

Example of a grid trading setup with executed and active buy/sell orders placed between 90,000 and 120,000 USDT

Time

Description

T=3

BTC moves to 106000.

The limit sell order of group 3 gets filled at 106000.

Total Realized Pnl is (106000- 100000)*0.01709 = 102.54 USDT


Out of this total realized Pnl we can allocate (105000 -100000) * 0.01709 = 85.45 USDT to this grid as grid_pnl. The remaining USDT is available for the user to trade or withdraw.

Example of a grid trading setup with buy orders starting at 90,000 USDT and sell orders placed up to 120,000 USDT

Time

Description

T=4

After successfully executing a buy and sell cycle, the Bot restarts the cycle for grid 3 by placing a limit buy order at the lower price limit for grid 3.

This cycle continues, with the bot effectively buying low and selling high, until the user chooses to cancel the bot.

How do each of the parameters impact bots' profitability?

  • Price Range: The lower and upper price limits define the zone where the bot works.

    • Narrow range:

      • Focuses activity in a small area, therefore, leads to more trades and faster turnover.

      • Can produce a higher percentage return on capital.

      • Risk: if the market jumps out of range, the bot stops.

    • Wide range:

      • Lets the bot ride big swings and stay alive in volatile markets.

      • Trades less often, which can slow ROI because funds are spread thin.

  • Number of Grids: Grids are the steps inside your price range.

    • More grids:

      • Smaller gaps lead to frequent trades but smaller profits per trade

      • Costs rise: every trade pays a fee, and profits per trade are tiny.

    • Fewer grids:

      • Larger gaps lead to fewer trades but bigger profits per fill.

      • This can lead to fewer trading opportunities but also keeps the costs low

  • Investment Amount: How much capital you allocate to the bot.

    • Higher allocation:

      • Lets you fund all grids and increase order size → higher potential dollar profits.

      • But locks up more funds and increases exposure if price trends against you.

    • Lower allocation:

      • Limits risk and capital lock-up.

      • May leave some grids unfunded, meaning missed trades.

  • Trailing up/down: These tools move your grid as the market trends:

    • Trailing Up: Shifts the grid higher during rallies so you can keep selling into strength. Boosts gains if momentum continues.

      • Risk: if the rally fails, you could hold expensive buys.

    • Trailing Down: Expands the grid downward in dips, lowering average cost and positioning for rebounds.

      • Risk: You can over-accumulate in a long bear market.

Can I terminate the bot?

The user can terminate the bot at any time during its execution. If you choose to terminate your bot, all your pending orders generated by the bot will be canceled and your positions will be closed at the then current market price. Your assets will be credited automatically to your Trading account.

The user can also specify the following advanced parameters :

  • Take-profit (TP) price: The bot will stop working when the price reaches TP price, and the bot will sell all base assets at corresponding market price.

  • Stop-loss (SL) price: The bot will stop working when the price falls to the SL price, and the bot will sell all base assets at the corresponding market price.

What are the choices for Initial Investment?

The user can start the bot by investing in three different ways:

  • Quote currency – you invest in quote currency (for example, USDT if you're trading BTC/USDT). This will result in the bot placing buy limit orders to buy the Base currency.

  • Base currency – you invest in the base currency (for example, BTC if you're trading BTC/USDT). This will result in the Bot placing sell limit orders for the Base currency.

  • Combination of Base and Quote currencies – You invest using both the base and quote currencies (for example, BTC and USDT for BTC/USDT). This will result in the Bot placing both limit buy and limit sell orders.

The choice of investment mode dictates how the bot initializes and places the initial orders.

What's the automatic price range modification?

In a trending market, the price might move out of the bot's price range, making the bot inactive. The grid bot has two features which allow the bot to automatically extend the price range in the direction of the market.

  • Trailing Up: This feature enables your grid to follow the price if it continues rising beyond the initial upper limit. This function moves the entire grid upward automatically to stay aligned with the price movement. It allows your trading bot to stay active longer by removing the lowest grid and adding a new grid at the top.

When the current price hits the grid's upper limit:

  • The lowest buy order at the grid's lower limit is canceled.

  • A new buy order is placed at the original grid's upper limit.

  • Once the buy order is filled, a corresponding sell order is placed one grid level above the original upper limit.

  • In effect, the entire grid shifts upward, including both the upper and lower limits.

Other Considerations:

  • If you set a Take Profit (TP) by price, the TP doesn't move with the grid. The TP value remains fixed and is set when configured.

  • If you set a Stop Loss (SL) by price, the SL will move upwards in sync with the grid, shifting at the same interval as the lower grid limit.

  • Trailing Down:

This feature allows the entire grid to extend downward if the price continues to fall below the grid's lower limit (for example, the grid range expands downwards and gets larger than the originally set range). As the price drops, the grid follows automatically, but it's important to note that each extension of the grid requires additional capital from your main account to fund the new orders. If there aren't enough funds, the grid won't extend further.

You can choose to reserve funds at the time of bot creation to ensure your grid has the capital it needs during a Trailing Down event. If not, the bot will attempt to draw from the main account balance when needed.When the current price hits the grid's lower limit:

  • A new buy order is placed one level below the grid’s lower limit, using additional funds from the main account. (If there are insufficient funds, no buy order will be placed.)

  • Once this buy order is filled, a sell order will correspondingly be raised to complete the order group.

  • The grid is then extended downward, shifting the lower limit one level down, while the upper limit remains static.

Other considerations:

  • Both Take Profit (TP) and Stop Loss (SL) levels do not move with the grid when trailing down. These values remain fixed, as set during configuration.

Risk Disclosure

Trading bots let users automatically place orders based on user-set parameters. Using a trading bot can be a useful tool for users to enhance their trading, but as with all trade, it involves risk.

No guaranteed returns or investment advice: the use of Trading Bots doesn't guarantee or ensure positive returns. All information and materials we provide concerning Trading Bots are for informational purposes only and do not constitute financial, trading, or investment advice. Investors should be aware that all investments are inherently risky and may result in the partial or complete loss of the principal amount invested.

Furthermore, any examples or references to the past performance of trading strategies are provided for illustrative purposes only and shouldn't be considered a reliable indicator of future results. There's no assurance or warranty, express or implied, from us that the use of Trading Bots will be profitable for any user.

High market risk and price volatility: the crypto market is highly volatile and subject to significant price fluctuations. Although a trading bot may include built-in mechanisms like stop-loss and take-profit for risk management, the user remains responsible for actively managing and observing its performance in line with their personal risk appetite.

Inherent risks of trading strategies: each specific trading strategy has its own risks. You're responsible for understanding these risks and ensuring the bot is suitable for you.

Your sole responsibility: you're fully responsible for how you use trading bots, including, but not limited to, the setting of all relevant parameters. The bots execute instructions based on parameters you set, and you're responsible for monitoring market conditions and complying with all applicable rules. We're not liable for any losses.

Additional fees: all trades executed through bots incur the same fees as trades placed manually by the user. There are no additional charges for using bots.

Execution is not guaranteed: it's not guaranteed that orders will be fully or partially filled, or executed at a specific time or price. During extreme market conditions, your instructions may be canceled or executed at a different price than intended. Failed execution or partial execution might expose the user to sudden and unexpected market risk.

Market exposure: you'll be exposed to market risk while the Bot is active and in any resulting holdings. Also, in multi leg execution, such as in grid bot, the market movement might force the execution of only one leg of the strategy. It's your responsibility to monitor this exposure and manage it based on your own risk tolerance.

Fund availability: the bot may reserve the use of capital in user's account as calculated based on parameters set by the user. These funds might not be available to the user for any other purpose while the bot is active. Also, certain features of the bot if enabled by the user might require additional funds in the future. If the funds aren't available or reserved, the bot might terminate.

Bot termination: a bot may end based on parameters set by the users, lack of funds in the user account, market condition, or specific events such as delisting or halt on trading of the traded assets. This termination might be temporary or permanent. In either case, it's the sole responsibility of the user to monitor the performance and exposure of the bot

Change of parameters: user can modify the parameters of a running Bot. This can result in buying or selling of underlying assets in prevalent conditions, resulting in realized loss or profit. The price range for a spot grid bot should be carefully monitored in a volatile or strongly trending market. Too many grids in a pricing range can increase the transaction costs. Please take this into consideration before modifying an active Bot.

No trading, tax, or legal advice: please consult your own tax, legal and other advisers if you're unsure of the risks of using Trading Bots. Your use of Trading Bots should be based on your own independent review, discretion and assessment of its suitability for you, taking into account your specific objectives, financial situation, investment experience, knowledge, and needs.

For more queries on the trading bot, feel free to head over to Support center or reach out to our OK Assistant for further assistance.