Commit Graph

251 Commits

Author SHA1 Message Date
Wood fee154e506 chore: bump version to 1.2.1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 02:38:52 +08:00
Wood 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
Wood 573cbf8a72 Create context7.json 2026-02-09 06:57:18 +08:00
ysq c9364c7eee chore: bump version to 1.2.0 v1.2.0 2026-01-27 22:23:58 +08:00
Wood 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
Wood 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 6969d15f08 Merge pull request #60 from OpenMindTeh/patch-1
fix: add no-entrypoint feature to spl-token dependencies.
2026-01-13 18:02:53 +08:00
OpenMindTeh 2931373ff5 fix: add no-entrypoint feature to spl-token dependencies to resolve linker conflict
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"] }
2026-01-13 12:48:40 +03:00
Wood 9ae5be36fd Merge pull request #59 from HelvetiCrypt/feat/add-exact-buy-instructions
feat: Add support for buy_exact_sol_in and buy_exact_quote_in instructions
2026-01-09 03:13:21 +08:00
vibes ed8831cc8a feat: Add support for buy_exact_sol_in and buy_exact_quote_in instructions
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.
2026-01-06 10:14:06 +00:00
ysq da4f8f8423 chore: bump version to 1.1.6 2025-12-14 20:59:23 +08:00
ysq 8cc5b7083b chore(deps): upgrade Solana and SIMD dependencies to latest versions
- 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()
2025-12-14 19:16:03 +08:00
ysq 0e0874bb8a Merge commit 'cfc0d48b5c63b9d9a25230fbe57d1c270a4e82b5' 2025-12-14 16:32:47 +08:00
sgxiang cfc0d48b5c Merge pull request #55 from Estereg/main
fix: correct CPI log merging for multiple swaps in single transaction
2025-12-14 16:25:17 +08:00
ysq a9376c4906 Merge commit 'cb09d0a08dc9dc0fd8be81b6eb03376d83a03d7a' 2025-12-14 16:16:08 +08:00
Estereg 15fdc8d93c Merge pull request #2 from Estereg/revert-1-feat/dlmm_account
Revert "Feat/dlmm account"
2025-12-09 21:22:40 -03:00
Estereg 8659d5eb96 Revert "Feat/dlmm account" 2025-12-09 21:22:21 -03:00
Estereg 687aade6aa Merge pull request #1 from 0xfnzero/feat/dlmm_account
Feat/dlmm account
2025-12-09 20:19:43 -03:00
Estereg dc7df2ddac Update event_parser.rs 2025-12-09 00:12:50 -03:00
sgxiang cb09d0a08d Merge pull request #51 from zhaoguojie2010/main
add meteora dlmm account event
2025-12-04 21:51:58 +08:00
zhaoguojie2010 66e7977897 fix raydium clmm bitmap extension account disc & support whirlpool account event 2025-11-30 21:32:51 +08:00
zhaoguojie2010 47a390a8bf support ray clmm bitmap extension account event 2025-11-29 17:27:49 +08:00
zhaoguojie2010 511fea0499 add meteora dlmm account event 2025-11-27 23:22:06 +08:00
ysq 5e222bf38a chore: bump version to 1.1.5
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
2025-11-19 21:13:40 +08:00
sgxiang 1770758597 Merge pull request #50 from VariantConst/patch-1
Increase minimum accounts check from 11 to 13
2025-11-19 21:10:37 +08:00
ysq c841e1d10e Merge commit '9d415cf9500f11d48596768e37cbb9334c298633' 2025-11-19 21:07:31 +08:00
sgxiang 9d415cf950 Merge pull request #48 from zhaoguojie2010/main
bugfix: fix discriminator length for raydium amm
2025-11-19 21:00:26 +08:00
VariantConst e62c337f44 Increase minimum accounts check from 11 to 13
Fixed out-of-bounds array access in PumpSwap buy/sell parser.
2025-11-19 11:07:53 +08:00
ysq 329405e23f chore: bump version to 1.1.4 and fix subscription filter keys 2025-11-16 23:30:51 +08:00
ysq 4b019e5e01 feat: add Compute Budget Program instruction parsing support
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.
2025-11-16 22:49:37 +08:00
zhaoguojie2010 2638b9bb91 bugfix: fix discriminator length for raydium amm 2025-11-16 15:01:12 +08:00
ysq 1ec7f845a5 feat: upgrade to v1.1.2 2025-11-10 23:19:03 +08:00
ysq d8bd35efe9 Merge commit '7ff18fa8e7177318018fe1450335c420a1d1e925' 2025-11-10 23:17:39 +08:00
ysq 7ff18fa8e7 feat: add gRPC latency monitoring and warning mechanism 2025-11-10 23:03:54 +08:00
ysq ad3a54625c feat: add Meteora DAMM v2 protocol support 2025-11-10 00:38:23 +08:00
ysq 6e3d2c23d1 feat: support Pump.fun V2 (Mayhem Mode) and update protocol structures for Nov 11 breaking changes 2025-11-09 23:59:56 +08:00
ysq 9e4f71dbb2 feat: support Pump.fun V2 (Mayhem Mode) and update protocol structures for Nov 11 breaking changes 2025-11-09 23:30:48 +08:00
ysq 3a9fed4a9c feat: upgrade to v1.1.0 2025-11-06 23:20:52 +08:00
ysq ed290a5a69 Merge commit '89986e1b36a6bcb45db4b7c268330eb4c137c037' 2025-11-06 23:19:02 +08:00
ysq 89986e1b36 refactor: remove unused dispatcher methods and optimize imports 2025-11-06 23:18:47 +08:00
ysq 72d5474dec Merge commit '7147ff06eefa044531aae9419c18557ecc69427a' 2025-11-06 23:12:48 +08:00
sgxiang 7147ff06ee Merge pull request #43 from 321llljjjfff123/main
fix:  修复地址查找表的存储空间分配问题
2025-11-04 22:56:35 +08:00
ysq 819b71ce1f refactor: unify event parsing API with callback ownership transfer 2025-11-04 22:49:40 +08:00
ysq 4c0e29865f refactor: replace static CONFIGS with dynamic event dispatcher 2025-11-03 23:58:19 +08:00
ysq 2b8f42bc1e perf: remove unnecessary clones in EventParser 2025-10-12 23:44:19 +08:00
ysq d5fc686664 refactor: optimize EventParser with idiomatic Rust patterns 2025-10-12 23:01:13 +08:00
ysq f85581ec61 refactor: upgrade to v1.0.0 with enum-based event architecture 2025-10-12 22:38:50 +08:00
ysq f2802a5a59 Merge commit 'fd180935f8619362fb852918ac686e9b94fa03a4' 2025-10-12 22:12:21 +08:00
ysq fd180935f8 refactor: rename UnifiedEvent to DexEvent 2025-10-12 22:00:15 +08:00
ysq e21f2cfd17 refactor: convert EventParser to static methods and optimize caching
- 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
2025-10-12 17:20:50 +08:00