Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
barak manos committed May 25, 2024
1 parent 93abd1d commit 2e64ec1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions fastlane_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}",
Expand All @@ -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(
Expand Down Expand Up @@ -551,11 +550,13 @@ 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,
expected_profit_gastkn=best_profit_gastkn,
expected_profit_usd=best_profit_usd,
flashloan_struct=flashloan_struct,
)

return tx_hash, tx_receipt

0 comments on commit 2e64ec1

Please sign in to comment.