From ec1c3afae4718466bd20690e748655ebb0a54bc9 Mon Sep 17 00:00:00 2001 From: Anton <43762166+smypmsa@users.noreply.github.com> Date: Sun, 15 Jun 2025 21:28:03 +0200 Subject: [PATCH] Update src/trading/buyer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/trading/buyer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/trading/buyer.py b/src/trading/buyer.py index f40a2cb..fce23cc 100644 --- a/src/trading/buyer.py +++ b/src/trading/buyer.py @@ -280,6 +280,9 @@ class TokenBuyer(Trader): logger.warning(f"Failed to get actual execution price from bonding curve: {e}") # Fallback to EXTREME_FAST estimate tokens_received = self.extreme_fast_token_amount if self.extreme_fast_mode else self.amount / await self.curve_manager.calculate_price(token_info.bonding_curve) ++ if tokens_received == 0: ++ logger.error("Fallback failed – unable to determine tokens received") ++ return 0.0, 0.0 return self.amount / tokens_received, tokens_received