diff --git a/bots/bot-sniper-1-geyser.yaml b/bots/bot-sniper-1-geyser.yaml index 0772916..cceb543 100644 --- a/bots/bot-sniper-1-geyser.yaml +++ b/bots/bot-sniper-1-geyser.yaml @@ -63,7 +63,7 @@ compute_units: # Note: Savings don't show in "consumed CU" but improve tx priority/cost. # Note (Nov 23, 2025): with data size set to 512KB, transactions fail - increasing to 12.5MB resolves the issue. # Reference: https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit - account_data_size: 12_500_000 + # account_data_size: 12_500_000 # Disabled: causes MaxLoadedAccountsDataSizeExceeded with Token-2022 # Filters for token selection filters: diff --git a/bots/bot-sniper-2-logs.yaml b/bots/bot-sniper-2-logs.yaml index 7f4c0b6..e7113cc 100644 --- a/bots/bot-sniper-2-logs.yaml +++ b/bots/bot-sniper-2-logs.yaml @@ -63,7 +63,7 @@ compute_units: # Note: Savings don't show in "consumed CU" but improve tx priority/cost. # Note (Nov 23, 2025): with data size set to 512KB, transactions fail - increasing to 12.5MB resolves the issue. # Reference: https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit - account_data_size: 12_500_000 + # account_data_size: 12_500_000 # Disabled: causes MaxLoadedAccountsDataSizeExceeded with Token-2022 # Filters for token selection filters: diff --git a/bots/bot-sniper-3-blocks.yaml b/bots/bot-sniper-3-blocks.yaml index 96e4525..ba35a07 100644 --- a/bots/bot-sniper-3-blocks.yaml +++ b/bots/bot-sniper-3-blocks.yaml @@ -63,7 +63,7 @@ compute_units: # Note: Savings don't show in "consumed CU" but improve tx priority/cost. # Note (Nov 23, 2025): with data size set to 512KB, transactions fail - increasing to 12.5MB resolves the issue. # Reference: https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit - account_data_size: 12_500_000 + # account_data_size: 12_500_000 # Disabled: causes MaxLoadedAccountsDataSizeExceeded with Token-2022 # Filters for token selection filters: diff --git a/bots/bot-sniper-4-pp.yaml b/bots/bot-sniper-4-pp.yaml index cc1f6d8..8c0498d 100644 --- a/bots/bot-sniper-4-pp.yaml +++ b/bots/bot-sniper-4-pp.yaml @@ -61,7 +61,7 @@ compute_units: # Note: Savings don't show in "consumed CU" but improve tx priority/cost. # Note (Nov 23, 2025): with data size set to 512KB, transactions fail - increasing to 12.5MB resolves the issue. # Reference: https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit - account_data_size: 12_500_000 + # account_data_size: 12_500_000 # Disabled: causes MaxLoadedAccountsDataSizeExceeded with Token-2022 # Filters for token selection filters: diff --git a/src/core/client.py b/src/core/client.py index 526f735..ab8e9d4 100644 --- a/src/core/client.py +++ b/src/core/client.py @@ -280,14 +280,18 @@ async def build_and_send_transaction( async def confirm_transaction( self, signature: str, commitment: str = "confirmed" ) -> bool: - """Wait for transaction confirmation. + """Wait for transaction confirmation and verify execution success. + + Confirms the transaction landed on-chain, then checks meta.err to + ensure the inner program instructions actually succeeded. A transaction + can be "confirmed" (included in a block) but still fail execution. Args: signature: Transaction signature commitment: Confirmation commitment level Returns: - Whether transaction was confirmed + Whether transaction was confirmed AND executed successfully """ await self._rate_limiter.acquire() client = await self.get_client() @@ -295,11 +299,28 @@ async def confirm_transaction( await client.confirm_transaction( signature, commitment=commitment, sleep_seconds=1 ) - return True except Exception: logger.exception(f"Failed to confirm transaction {signature}") return False + # Verify the transaction actually succeeded (no program errors) + result = await self._get_transaction_result(str(signature)) + if not result: + logger.warning( + f"Could not fetch transaction {str(signature)[:16]}... " + f"to verify execution — treating as unconfirmed" + ) + return False + + tx_err = result.get("meta", {}).get("err") + if tx_err: + logger.error( + f"Transaction {str(signature)[:16]}... confirmed but failed: {tx_err}" + ) + return False + + return True + async def get_transaction_token_balance( self, signature: str, user_pubkey: Pubkey, mint: Pubkey ) -> int | None: @@ -354,6 +375,15 @@ async def get_buy_transaction_details( return None, None meta = result.get("meta", {}) + + # Check for transaction execution errors (e.g., MaxLoadedAccountsDataSizeExceeded) + tx_err = meta.get("err") + if tx_err: + logger.error( + f"Transaction {signature[:16]}... failed with error: {tx_err}" + ) + return None, None + mint_str = str(mint) # Get tokens received from pre/post token balance diff diff --git a/src/trading/platform_aware.py b/src/trading/platform_aware.py index 8f616ad..58350c8 100644 --- a/src/trading/platform_aware.py +++ b/src/trading/platform_aware.py @@ -156,7 +156,8 @@ async def execute(self, token_info: TokenInfo) -> TradeResult: else: raise ValueError( f"Failed to parse transaction details: tokens={tokens_raw}, " - f"sol_spent={sol_spent}" + f"sol_spent={sol_spent} (tx: {tx_signature}). " + f"The transaction may have failed on-chain — check explorer." ) return TradeResult(