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.
- 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
- 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
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>
PumpFun and PumpSwap have additional buy instruction variants that were not being parsed:
- PumpFun: `buy_exact_sol_in` (discriminator: [56, 252, 116, 8, 158, 223, 205, 95])
- PumpSwap: `buy_exact_quote_in` (discriminator: [198, 46, 21, 82, 180, 217, 232, 112])
These discriminators are from the official PumpFun IDL:
https://github.com/pump-fun/pump-public-docs/tree/main/idl
Without this fix, approximately 4-5% of trades were being missed.
- Replace instance-based EventParser with static method design
- Introduce ParserCache module for protocol config caching
- Simplify EventProcessor to pure functional handlers
- Optimize metrics: remove min/max tracking, keep last + avg only
- Reduce atomic operations in hot path for better performance
- Convert UnifiedEvent from trait object (Box<dyn UnifiedEvent>) to concrete enum type
- Remove match_event! macro in favor of native match expressions
- Simplify event metadata access: event.event_type() -> event.metadata().event_type
- Unify event callback signatures: Fn(Box<dyn UnifiedEvent>) -> Fn(UnifiedEvent)
- Update all example code to use the new enum-based event system
- Optimize type system to reduce runtime overhead and improve type safety
Affected scope:
- Core event parser and processor
- All protocol event definitions (PumpFun, PumpSwap, Bonk, Raydium series, etc.)
- gRPC and Shred streaming modules
- All example code
- Add requires_inner_instruction field to GenericEventParseConfig
- Skip events that require but lack inner instruction data during processing
- Set PumpFun migrate events to require inner instructions (prevents parsing failed migrations)
- Add account event parser (account_event_parser.rs) for account-level event handling
- Introduce type definitions for pumpfun, pumpswap, raydium_amm_v4, raydium_clmm, raydium_cpmm protocols
- Enhance event processor to support account event processing alongside transactions
- Improve subscription system with separate transaction and account filters
- Optimize parser configuration using Option types for cleaner code structure
- Update examples and documentation to reflect new capabilities
Changes include:
- 6 new types.rs files for protocol-specific data structures
- Updated event processor for account, transaction, and block meta events
- Refactored subscription manager with account filtering support
- Enhanced metrics and batch processing logic
- Refactor streaming architecture with modular grpc components
- Add batch processing system with backpressure strategies
- Implement performance monitoring and metrics collection
- Add multi-protocol parser with block metadata support
- Enhance configuration system with preset profiles
- Add parse_tx_events example and update documentation
- Optimize yellowstone_grpc client complexity
- Bump version to 0.1.11
- Upgrade Solana deps to 2.3.x, yellowstone-grpc to 8.0.0
- Fix inner instruction indexing and timestamp handling
- Improve PumpFun/PumpSwap parser program ID support
- Bump version from 0.1.7 to 0.1.8
- Update version references in README.md and README_CN.md
- Add global_volume_accumulator and user_volume_accumulator fields to PumpFunTradeEvent
- Fix account index mapping in trade parser (creator_vault index adjusted from 8 to 9)
This update introduces volume accumulator support for PumpFun protocol event parsing,
aligning with the latest protocol account structure changes.
This update includes the following improvements:
- Version upgraded to 0.1.5
- Added subscribe_events_v2 API with more granular account filtering
- Marked original subscribe_events API as deprecated
- Fixed bug