From a36fab735277c1eff1510f5f358ec919e8c72349 Mon Sep 17 00:00:00 2001 From: smypmsa Date: Tue, 29 Apr 2025 11:56:55 +0000 Subject: [PATCH] fix: comments, minor fixes --- bots/bot-sniper-1-geyser.yaml | 2 +- bots/bot-sniper-2-logs.yaml | 2 +- src/config_loader.py | 4 ++-- src/core/client.py | 2 +- src/trading/buyer.py | 2 +- src/trading/trader.py | 4 +++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bots/bot-sniper-1-geyser.yaml b/bots/bot-sniper-1-geyser.yaml index 432a69e..65b38c2 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 a078df7..08c24b2 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) diff --git a/src/config_loader.py b/src/config_loader.py index 65b80f3..15be4a5 100644 --- a/src/config_loader.py +++ b/src/config_loader.py @@ -50,10 +50,10 @@ def load_bot_config(path: str) -> dict: if env_file: env_path = os.path.join(os.path.dirname(path), env_file) if os.path.exists(env_path): - load_dotenv(env_path) + load_dotenv(env_path, override=True) else: # If not found relative to config, try relative to current working directory - load_dotenv(env_file) + load_dotenv(env_file, override=True) resolve_env_vars(config) validate_config(config) diff --git a/src/core/client.py b/src/core/client.py index 786d4b6..5868d4d 100644 --- a/src/core/client.py +++ b/src/core/client.py @@ -163,7 +163,7 @@ class SolanaClient: # Add priority fee instructions if applicable if priority_fee is not None: fee_instructions = [ - set_compute_unit_limit(70_000), # Default compute unit limit + set_compute_unit_limit(72_000), # Default compute unit limit set_compute_unit_price(priority_fee), ] instructions = fee_instructions + instructions diff --git a/src/trading/buyer.py b/src/trading/buyer.py index 7047d3f..c0b2a2b 100644 --- a/src/trading/buyer.py +++ b/src/trading/buyer.py @@ -82,7 +82,7 @@ class TokenBuyer(Trader): # Skip the wait and directly calculate the amount token_amount = self.extreme_fast_token_amount token_price_sol = self.amount / token_amount - logger.info(f"EXTREME FAST Mode: Buying {token_amount} tokens.") + #logger.info(f"EXTREME FAST Mode: Buying {token_amount} tokens.") else: # Regular behavior with RPC call curve_state = await self.curve_manager.get_curve_state(token_info.bonding_curve) diff --git a/src/trading/trader.py b/src/trading/trader.py index 8dcdd50..0b28334 100644 --- a/src/trading/trader.py +++ b/src/trading/trader.py @@ -9,6 +9,7 @@ import os from datetime import datetime from time import monotonic +import uvloop from solders.pubkey import Pubkey from cleanup.modes import ( @@ -29,6 +30,8 @@ from trading.buyer import TokenBuyer from trading.seller import TokenSeller from utils.logger import get_logger +asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) + logger = get_logger(__name__) @@ -357,7 +360,6 @@ class PumpTrader: logger.info( f"Skipping token {token_info.symbol} - too old ({token_age:.1f}s > {self.max_token_age}s)" ) - #self.token_queue.task_done() continue self.processed_tokens.add(token_key)