From 37bc6bb0867ec5a6122568d0fcd12274456196dc Mon Sep 17 00:00:00 2001 From: "Dobromir Popov (aider)" Date: Sun, 20 Oct 2024 14:30:17 +0300 Subject: [PATCH] feat: log successful swap details with accounting information in follow_move function --- crypto/sol/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crypto/sol/app.py b/crypto/sol/app.py index ffa78b5..bfea308 100644 --- a/crypto/sol/app.py +++ b/crypto/sol/app.py @@ -1223,6 +1223,11 @@ async def follow_move(move): ) logging.info(notification) await send_telegram_message(notification) + + # Log successful swap details + success_logger_accounting_csv.info( + f"{move['symbol_in']},{move['symbol_out']},{amount_to_swap:.6f},{tx_details['amount_out']:.6f},{move['amount_in_USD']:.2f},{tx_details['amount_out_USD']:.2f},{move['percentage_swapped']:.2f}" + ) except Exception as e: logging.error(f"Error sending notification: {e}") @@ -1473,4 +1478,4 @@ async def run_all(): ) if __name__ == '__main__': - asyncio.run(run_all()) \ No newline at end of file + asyncio.run(run_all())