This repository contains the sample folder structure to organize bot configurations and scripts to run your all your bots at once.
For your context, this structure is only for bots running Pure Market Making strategy, for other strategy, please modify line 48 and 49 in init_and_run_bots.sh
script to point to correct config file name and strategy.
Only support HB client version dev-1.7.0, will not work with older version, i.e. 1.6.0
.
└── manage-bot-cycles/
├── asd-eth-usdt_files/
│ ├── hummingbot_conf/
│ └── hummingbot_scripts/
├── bin-bnb-busd_files/
├── kucoin-btc-usdt_files/
├── bots_to_run
├── init_and_run_bots.sh
├── readme.md
├── remove_bots.sh
├── start.sh
└── update.sh
manage-bot-cycles
is the root folderasd-eth-usdt_files
folder or any*_files
folder is the place to store bot configuration for any particular token pairhummingbot_conf
is the place to store bot main configuration fileshummingbot_scripts
is the place to store scriptsbots_to_run
text file to specify which pair to run botinit_and_run_bots.sh
bash script to init and run bots that are specified inbots_to_run
filereadme.md
this read meremove_bots.sh
stop and remove all bot instances, this will not cancel your trade ordersstart.sh
bash script to manually hook into your bot instanceupdate.sh
bash script to manually update bot docker images
The purpose of this folder structure and scripts is to make it easier to manage multiple bots and launch them all at once on your computer or server.
In order to do that, you need to do two things:
- Organize your bot configurations into folders and manage it from there.
- Manage the launch of your bot by using
bots_to_run
file andinit_and_run_bots.sh
script.
For each of your bot or token pair, you should put your configuration as follow:
asd-eth-usdt/
├── gateway_conf/
├── gateway_logs/
├── hummingbot_certs/
├── hummingbot_conf/
│ ├── connectors/
│ ├── strategies/
│ │ └── conf_pure_mm_asd-eth-usdt.yml
│ ├── .password_verification
│ ├── conf_client.yml
│ ├── conf_fee_overrides.yml
│ └── hummingbot_logs.yml
├── hummingbot_data/
├── hummingbot_logs/
├── hummingbot_pmm_scripts/
└── hummingbot_scripts/
- Main folder should have the following naming convention:
[exchange]-[token]-[quote]_files
, in the above example, the folder is for the pair ETH/USDT on AscendEX exchange. This convention is for specifying which bot to run inbots_to_run
file and letsinit_and_run_bots.sh
script to find the config folder correctly, also it lets you know which exchange the pair is on connectors
is where you store your exchange API keysstrategies
is where you store your strategy config files- The strategy config file
conf_pure_mm_asd-eth-usdt.yml
follows the naming conventionconf_pure_mm_[exchange]-[token]-[quote].yml
hummingbot_conf
is the place to store bot main configuration files and encrypted keyshummingbot_pmm_scripts
is the place to store scripts, this is applicable only for Pure Market Making strategyhummingbot_scripts
is the place to store customized scripts, this is applicable only for the new script strategy available from bot client 1.6.0
To launch bot you will need to specify what bot to run in bots_to_run
file and set environment variables in init_and_run_bots.sh
script, for example, this is the current content of the file:
asd-eth-usdt
bin-bnb-busd
This means only 2 bots (ETH/USDT
and BNB/BUSD
) will be launched.
After specifying bots in bots_to_run
file, please set the following environment variables in init_and_run_bots.sh
, line 48 -> 50, these configurations are required:
export STRATEGY="pure_market_making" # Name of the strategy to auto run
export CONFIG_FILE_NAME="conf_pure_mm_$1.yml" # Name of the config file to auto run, $1 is template for the name of the bots in bots_to_run file
export CONFIG_PASSWORD='password' # Password to access your bot, it is for the login prompt when you first start the bot
ATTENTION:
Please make sure that CONFIG_PASSWORD
is set to your bot access password, without it the script will not be able to launch your bots properly and you will get "invalid password"
error when trying to access the bot.
Then you can run init_and_run_bots.sh
script to launch your bots:
bash init_and_run_bots.sh
The script will do the following steps:
- Stop and remove all current bot instances
- Read
bots_to_run
file to get the list of bots to launch - For each bot in the list, the script create new bot instance and run it, the bot instance will automatically start without any intervention
- There is a slight delay of 30 seconds between bot creation, this is for avoiding getting socket ban from the exchange
Please use this check list to make sure the script run properly:
- Using
development
or bot version higher than 1.7.0 - Setup your bot configurations using the format in
How To Use This
- Make sure that
.password_verification
is existing and valid - Make sure connector files are there
- Make sure your naming convention for bot config folders is correct
- Make sure you have set environment variables in init_and_run_bots.sh, line 48 -> 50, (
STRATEGY
,CONFIG_FILE_NAME
, andCONFIG_PASSWORD
) - Make sure you have rebalanced your bot budget
- Make sure you have tested your bot strategy carefully
- Run
init_and_run_bots.sh
to launch your bots - Verify that all your bots have launched successfully
remove_bots.sh
stop and remove all bot instances, this will not cancel your trade ordersstart.sh
bash script to manually hook into your bot instanceupdate.sh
bash script to manually update bot docker
17 August 2022
: Reworked the folder sturcture, updatedinit_and_run_bots.sh
to support dev-1.7.0 version.5 October 2022
: Edited README.md, added Usage Check List