From 2ad0f37912fcfddc2e7ae46a7719e7ac3d5c637a Mon Sep 17 00:00:00 2001 From: Anton <43762166+smypmsa@users.noreply.github.com> Date: Sun, 15 Jun 2025 21:28:23 +0200 Subject: [PATCH] Update src/trading/buyer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/trading/buyer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trading/buyer.py b/src/trading/buyer.py index fce23cc..b4d4501 100644 --- a/src/trading/buyer.py +++ b/src/trading/buyer.py @@ -268,6 +268,8 @@ class TokenBuyer(Trader): tokens_received = await self._get_tokens_received_from_tx(tx_response, token_info) + if tokens_received == 0: + raise ValueError("Cannot compute execution price: zero tokens received") actual_price = sol_sent_to_curve / tokens_received logger.info(f"Bonding curve received: {sol_sent_to_curve:.6f} SOL")