Commit Graph

289 Commits

Author SHA1 Message Date
0xfnzero e29a2e4f5a docs: add donation wallet address to READMEs 2026-05-14 19:33:33 +08:00
Wood e2cceb01d2 Update README.md 2026-04-29 21:33:14 +08:00
Wood 409685c668 Merge pull request #69 from itsA-D/b/fix_build
Fix spl-token-2022 dependency pin for build failure
2026-04-26 22:13:35 +08:00
itsA-D f669d74c35 Fix spl-token-2022 dependency pin 2026-04-23 15:12:43 +05:30
0xfnzero 99412460c4 Add project logo to README
- Add Logo.png to project root
- Update README.md to display logo with 400px width

🤖 Generated with [Qoder][https://qoder.com]
2026-04-07 21:39:13 +08:00
Wood 93fe39f380 Merge pull request #68 from mooncitydev/subscription-cleanups-and-ci
simplify grpc subscription option checks and add github ci workflow
2026-04-07 21:28:01 +08:00
mooncitydev 01701e97fc simplify grpc subscription option checks and add github ci workflow
Made-with: Cursor
2026-04-04 04:25:17 +09:00
0xfnzero 7f505f0da5 feat(pumpswap): align pool account and events with cashback IDL
- 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
2026-04-03 14:38:06 +08:00
0xfnzero b593605dbd fix(deps): pin spl-token-group-interface to 0.7.1 for spl-token-2022 10.0.0
spl-token-group-interface 0.7.2 changed TokenGroup.update_authority to
MaybeNull<Pubkey>, while spl-token-2022 10.0.0 still expects
OptionalNonZeroPubkey, causing E0308 build failures. Pinning to 0.7.1
aligns transitive deps until upstream publishes a compatible release.

Made-with: Cursor
2026-04-03 12:57:54 +08:00
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 7a0a95a2f7 Merge pull request #65 from Estereg/dev-work
refactor: streaming core cleanup, deduplication and dependency simplification
2026-03-09 10:25:32 +08:00
Wood a3f879bda0 Merge branch 'main' into dev-work 2026-03-09 10:25:22 +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 6508d3b2fc Merge branch 'main' into dev-work 2026-03-09 10:15:55 +08:00
Wood adb4cfc52d Merge PR #65: refactor streaming core cleanup and dependency simplification 2026-03-09 10:10:24 +08:00
Estereg dad231a26b refactor: remove bs58 dependency and use solana_sdk program ID constants
- 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
2026-03-08 16:47:09 +00:00
Wood bdf984f2c1 chore: release v1.3.0
Made-with: Cursor
2026-03-09 00:41:28 +08:00
Wood 766899deb6 Merge pull request #64 from Estereg/main
refactor: modernize stack and migrate to std primitives
2026-03-09 00:21:53 +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
Estereg 8469b7eec5 Merge branch '0xfnzero:main' into dev-work 2026-03-08 03:41:13 -03:00
Estereg 8d8a79d2e4 Merge branch '0xfnzero:main' into main 2026-03-08 03:41:05 -03: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
Estereg 1a225870a9 Merge branch '0xfnzero:main' into dev-work 2026-03-07 14:43:25 -03:00
Estereg 6ac36664b2 Merge branch '0xfnzero:main' into main 2026-03-07 14:43:18 -03: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
Estereg 6493f9d922 refactor: streaming core optimization and code deduplication
- 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.
2026-03-07 07:16:30 +00:00
Estereg 0c369e23a8 refactor: modernize dependency stack and minimize footprint
- Migrate to native 'std::sync' primitives (LazyLock, OnceLock, RwLock).
- Replace 'parking_lot' with std library synchronization types.
- Switch from 'chrono' to 'std::time::SystemTime' for lightweight timestamps.
- Bump core dependencies: tokio (1.50.0) and rustls (0.23.37).
- Decouple 'solana-program' by utilizing 'solana-sdk' re-exports.
- Prune redundant crates: lazy_static, once_cell, chrono, maplit, and parking_lot.
- Remove unused dev-dependencies (criterion) and example-only utils (env_logger).
- Improve compile times and reduce supply chain attack surface.
2026-03-07 06:44:42 +00: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
Wood a8aa1c7789 Bump version to 1.2.2 in Cargo.toml and README
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.2.2
2026-02-23 12:56:08 +08:00
Wood 223436bfbd Merge pull request #61 from Estereg/main
feat(pumpfun): align IDL, fix parser & update/cleanup dependencies
2026-02-23 12:53:36 +08:00
Estereg 82239bd2a7 fix(pumpswap): merge missing V2 volume fields in Buy event
Added track_volume, unclaimed/claimed tokens, current_sol_volume, and timestamp to the merger logic to match new IDL.
2026-02-21 10:24:07 +00:00
Estereg c2f2113211 feat(pumpfun): align IDL for V2, Mayhem & Cashback
Update BondingCurve & Global structs, fix account mappings (Create/Buy/Sell), improve trade event merging, add missing fields to create events, and fix create_v2 user mapping.
2026-02-21 09:51:02 +00:00
Estereg 8e99720ce3 fix(pumpfun): fix trade event log size mapping
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.
2026-02-21 08:57:31 +00:00
Estereg b4ae02c956 build(deps): upgrade dependencies to latest compatible versions 2026-02-20 19:38:54 +00:00
Wood fd2bd0426c chore: add .DS_Store to .gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.2.1
2026-02-21 02:39:26 +08:00
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