mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-16 16:58:04 +00:00
Update src/trading/buyer.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent
8f8fa2a526
commit
ec1c3afae4
@@ -280,6 +280,9 @@ class TokenBuyer(Trader):
|
|||||||
logger.warning(f"Failed to get actual execution price from bonding curve: {e}")
|
logger.warning(f"Failed to get actual execution price from bonding curve: {e}")
|
||||||
# Fallback to EXTREME_FAST estimate
|
# 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)
|
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
|
return self.amount / tokens_received, tokens_received
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user