diff --git a/main.py b/main.py index 56af142..627279a 100644 --- a/main.py +++ b/main.py @@ -311,40 +311,18 @@ def main_loop(): futures.append(future) online_pairs.append(f"{instance.base}{instance.quote}") pairs_to_fetch.append(instance.config.get_pair()) - + + #Fetch prices + price_list = broker.get_prices(pairs_to_fetch) + #Here, assign the prices to the dusters (if any) + + for future in as_completed(futures): try: future.result() except Exception as e: broker.logger.log_this(f"Error in thread - {e}") - - #Here, append the dusters' pairs to pairs_to_fetch, if missing. - # - # - # - # - # - - #Start the trader threads - # for t in threads: - # try: - # t.start() - # except Exception as e: - # broker.logger.log_this(f"Error starting thread - {e}") - - # #Wait for the trader threads to complete - # for t in threads: - # try: - # t.join() - # except Exception as e: - # broker.logger.log_this(f"Error joining thread: {e}") - # threads.clear() - #Fetch prices - price_list = broker.get_prices(pairs_to_fetch) - - #Here, assign the prices to the dusters (if any) - curr = 0 top = 0 for instance in running_traders: