From 4bf1099d7064844e55e5f6ef99a122af36f73346 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 12 Jul 2024 14:44:51 -0400 Subject: [PATCH] removed unneeded delay and resample for the final loop --- bot-seller.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bot-seller.py b/bot-seller.py index d9d174c..5e9bbb1 100755 --- a/bot-seller.py +++ b/bot-seller.py @@ -111,15 +111,13 @@ while True: logging.warning("No estimated swap result from RPC") break # delay if amounts remain in the list - if i <= len(selling_amounts): + if i < len(selling_amounts): logging.info("Waiting for {} seconds...".format(loop_sell_delay)) time.sleep(loop_sell_delay) - else: - break - # resample the prices - pdai_sample_result = sample_exchange_rate('PulseX_v2', pdai_address, wpls_address) - pusdc_sample_result = sample_exchange_rate('PulseX_v2', pusdc_address, wpls_address) - affection_sample_result = sample_exchange_rate('PulseX_v2', affection_address, wpls_address) + # resample the prices + pdai_sample_result = sample_exchange_rate('PulseX_v2', pdai_address, wpls_address) + pusdc_sample_result = sample_exchange_rate('PulseX_v2', pusdc_address, wpls_address) + affection_sample_result = sample_exchange_rate('PulseX_v2', affection_address, wpls_address) else: logging.info("AFFECTION™ price is not within targeted range for selling") break