clear active_subscription when the yellowstone stream task exits or subscribe fails, so callers are not stuck on "already subscribed" after a disconnect.
replace unwrap/expect in grpc pool parsing with validation and skip malformed account or transaction updates instead of panicking the whole stream.
Route gRPC, ShredStream, and account parsing through sol-parser-sdk.
Remove local protocol parsing implementations.
Depend on sol-parser-sdk v0.4.8 from crates.io.
- Extend on-chain Pool layout (is_cashback_coin, 7-byte reserved, 244 bytes)
with backward-compatible decode for 236-byte legacy accounts
- Decode Buy/Sell program logs manually: min_base_amount_out, ix_name,
cashback fields; optional sell cashback when payload >= 368 bytes
- Set ix_name on buy / buy_exact_quote_in instructions; merge new fields
in CPI log merger
- Add read_i64_le helper and pool layout unit test
Made-with: Cursor
- global_state: only decrement signature_count when remove() actually removed entry
- types: bounds-check program_id_index and account indices in swap extraction
- types: require data.len() >= 9/12 before slicing token instruction data
- types: use i32 for current_index and safe skip count to avoid i8 truncation/UB
- event_parser: encode recent_blockhash only when len() == 32; pass i32 to swap parsers
Made-with: Cursor
- Remove standalone bs58 dependency and rely on the solana_sdk re-export
- Switch system and token program IDs to the idiomatic spl_token / solana_sdk constants
- Use pubkey! and LazyLock for cleaner program ID initialization
- Alias solana_entry::Entry as SolanaEntry to avoid a naming conflict with gRPC types
- Remove unused FromStr imports and some redundant logic
- Add PumpFunTradeEvent.account: Option<Pubkey> for the 17th instruction
account (index 16), labeled as 'Account' on block explorers.
- Fill account in parse_buy_instruction, parse_buy_exact_sol_in_instruction,
and parse_sell_instruction when accounts.get(16) is present.
- Merge account from CPI log event into instruction event when merging.
Made-with: Cursor
- EventMetadata: add recent_blockhash (Option<Vec<u8>>)
- gRPC path: extract from message.recent_blockhash, thread through parse_instruction_events_from_grpc_transaction and parse_events_from_grpc_instruction
- VersionedTransaction path: get from message.recent_blockhash(), pass into parse_events_from_instruction
- BlockMeta event: pass None for recent_blockhash
Made-with: Cursor
- Remove 'wide' and 'simd_utils.rs', rely on compiler auto-vectorization.
- Deduplicate swap parsing in 'types.rs' and 'merger_event.rs' using generic traits and local macros.
- Improve signature cleanup in 'global_state.rs' to avoid large heap allocations.
- Replace manual metadata accessors in 'traits.rs' with a macro for all variants.
- Remove unused types (ParseResult, ProtocolInfo) and legacy commented code.
- Fix Clippy lints (is_empty, copied) and restore missing trait imports.
- Add tx_index to TransactionWithSlot (entry index), pass to parser
- Emit PumpFun Migrate even when no CPI (shred gets instruction-only)
- Merge: only overwrite Create/CreateV2 with CPI when value non-default
- Rename transaction_index -> tx_index across codebase
- Add docs/SHREDSTREAM_LIMITATIONS.md (ALT/CPI limits, field completeness)
- Comment shred path: static_account_keys only, no inner_instructions
Made-with: Cursor
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.
This commit addresses two critical issues:
1. PumpFun buy_exact_sol_in Parameter Order Fix
- Fixed incorrect parameter parsing in buy_exact_sol_in instruction
- Created dedicated parse_buy_exact_sol_in_instruction function
- Correct order: spendable_sol_in (SOL) first, min_tokens_out (token) second
- Previous bug: reused parse_buy_instruction which has reversed order
- Impact: Fixes ~4-5% of PumpFun trades that were being parsed incorrectly
- Issue reported by community: SOL and token amounts were swapped
2. Raydium CPMM Field Naming Alignment
- Updated PoolState struct field names to match IDL specification exactly
- Changed token0_vault -> token_0_vault (and similar for all token fields)
- Changed mint0_decimals -> mint_0_decimals
- Changed protocol_fees_token0 -> protocol_fees_token_0
- Ensures consistency with official IDL from solana-program-idls repo
- Improves code maintainability and readability
3. IDL Files Sync
- Added latest IDL files from https://github.com/0xfnzero/solana-program-idls
- Includes: pumpfun, pump_amm, raydium_cpmm, raydium_clmm, raydium_pool_v4
- Also added: meteora_amm, meteora_damm_v2, meteora_dlmm, orca_whirlpool, raydium_launchpad
- All IDL files stored in idl/ directory for reference
Files Modified:
- src/streaming/event_parser/protocols/pumpfun/parser.rs
- src/streaming/event_parser/protocols/raydium_cpmm/types.rs
- src/streaming/event_parser/protocols/raydium_cpmm/events.rs
- src/streaming/event_parser/protocols/raydium_cpmm/parser.rs
Testing:
- ✅ Compiles successfully (cargo build --release)
- ✅ All field name updates verified
- ✅ Parameter order matches IDL specification
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>