From 2e64ec1ac7ed88f1bb1720d8b4eb2e0b5d7f465c Mon Sep 17 00:00:00 2001 From: barak manos <> Date: Sat, 25 May 2024 13:03:59 +0300 Subject: [PATCH] Cleanup --- fastlane_bot/bot.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/fastlane_bot/bot.py b/fastlane_bot/bot.py index e7a18b2b8..9d712e177 100644 --- a/fastlane_bot/bot.py +++ b/fastlane_bot/bot.py @@ -475,7 +475,7 @@ def _handle_trade_instructions( ) return None, None - # Log the calculated arbitrage + # Log the arbitrage details arb_info = [ f"arb mode = {arb_mode}", f"gas profit = {num_format(best_profit_gastkn)}", @@ -494,16 +494,15 @@ def _handle_trade_instructions( } for trade in calculated_trade_instructions ] - self.ConfigObj.logger.info( - "\n".join( - [ - "[bot._handle_trade_instructions] calculated arbitrage:", - *[f"- {line}" for line in arb_info], - "- trade instructions:", - *[f" {index + 1}. {line}" for index, line in enumerate(arb_ti_info)] - ] - ) + arb_details = "\n".join( + [ + "arbitrage details:", + *[f"- {line}" for line in arb_info], + "- trade instructions:", + *[f" {index + 1}. {line}" for index, line in enumerate(arb_ti_info)] + ] ) + self.ConfigObj.logger.info(f"[bot._handle_trade_instructions] {arb_details}") # Split Carbon Orders split_calculated_trade_instructions = split_carbon_trades( @@ -551,7 +550,7 @@ def _handle_trade_instructions( ) # Validate and submit the transaction - return self.tx_helpers.validate_and_submit_transaction( + tx_hash, tx_receipt = self.tx_helpers.validate_and_submit_transaction( route_struct=route_struct_processed, src_amt=flashloan_amount_wei, src_address=fl_token, @@ -559,3 +558,5 @@ def _handle_trade_instructions( expected_profit_usd=best_profit_usd, flashloan_struct=flashloan_struct, ) + + return tx_hash, tx_receipt