From 984f43b757fcf6ec8ee8efca71f247eea6289cd3 Mon Sep 17 00:00:00 2001 From: smypmsa Date: Sun, 15 Jun 2025 20:12:54 +0000 Subject: [PATCH] fix: remove coderabbit syntax bugs --- bots/bot-sniper-1-geyser.yaml | 2 +- bots/bot-sniper-2-logs.yaml | 14 +++++++------- src/trading/buyer.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bots/bot-sniper-1-geyser.yaml b/bots/bot-sniper-1-geyser.yaml index 9e5b3b7..4fc13aa 100644 --- a/bots/bot-sniper-1-geyser.yaml +++ b/bots/bot-sniper-1-geyser.yaml @@ -8,7 +8,7 @@ rpc_endpoint: "${SOLANA_NODE_RPC_ENDPOINT}" wss_endpoint: "${SOLANA_NODE_WSS_ENDPOINT}" private_key: "${SOLANA_PRIVATE_KEY}" -enabled: true # You can turn off the bot w/o removing its config +enabled: false # You can turn off the bot w/o removing its config separate_process: true # Geyser configuration (fastest method for getting updates) diff --git a/bots/bot-sniper-2-logs.yaml b/bots/bot-sniper-2-logs.yaml index 3f3a7e3..d9e2e1c 100644 --- a/bots/bot-sniper-2-logs.yaml +++ b/bots/bot-sniper-2-logs.yaml @@ -8,7 +8,7 @@ rpc_endpoint: "${SOLANA_NODE_RPC_ENDPOINT}" wss_endpoint: "${SOLANA_NODE_WSS_ENDPOINT}" private_key: "${SOLANA_PRIVATE_KEY}" -enabled: false # You can turn off the bot w/o removing its config +enabled: true # You can turn off the bot w/o removing its config separate_process: true # Geyser configuration (fastest method for getting updates) @@ -21,15 +21,15 @@ geyser: # Control trade execution: amount of SOL per trade and acceptable price deviation trade: buy_amount: 0.0001 # Amount of SOL to spend when buying (in SOL) - buy_slippage: 0.3 # Maximum acceptable price deviation (0.3 = 30%) + buy_slippage: 0.2 # Maximum acceptable price deviation (0.2 = 20%) sell_slippage: 0.3 # Exit strategy configuration - exit_strategy: "time_based" # Options: "time_based", "tp_sl", "manual" - #take_profit_percentage: 0.1 # Take profit at 10% gain (0.1 = 10%) - #stop_loss_percentage: 0.1 # Stop loss at 10% loss (0.1 = 10%) - max_hold_time: 15 # Maximum hold time in seconds - #price_check_interval: 2 # Check price every 2 seconds + exit_strategy: "tp_sl" # Options: "time_based", "tp_sl", "manual" + take_profit_percentage: 0.2 # Take profit at 20% gain (0.2 = 20%) + stop_loss_percentage: 0.2 # Stop loss at 20% loss (0.2 = 20%) + max_hold_time: 60 # Maximum hold time in seconds + price_check_interval: 2 # Check price every 2 seconds # EXTREME FAST mode configuration # When enabled, skips waiting for the bonding curve to stabilize and RPC price check. diff --git a/src/trading/buyer.py b/src/trading/buyer.py index b4d4501..54266e2 100644 --- a/src/trading/buyer.py +++ b/src/trading/buyer.py @@ -282,9 +282,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 + 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