Dev Grants
Develop algorithm for, and implement a fixed-grid strategy for Hummingbot.
0x4eFA8812f4C6170d7af192657DED8575b935cC6C
400,000 HBOT
15 development days already completed for conceptualising algorithm, implementing in Hummingbot codebase, and testing and debugging.
Additional 5 days estimated for integrating strategy into the main branch in coordination with foundation team, and for ironing out any pending issues.
20,000
The fixed grid strategy is often the entry point of users to algorithmic trading in crypto. It is available free to use on popular exchanges such as Binance and Kucoin. The fixed grid strategy is a useful tool for market making in consolidating / range-bound price action, and for stablecoin pairs. The only parameters needed to set up this strategy are the grid ceiling price, the grid floor price and the number of grid levels. At any given level, buy limit orders are placed at levels below, and sell limit orders are placed at levels above.
The grid consists of N levels as illustrated above
Lowest level is the grid floor and the highest level is the grid ceiling.
Grid_spread = (ceiling_price -floor_price)/(N-1)
Price at i-th level = floor_price + (i-1)*grid_spread
At each level, there is an associated base and quote inventory requirement. These are for the buy orders that will be placed at levels 1 to i-1, and for the sell orders that will be placed at levels i+1 to N .
Base inventory at i-th level = (N-i)*order_amount
Quote inventory at i-th level = Sum(prices at levels 1 to i-1)*order_amount
When started, the bot will find the closest grid level and check if the corresponding inventory requirements are met. If not, it will attempt to rebalance with a limit order by either buying or selling the required amount of base asset. Once the inventory requirements are met, the grid will be set up.
(Binance has 3 types of grid bots — Long, Short and Neutral. All 3 of these can be done by the HB fixed grid bot. When the starting price is in between the grid levels it is a Neutral bot, when it is below the grid floor it is a Long bot, and when it is above the grid ceiling it is a Short bot)
A sample config file for the Fixed Grid strategy is shown above. The required fields are highlighted. Except these and order_amount, all other fields are optional.
The start_order_spread is the spread for the limit order that is placed to rebalance inventory (if required) at start of the bot operation.
The order_optimization and depth options are only for the starting rebalance order.
A Fixed Grid bot for BTC-USDT (same config as shown in previous section) is started without sufficient USDT balance.
Once the inventory requirements are met, the grid operation is started.
When an order is filled, the grid is updated on the next tick.
CNTR-USDT was chosen for this demonstration because of its consolidating price action as shown below.
Buys (red) and sells (blue) performed by the strategy:
Statistics of buys, sells and PNL from the run:
(The plot of buys/sells and the run statistics were generated using the tool at https://github.com/rkc2000/Hummingbot-Postprocess)