Architecture of trading bot - LabMazurokCom/Blockchain GitHub Wiki

  • If arbitrage was not fully successful and sum of disbalance greater than some EPS, we have to rebalance our currency amounts by buying lack currency for best available price (maybe on several exchanges, using market orders).

  • Field "wait" in configuration file for order cancelling if not executed. To cancel order immediately set 0.

  • Check if orders are correct after finishing matching. If order is not correct, ignore it.

  • How to re-count amount and profit depending on non-correct orders?

  • What to write into database - all the pairs, pair with maximal profit?

  • Fees and available balance ?!

Structure of main.py:

Start

  1. open bot_config.json
  2. get numer of top orders to be considered
  3. get list of pairs to be monitored
  4. open orders_config.json
  5. get exchanges' API credentials
  6. get minimum volumes for each exchange

while loop

  1. get current balances
  2. form GET requests, send them and fetch results
  3. form huge order book with fees
  4. form our_orders for each pair
  5. choose best pair
  6. pass our_orders to trading module