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>
This commit fixes multiple critical issues found when comparing SDK structures
with the official IDL repository (https://github.com/0xfnzero/solana-program-idls):
1. PumpSwap GlobalConfig
- Add missing reserved_fee_recipients: [Pubkey; 7] field
- Update GLOBAL_CONFIG_SIZE constant
2. PumpFun Global
- Add missing reserved_fee_recipients: [Pubkey; 7] field
- Update GLOBAL_SIZE constant
3. Raydium CPMM AmmConfig
- Add missing creator_fee_rate: u64 field
- Adjust padding from [u64; 16] to [u64; 15]
4. Raydium CPMM PoolState
- Add creator_fee_on: u8 field
- Add enable_creator_fee: bool field
- Add padding1: [u8; 6] field
- Add creator_fees_token_0: u64 field
- Add creator_fees_token_1: u64 field
- Adjust padding from [u64; 31] to [u64; 28]
5. Bonk (Raydium Launchpad) PoolState
- Add AmmCreatorFeeOn enum with borsh discriminant support
- Add token_program_flag: u8 field
- Add amm_creator_fee_on: AmmCreatorFeeOn field
- Add platform_vesting_share: u64 field
- Fix padding from [u64; 8] to [u8; 54] with serde_big_array
- Update POOL_STATE_SIZE constant
6. Bonk (Raydium Launchpad) PlatformConfig
- Add BondingCurveParam and PlatformCurveParam structures
- Fix name from Vec<u8> to [u8; 64] with serde_big_array
- Fix web from Vec<u8> to [u8; 256] with serde_big_array
- Fix img from Vec<u8> to [u8; 256] with serde_big_array
- Add cpswap_config: Pubkey field
- Add creator_fee_rate: u64 field
- Add transfer_fee_extension_auth: Pubkey field
- Add platform_vesting_wallet: Pubkey field
- Add platform_vesting_scale: u64 field
- Add platform_cp_creator: Pubkey field
- Fix padding from Vec<u8> to [u8; 108] with serde_big_array
- Add curve_params: Vec<PlatformCurveParam> field
- Update PLATFORM_CONFIG_SIZE constant
7. PumpSwap buy_exact_quote_in parameter order bug
- Create separate parse_buy_exact_quote_in_instruction function
- Fix parameter parsing order: spendable_quote_in (SOL) first, then min_base_amount_out (token)
- Previous bug: buy_exact_quote_in incorrectly reused parse_buy_instruction which has reversed parameter order
- Add detailed comments explaining the parameter order difference
All changes have been verified against the official IDL files and compile successfully.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When building examples, the linker fails with multiple definition of entrypoint error because both spl-token and spl-token-2022 define the entrypoint() function by default.
Error:
error: ld returned 1 exit status
multiple definition of 'entrypoint'
spl_token-*.rlib: previous definition here
This SDK is an off-chain client library, not an on-chain program deployed to validators. The entrypoint() function is only needed for on-chain Solana programs. Client libraries only need the types and structs for parsing account data.
Fix: Add no-entrypoint feature to exclude the entrypoint symbol from compilation.
Before:
spl-token = "9.0.0"
spl-token-2022 = "10.0.0"
After:
spl-token = { version = "9.0.0", default-features = false, features = ["no-entrypoint"] }
spl-token-2022 = { version = "10.0.0", default-features = false, features = ["no-entrypoint"] }
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.
- Upgrade Solana dependencies from 3.0.0 to 3.1.4
- Upgrade solana-hash to 4.0.1
- Update spl-token and spl-token-2022 to latest versions
- Update other dependencies (yellowstone-grpc, rustls, wide, etc.)
- Fix wide library API changes: replace cmp_eq() with simd_eq()
Update package version from 1.1.4 to 1.1.5 in Cargo.toml and documentation.
This release includes recent improvements from merged pull requests:
- Increase minimum accounts check from 11 to 13 for PumpSwap parser
- Refactor event parser core implementation
Add support for parsing SetComputeUnitLimit and SetComputeUnitPrice instructions from Solana's Compute Budget Program. Update event parser to handle compute budget instructions and bump version to 1.1.3.
- 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