100 Commits
Author SHA1 Message Date
Wood 3fe529ea3b fix: clamp inner_index (i64) to i32 range when computing current_inner_idx
Avoid overflow/truncation when inner_index is outside i32 range in both
gRPC and standard instruction parsing paths.

Made-with: Cursor
2026-03-09 10:31:16 +08:00
Wood 6e5e378247 fix: post-merge robustness - global_state cleanup count, swap bounds, blockhash & i32 index
- 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
2026-03-09 10:23:33 +08:00
Wood adb4cfc52d Merge PR #65: refactor streaming core cleanup and dependency simplification 2026-03-09 10:10:24 +08:00
Wood bdf984f2c1 chore: release v1.3.0
Made-with: Cursor
2026-03-09 00:41:28 +08:00
Wood ba058c53e1 docs: update example table in README/README_CN; add parse/debug/grpc examples (PumpFun, PumpSwap, Meteora DAMM)
Made-with: Cursor
2026-03-08 23:11:11 +08:00
Wood 20a1048020 feat(pumpfun): parse 17th instruction account (account field)
- 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
2026-03-08 11:08:46 +08:00
Wood 2da2b06e1f refactor(events): recent_blockhash as base58 string (same as signature)
- EventMetadata.recent_blockhash: Option<Vec<u8>> -> Option<String>
- Add bs58 dependency; gRPC path: bs58::encode message bytes
- VersionedTransaction path: use Hash::to_string() (base58)
- parse_events_from_grpc_instruction/parse_events_from_instruction: accept Option<&str>

Made-with: Cursor
2026-03-07 20:24:46 +08:00
Wood 63af06edd3 feat(events): add recent_blockhash to EventMetadata
- 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
2026-03-07 16:59:07 +08:00
Wood 7270372604 feat(shred): tx_index, Migrate without CPI, merge fix, doc limits
- 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
2026-03-07 12:35:57 +08:00
Wood 04df6db0b0 fix(pumpfun): add account length check for create_v2 to avoid panic
- Require accounts.len() >= 16 in parse_create_v2_token_instruction
- Require accounts.len() >= 14 in parse_create_token_instruction

Made-with: Cursor
2026-03-07 12:11:50 +08:00
Wood b281a4be52 idl: sync pump_amm; parser account comments; low-latency: sequential inner parse (no thread::scope)
Made-with: Cursor
2026-03-07 11:45:40 +08:00
WoodandCursor a8aa1c7789 Bump version to 1.2.2 in Cargo.toml and README
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 12:56:08 +08:00
WoodandCursor fd2bd0426c chore: add .DS_Store to .gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 02:39:26 +08:00
WoodandCursor fee154e506 chore: bump version to 1.2.1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 02:38:52 +08:00
WoodandCursor 308a1b594e Align PumpFun with IDL and sol-parser-sdk; fix warnings; use English comments
- Sync IDL from sol-parser-sdk (pumpfun, pump_amm, add raydium_amm_v4)
- PumpFun CreateEvent: add is_cashback_enabled to CreateToken/CreateV2, parse in log decode and merge
- PumpFun TradeEvent: add ix_name, mayhem_mode, cashback_fee_basis_points, cashback, is_cashback_coin; fix Borsh size 250->274 for fixed fields; parse extension after 274
- Fix deprecation: enable solana-entry feature agave-unstable-api
- Remove unused import wide::CmpEq in simd_utils
- Replace all Chinese comments in modified code with English

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 00:29:01 +08:00
WoodandClaude Sonnet 4.5 da550e0c3a fix: correct parameter order for buy_exact_sol_in and align Raydium CPMM field names with IDL
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>
2026-01-23 16:47:55 +08:00
WoodandClaude Sonnet 4.5 ce2931046d fix: sync all protocol structures with latest IDL definitions
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>
2026-01-23 15:40:26 +08:00
Wood 77caa39f0c fix warns 2025-10-04 08:44:07 +08:00
William 2a06ebe2c0 remove pumpfun create token 2025-05-21 20:41:00 +08:00
William b5bb229df3 update readme 2025-05-19 14:19:21 +08:00
William fcc4184636 update readme 2025-05-19 14:08:07 +08:00
WilliamandGitHub cddd335962 Merge pull request #5 from Chain-Fox/fix-regex-in-loop
perf: move regex compilation out of loop in RaydiumEvent::parse_logs
2025-05-19 13:46:05 +08:00
William 4198720c51 fix slippage and get_buy_token_amount_from_sol_amount 2025-05-14 22:11:16 +08:00
William 07651638b9 fix 2025-05-13 07:08:01 +08:00
William 3a60969b22 fix pump upgrade 2025-05-13 06:34:57 +08:00
William ee0f18a279 update poll tx status 2025-04-10 12:38:00 +08:00
William 8050d7ea8f rename jito mod 2025-04-10 12:29:42 +08:00
William c7acb32acf remove trade.rs 2025-04-10 11:56:19 +08:00
William 7c755058cc fix create token, add param with creator pubkey 2025-04-10 11:04:55 +08:00
William 1fd3163bf9 remove tonic-build lib 2025-04-09 23:44:14 +08:00
William fb9d47bc80 remove protobuf build 2025-04-09 23:36:51 +08:00
William a46bf4c77e fix duplicate instruction (2) 2025-04-09 21:07:27 +08:00
William d28675f96d update readme 2025-04-09 13:41:16 +08:00
William 351649b517 update readme 2025-04-09 13:38:19 +08:00
William 716611475b update readme 2025-04-09 13:36:15 +08:00
William dfcdf12a7e update readme 2025-04-02 14:25:30 +08:00
William 685ca6bd7e update readme 2025-04-02 14:18:52 +08:00
William d9cd8154b7 fix build errors 2025-04-02 14:08:48 +08:00
William ff877902a7 update readme 2025-04-02 14:03:56 +08:00
William ec03ed8edc add nextblock, 0slot support 2025-04-02 13:39:59 +08:00
William 2dc15b9020 add Arc 2025-02-26 09:56:20 +08:00
William ce06345106 CommitmentConfig 2025-02-26 04:02:49 +08:00
William 83484c12a4 rewrite Clone 2025-02-26 04:01:52 +08:00
William ec0b4e4981 change unit_price, unit_limit to uint 2025-02-21 23:13:28 +08:00
William 12ddfe4dc0 update fee for custructor 2025-02-21 23:02:15 +08:00
William ecb2ffa747 change priority_fee 2025-02-21 22:32:43 +08:00
William 8df2841b17 fix 2025-02-21 21:15:10 +08:00
William d3d2c37ee8 Merge branch 'main' of github.com:MiracleAI-Labs/pumpfun-sdk into main 2025-02-21 20:48:00 +08:00
William f4f3c0fb37 rebuild code 2025-02-21 20:47:28 +08:00
William 87fee74311 Merge branch 'main' of github.com:MiracleAI-Labs/pumpfun-sdk into main 2025-02-21 16:14:48 +08:00
William f2870ddd04 update readme 2025-02-21 16:14:36 +08:00
William a7c94838df add send_transactions 2025-02-16 14:21:42 +08:00
William 38f1ce3fad Refactor the code to optimize performance. 2025-02-15 18:53:17 +08:00
William 7cf908ae5d fix 2025-02-14 18:53:00 +08:00
William b52765683a fix 2025-02-13 23:30:37 +08:00
William 53e1e94da2 fix 2025-02-13 20:44:20 +08:00
William 998d843bac fix 2025-02-13 15:59:14 +08:00
William 39d1d4400d update sell 2025-02-13 15:22:35 +08:00
William d75b368e5e fix 2025-02-13 00:08:14 +08:00
William 705200e538 fix 2025-02-12 23:01:43 +08:00
William fc89e36a37 fix 2025-02-12 22:56:44 +08:00
William 76e4d8f46c debug 2025-02-12 22:53:10 +08:00
William 794b68caa5 debug 2025-02-12 22:50:43 +08:00
William ca00680215 update error 2025-02-12 22:46:09 +08:00
William 2b69bfc2a5 debug 2025-02-12 22:02:19 +08:00
William 61171af619 update jito 2025-02-12 20:12:14 +08:00
William 141318938e fix 2025-02-10 19:58:12 +08:00
William a70c5fec1e add jito fee 2025-02-10 15:20:33 +08:00
William c9d491d5c2 add yellowstone 2025-02-01 09:44:15 +08:00
William 3477e7dc20 update default fee 2025-01-27 11:25:24 +08:00
William 1f67c7d036 set jito fee 2025-01-25 19:45:18 +08:00
William c0528b2007 remove logs 2025-01-25 17:49:52 +08:00
William f19126ac1b fix buy jito 2025-01-25 17:16:52 +08:00
William d36de45264 update rpc commitment 2025-01-25 16:31:11 +08:00
William 9cf4475aab add logs 2025-01-25 16:27:11 +08:00
William cab890a2bb fix logs 2025-01-25 16:24:30 +08:00
William e29e555c8f add logs 2025-01-25 16:21:27 +08:00
William 7bff98eaa5 add log 2025-01-25 16:14:49 +08:00
William a98a63587f set default jito fee 2025-01-25 16:08:53 +08:00
William 858c0e5700 fix jito buy 2025-01-25 16:01:16 +08:00
William be36888e6c fix payer 2025-01-25 15:36:09 +08:00
William b59afd21b8 set const 2025-01-25 13:18:03 +08:00
William 3d3adec767 update client error 2025-01-25 12:41:21 +08:00
William 87810d47bb add close account 2025-01-25 01:04:45 +08:00
William 14b77dbdf4 update events 2025-01-24 14:01:56 +08:00
William 3a6e9b641f add sample code 2025-01-23 21:32:34 +08:00
William a01275367e add callback to subscribe 2025-01-23 21:15:55 +08:00
William 42b7267c2c add yellowstone grpc 2025-01-23 17:48:10 +08:00
William 429fc78ecf add jito transaction 2025-01-14 19:18:48 +08:00
William d634cb357c fix 2025-01-13 18:42:21 +08:00
William 95889975af update readme 2025-01-10 10:56:14 +08:00
William fd16c3eb90 update PriorityFee default 2025-01-09 17:05:17 +08:00
William 06cae8c933 add default PriorityFee 2025-01-09 16:59:05 +08:00
William a0f2358a60 fix 2025-01-09 15:43:21 +08:00
William ea69700ed5 fix buy 2025-01-09 01:21:20 +08:00
William c9f0241de2 fix buy 2025-01-09 00:12:43 +08:00
William 7d2365cd84 fix warnings 2025-01-08 16:33:43 +08:00
William 7882db4b12 fix add tokens_subscribe 2025-01-07 13:18:31 +08:00
William 025978de13 update version 2025-01-03 19:06:17 +08:00
William 5c0b8c87e2 add bot trade 2025-01-03 17:06:19 +08:00