Bot (General Description) - LabMazurokCom/Blockchain GitHub Wiki

Bot monitors the arbitrage opportunities for given list of pairs among given exchanges, chooses the best opportunity, generates list of orders which allow to get profit and sends this orders to corresponding exchanges.

  • bot_config.json is the main configuration file. It specifies bot parameters:

    • limit (how many top orders to take from each exchange's order books)
    • config_file (technical details of interaction with exchnges' API)
    • exchs_credentials (API keys required to perform trading actions on exchanges)
    • pairs (list of currency pairs to be monitored)
  • main.py is the file used to run bot. Here all configuration details are fetched (including list of exchanges, minimum allowed order volume and current balance for each exchange). Reinitialization is performed once in 100 iterations of the main loop to prevent such problems as:

    • some exchange can not respond during the first initialization but work fine later, reinitialization allows this exchange to be monitored even if it was not possible when the program started

    Main loop:

    • performs reinitialization once in 100 iterations
    • gets current balances for all exchanges
    • computes total balance for each monitored currency (as sum of balances among all exchanges)
    • gets order books for each monitored pair
    • generates arbitrage orders and estimate profit for each trading pair
    • chooses best arbitrage opportunity
    • makes chosen orders
    • sleeps for 30 seconds to prevent exceeding of API request limits