From 8e99720ce3da628a40a89895734d4d470f718c7d Mon Sep 17 00:00:00 2001 From: Estereg Date: Sat, 21 Feb 2026 08:57:31 +0000 Subject: [PATCH] fix(pumpfun): fix trade event log size mapping Adjusted PUMPFUN_TRADE_EVENT_LOG_SIZE from 274 to 250 bytes in the PumpFun event parser to match the actual IDL structure. This resolves an issue where inner instruction events were not parsed correctly, causing trade fields (amounts, reserves, fees) to appear as zeros. --- src/streaming/event_parser/protocols/pumpfun/events.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/streaming/event_parser/protocols/pumpfun/events.rs b/src/streaming/event_parser/protocols/pumpfun/events.rs index 1c34613..678232c 100755 --- a/src/streaming/event_parser/protocols/pumpfun/events.rs +++ b/src/streaming/event_parser/protocols/pumpfun/events.rs @@ -275,10 +275,10 @@ pub struct PumpFunTradeEvent { } /// Borsh byte length of TradeEvent fixed fields (IDL order; excludes ix_name and following variable part). -/// Layout: mint(32)+sol_amount(8)+token_amount(8)+is_buy(1)+user(32)+timestamp(8)+virtual_sol(8)+virtual_token(8)+real_sol(8)+real_token(8)+fee_recipient(32)+fee_basis_points(8)+fee(8)+creator(32)+creator_fee_bps(8)+creator_fee(8)+track_volume(1)+total_unclaimed(8)+total_claimed(8)+current_sol_volume(8)+last_update_timestamp(8) = 274 -pub const PUMPFUN_TRADE_EVENT_LOG_SIZE: usize = 274; +/// Layout: mint(32)+sol_amount(8)+token_amount(8)+is_buy(1)+user(32)+timestamp(8)+virtual_sol(8)+virtual_token(8)+real_sol(8)+real_token(8)+fee_recipient(32)+fee_basis_points(8)+fee(8)+creator(32)+creator_fee_bps(8)+creator_fee(8)+track_volume(1)+total_unclaimed(8)+total_claimed(8)+current_sol_volume(8)+last_update_timestamp(8) = 250 +pub const PUMPFUN_TRADE_EVENT_LOG_SIZE: usize = 250; -/// Decode TradeEvent log; if data.len() > 274 then parse ix_name, mayhem_mode, cashback (IDL-aligned). +/// Decode TradeEvent log; if data.len() > 250 then parse ix_name, mayhem_mode, cashback (IDL-aligned). pub fn pumpfun_trade_event_log_decode(data: &[u8]) -> Option { if data.len() < PUMPFUN_TRADE_EVENT_LOG_SIZE { return None;