mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-11-02 07:16:31 +00:00
Release v5.0.0
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# SDK release rules
|
||||
|
||||
- Apply these rules to this SDK and coordinated releases across the 11 Solana SDK repositories.
|
||||
- Prefer one release version across language implementations of the same SDK family (for example, all sol-parser-sdk packages use 0.9.0). Different SDK families need not share a version.
|
||||
- Before choosing versions, inspect published registries and Git tags. Never downgrade, overwrite a published version, or reuse a release tag.
|
||||
- Respect semantic versioning and each package manager's rules. A coordinated major release may align version numbers across languages. For Go v2+, migrate go.mod, all SDK/example imports, installation commands and package documentation to the required /vN module path, validate an external consumer, and document the user migration. The user has authorized the trade SDK's /v9 migration for the 9.0.0 family release. If alignment would require other compatibility changes outside the requested scope, document the exception instead of silently breaking consumers.
|
||||
- Update package manifests, lockfiles, exported version constants where present, exact cross-SDK dependency pins, English/Chinese README installation examples, and all 11 SDK navigation versions together. Preserve historical changelog versions.
|
||||
- A shared version does not prove feature parity. Check SDK code, examples, and native-language validation for each language; document unsupported features explicitly.
|
||||
- Publish in dependency order. Verify package contents, registry versions/checksums, GitHub commits, annotated tags, and Releases agree. Record partial failures accurately.
|
||||
- Version alignment does not by itself authorize publishing: publish packages, push commits/tags, and create Releases only when requested by the user.
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
# Changelog
|
||||
|
||||
## v5.0.0 — 2026-10-22
|
||||
|
||||
Synchronize SDK code, examples, version navigation and AI release rules. Read the [release and migration notes](RELEASE_NOTES.md) for callback removals, V3 defaults and the Go /v9 migration.
|
||||
|
||||
Release and integration notes preserved from the previous README. APIs, dependencies and validation results describe those releases, not the current contract. See the [README](README.md) and [release and migration notes](RELEASE_NOTES.md) for current usage.
|
||||
|
||||
## v4.0.0
|
||||
|
||||
See [release and migration notes](RELEASE_NOTES.md).
|
||||
|
||||
## v3.0.17 — Wrapped Pump.fun provenance and parser fixes
|
||||
|
||||
Updates sol-parser-sdk to 0.7.19 and preserves optional `third_program` provenance through the Pump.fun event bridge. Includes mint-scoped create-buy context and versioned IDL method-name fixes. Third-party rules remain explicit opt-in; the parsing hot path performs no RPC.
|
||||
|
||||
[Wrapped Pump.fun: offline rules, hot-path boundaries, and real-transaction replays](docs/wrapped-pumpfun.md)
|
||||
|
||||
## v3.0.16 — Shred metadata passthrough and ordering scope
|
||||
|
||||
Preserve and verify transaction position and receive time through raw instruction callbacks. Entries indexes are message-local, unlike Yellowstone node indexes; use signatures for cross-message deduplication. This release clarifies API documentation and adds regression protection without changing metadata fields or numbering behavior.
|
||||
|
||||
## v3.0.16 — DEX-scoped RawInstruction and typed DEX identifiers
|
||||
|
||||
Raw instructions now respect DEX subscriptions using programs referenced by each instruction. `RawInstructionDexType` provides typed identifiers with unchanged JSON strings. Unknown router layouts do not establish pool addresses, trade direction, or method versions.
|
||||
|
||||
## v3.0.16 — Pump execution replay
|
||||
|
||||
Current Anchor TradeEvent CPI decoding is supported alongside the historical encoding. RPC/gRPC instruction budgets and minimum outputs remain in instruction fields. Execution fields `sol_amount`, `quote_amount`, and `token_amount` come from execution events; without logs or event CPIs they remain zero (unavailable, not a proven zero fill).
|
||||
|
||||
Run `cargo run --offline --example rpc_transaction_replay` from this repository to replay real transactions fetched on 2026-10-19 offline. The default case is Delta SellV2. Fetch another using `--fetch SIGNATURE OUTPUT.json`; replay with `--fixture OUTPUT.json`. Set `SOLANA_RPC_URL` for your RPC; transaction v1 is supported.
|
||||
|
||||
The current Delta sell signature is `4ARos3Yq1SMNE3izDpy9YdKrRgMmD7UCDxvnVrBRaGCJHiifPHSmQWc4DPfjUaEUcxS7puGmEN64K7EZdeXLJaj2` (slot 458542546). Older five-combination multi-hop fixtures are retained as regression tests, not labeled as new mainnet captures.
|
||||
|
||||
## v3.0.16 — raw Shred instructions
|
||||
|
||||
Protocol filters apply to raw DEX associations as well as decoded events.
|
||||
|
||||
Default Shred parsing emits `RawInstruction` for unsupported third-party programs, including Rapid/Delta, without inferring direction, amounts, or internal buy methods. Infrastructure programs (System, Token, ATA, ComputeBudget, etc.) are omitted by default. Supported official DEX parsers are unchanged; official Pump/PumpSwap multi-hop instructions retain `PumpRouteIntent`.
|
||||
|
||||
The payload contains `program_id`, `instruction_index`, `accounts`, `account_indices`, `instruction_data`, and transaction metadata. Account order and duplicates are preserved. Unresolved ALT addresses are null/None, with original indices retained; supply cached loaded addresses or a resolver. No hot-path RPC is performed. Data is copied verbatim without requiring a known layout.
|
||||
|
||||
The raw event retains `metadata.tx_index` and `metadata.grpc_recv_us` from the parser arguments (streamer names the receive field `metadata.recv_us`). The default Entries client index is local to one received Entries message and restarts at zero for the next message; it is not a confirmed slot-wide transaction index. `instruction_index` orders outer instructions within a transaction. Receive time is a local microsecond timestamp, not an execution-order guarantee. Standalone replay APIs may default these values to zero; pass the upstream values when available.
|
||||
|
||||
Without a filter, unknown third-party instructions are returned. Broad trade/swap filters (for example `PumpFunTrade` or `RaydiumCpmmSwap`) also return raw instructions associated with that DEX; direction-specific filters do not infer a buy or sell. Explicit `RawInstruction` selects all outer instructions only when no protocol restriction is set; streamer protocol restrictions always apply. Excluding `RawInstruction` wins. `dex_type` uses the public `RawInstructionDexType` enum (typed string constants in Go); JSON values remain unchanged, such as `"pumpfun"` and `"raydium_cpmm"`. `dexes` contains `{ dex_type, program_id, pool }` for each recognized DEX program targeted or referenced by this instruction, not other instructions in the transaction. Multi-DEX wrappers retain every association. Unknown or unresolved ALT references cannot satisfy a DEX subscription. `pool` is currently null: an unknown wrapper layout cannot establish the pool account. A program reference is not proof of an executed CPI. Raw callbacks are not fills.
|
||||
|
||||
Wrapper adapter functions remain explicit compatibility helpers only; default Shred parsing does not call them. The released-version history below describes previous behavior.
|
||||
|
||||
## 🔄 Migration Guide
|
||||
|
||||
## v3.0.13 — Pump route event support
|
||||
|
||||
Route intents expose `is_buy` and `ix_name`, using existing trade field names and official IDL names. RapidBuy reports a buy intent and `buy_exact_quote_in_v2`; BuyPumpDelta reports only a buy intent. Multi-hop direction and unknown methods remain null. Currencies remain in `hops[].base_mint` / `quote_mint`. These hints do not confirm execution; filtering does not convert intents into trades.
|
||||
|
||||
Streamer forwards complete route payloads as `DexEvent::PumpRouteIntentEvent` with protocol/event filtering. Old JSON defaults missing hints to unknown. Rust struct literals need the new fields; exhaustive streamer event matches need the new variant.
|
||||
|
||||
## v3.0.12 — Pump routes and offline replay
|
||||
|
||||
Pins sol-parser-sdk 0.7.14 and includes the latest streaming facade code and native hot-path benchmark. The raw parser re-export provides the new Pump route-intent and cached-ALT APIs.
|
||||
|
||||
Route intents describe instructions before execution; use execution metadata for confirmed fills. Offline CPU timings do not measure production transport or transaction landing.
|
||||
|
||||
## v3.0.11 — Pump depth-2 compatibility
|
||||
|
||||
Pins sol-parser-sdk 0.7.13 and inherits signed Pump depth-2 create-event compatibility coverage through the parser bridge. Existing trading and event interfaces remain unchanged.
|
||||
|
||||
Validation includes official Pump SDK 4.1.0 instruction comparisons, signed local LiteSVM simulations and SDK regressions. Local simulation state/config is synthetic; no funded transactions were broadcast and production latency was not measured.
|
||||
|
||||
### v3.0.10
|
||||
|
||||
Pins `sol-parser-sdk =0.7.12` and inherits the PumpFun migration event CPI parsing fix. Publishes the current bridge support for compact Pump trades, quote-coin fields, completion and fee-sweep events, protocol fee fields and synthetic migration handling. Includes captured mainnet compact-trade regression fixtures.
|
||||
|
||||
Validation covers the streaming facade, parser bridge and offline transaction fixtures. Network transaction-landing latency is not an SLA.
|
||||
|
||||
### v3.0.9
|
||||
|
||||
- Pins `sol-parser-sdk 0.7.10` and inherits creation account matching, quote-account and historical-layout fixes, verified through the RPC facade and gRPC bridge.
|
||||
|
||||
### v3.0.8
|
||||
|
||||
Pins `sol-parser-sdk 0.7.9` and inherits PumpSwap boost account backfills and precompile log-index fixes. Preserves strict trade matching and ALT account handling. Adds offline mainnet regressions verifying pool vaults, token programs and sell mints through both the RPC facade and gRPC event bridge.
|
||||
|
||||
### v3.0.7
|
||||
|
||||
Uses `sol-parser-sdk 0.7.8`. Preserves CPMM creator-fee collection events, the AmmConfig share rate, swap instruction arguments and Orca/CLMM accounts through the bridge. Includes independent RPC corpus validation for 13 mainnet transactions and 17 target operations. Run `cargo run --example rpc_corpus_validate -- --list` to view signatures.
|
||||
|
||||
### Upgrading to v3.0.6
|
||||
|
||||
Version 3.0.6 pins `sol-parser-sdk 0.7.7`. Advanced callers can access StonkFun route analysis, migration registry and raw account subscriptions through `parser_sdk` / `sdk_bridge::raw`. Raw snapshots retain their parser SDK type and should be consumed directly rather than passed through the legacy streamer event adapter. Bridge regression fixtures are synchronized with the current Whirlpool/DLMM account fields.
|
||||
|
||||
### Upgrading to v3.0.5
|
||||
|
||||
Version 3.0.5 uses `sol-parser-sdk 0.7.5` and forwards the recovered Meteora DAMM v2 swap instruction accounts, including token mints, vaults, payer, token programs, and optional referral. Live mainnet regressions cover both swaps reported in issue #82.
|
||||
|
||||
### Upgrading to v3.0.4
|
||||
|
||||
Version 3.0.4 uses `sol-parser-sdk 0.7.4`, adds the user-facing `Protocol::LaunchLab`, `Protocol::StonkFun`, `ProtocolType::LaunchLab`, and `ProtocolType::StonkFun` identifiers, and filters shared LaunchLab traffic by StonkFun's official platform configuration accounts. LaunchLab trade events now forward complete reserves, fee legs, pool status, and the current three appended accounts. `Protocol::RaydiumLaunchpad` remains a source-compatible alias and displays as `LaunchLab`.
|
||||
|
||||
### Upgrading to v3.0.3
|
||||
|
||||
Version 3.0.3 uses `sol-parser-sdk 0.7.3` and synchronizes the current PumpFun, PumpSwap, and Pump Fees protocol schemas. PumpFun create/trade events and PumpSwap buy/sell/create-pool events now preserve creator-fee and holder-reward fields through the streamer bridge. PumpFun bonding-curve and PumpSwap pool account events also expose the new creator-fee editability and holder-reward state while retaining defaults for legacy accounts and JSON payloads. The parser rejects truncated current PumpSwap trade and CreatePool tails instead of returning partially populated events.
|
||||
|
||||
### Upgrading to v3.0.2
|
||||
|
||||
Version 3.0.2 uses `sol-parser-sdk 0.7.2` and forwards the new Meteora DAMM v2 events: `UpdateDelegatePermission`, `WithdrawDeadLiquidityReward`, `CreateConfig`, and `CreateDynamicConfig`. Transaction-cost events preserve all four Solana V1 config requests, and Yellowstone V1 messages are distinguished from V0 through `Message.config`. V1 ingestion requires a Yellowstone geyser server plugin version of at least `15.1.1`; older servers silently discard the config while downgrading V1 to V0.
|
||||
|
||||
### Upgrading to v3.0.1
|
||||
|
||||
Version 3.0.1 uses `sol-parser-sdk 0.7.1` and fixes current Meteora DAMM v2 Swap and AddLiquidity delivery. The bridge now preserves all current swap fee, transfer-fee, reserve, mode, and liquidity fields; exact AddLiquidity filtering follows the unified on-chain `EvtLiquidityChange` event. Streamer no longer maintains a separate DAMM swap payload decoder, keeping `sol-parser-sdk` as the single parsing implementation. Mainnet RPC regression tests cover both reported event types.
|
||||
|
||||
### Upgrading to v3.0.0
|
||||
|
||||
Version 3.0.0 uses `sol-parser-sdk 0.7.0` and Solana 4 public types. ShredStream Entry decoding now uses `wincode 0.5.5` in production and supports Solana V1 transactions. The normal dependency graph dropped from 677 to 544 package/version entries, while duplicated crate names dropped from 119 to 30 by removing redundant direct Solana/SPL dependencies and aligning versions with the parser. This release requires Rust 1.91 or newer and also forwards Meteora DLMM user token input/output accounts.
|
||||
|
||||
### Upgrading to v2.0.3
|
||||
|
||||
Version 2.0.3 uses `sol-parser-sdk 0.6.6` and pins `spl-pod 0.7.2` to keep fresh, lock-free builds compatible with `spl-list-view 0.1.0`. PumpFun trade events preserve the parser SDK's optional pre/post token balances in raw mint units and pre/post SOL balances in lamports, populated from transaction metadata without additional RPC calls. Meteora DLMM swaps also preserve `min_amount_out` separately from the executed `amount_out`.
|
||||
|
||||
### Upgrading to v2.0.1
|
||||
|
||||
Version 2.0.1 uses `sol-parser-sdk 0.6.1` from crates.io. PumpSwap Buy/Sell events now preserve the complete current cashback, buyback, signed virtual quote reserve, boost, and base-supply tail through dispatcher and SDK bridge paths. Truncated current layouts are rejected consistently by the default and zero-copy parser backends while historical layouts remain supported.
|
||||
|
||||
### Upgrading to v1.5.16
|
||||
|
||||
Version 1.5.16 fixes `StreamingOrdered` delivery for transactions that parse into multiple events. Events from the same `(slot, tx_index)` are admitted as a group, the streaming watermark advances once per transaction, and stable sorting preserves parser order for equal transaction indexes. It also pins `yellowstone-grpc-proto` to the `12.4.x` API used by `sol-parser-sdk 0.5.15` so CI and clean installs do not resolve an incompatible newer proto crate.
|
||||
|
||||
### Upgrading to v1.5.15
|
||||
|
||||
Version 1.5.15 tracks `sol-parser-sdk 0.5.15` at GitHub rev `36ec202`. Pump.fun `create_v2` now distinguishes 16-account SOL-sentinel creates from 19/20-account quote-pool creates, models Yellowstone gRPC loaded writable/readonly addresses correctly, rejects PumpFun program-account fillers as quote mints, and keeps ShredStream from guessing ALT-loaded quote mints when the static transaction keys do not contain them. gRPC/RPC inner instruction parsing now handles guarded 8-byte ordinary CPI instructions for all SDK-supported DEX parsers, so PumpSwap `create_pool` reads `is_cashback_coin` from instruction args before merging with log-derived `CreatePoolEvent` output. ShredStream remains outer-instruction only, but its outer discriminator gate is shared with the SDK parser and no longer diverges for supported DEX protocols.
|
||||
|
||||
### Upgrading to v1.5.14
|
||||
|
||||
Version 1.5.14 uses `sol-parser-sdk 0.5.14` from crates.io. Pump.fun canonical create events now expose `quote_mint`, `quote_vault`, and `quote_token_program` for `create_v2` quote pools, including USDC pools, across gRPC/RPC parser bridge and ShredStream-backed SDK output.
|
||||
|
||||
### Upgrading to v1.5.13
|
||||
|
||||
Version 1.5.13 uses `sol-parser-sdk 0.5.13` from crates.io. Pump.fun gRPC and ShredStream create/trade outputs now preserve real WSOL quote mints (`So11111111111111111111111111111111111111112`). The Solscan SOL sentinel (`So11111111111111111111111111111111111111111`) is used only when legacy data omits a quote mint.
|
||||
|
||||
### Upgrading to v1.5.11
|
||||
|
||||
Version 1.5.11 uses `sol-parser-sdk 0.5.11` from crates.io. PumpSwap `PumpSwapCreatePoolEvent` now carries `is_cashback_coin` when it is available from the `create_pool` instruction args, including ShredStream outer-instruction parsing. Log-only `CreatePoolEvent` payloads still default this field to `false` because the on-chain log event IDL does not carry it. `AccountPumpSwapPool` remains the authoritative account-state source for the pool flag.
|
||||
|
||||
### Upgrading to v1.5.10
|
||||
|
||||
Version 1.5.10 uses `sol-parser-sdk 0.5.10` from crates.io. PumpSwap `CreatePoolEvent` now matches the on-chain IDL: it exposes `is_mayhem_mode` but does not expose `is_cashback_coin`. To read the cashback flag, subscribe to `AccountPumpSwapPool` and use `PumpSwapPoolAccountEvent.pool.is_cashback_coin`. The PumpSwap CreatePool log payload length check now includes the final `is_mayhem_mode` byte.
|
||||
|
||||
### Upgrading to v1.5.9
|
||||
|
||||
Version 1.5.9 uses `sol-parser-sdk 0.5.9` from crates.io. It inherits the Yellowstone gRPC stop lifecycle fix: `stop()` now signals, aborts, and awaits the active subscription task, subscription lifecycle transitions are serialized, and gRPC stream errors are labeled as `Grpc Stream error` for easier log separation from ShredStream.
|
||||
|
||||
### Upgrading to v1.5.8
|
||||
|
||||
Version 1.5.8 uses `sol-parser-sdk 0.5.8` from crates.io. It inherits the Pump.fun ShredStream filter-family semantics from the parser SDK: `PumpFunBuy` covers `buy`, `buy_v2`, `buy_exact_sol_in`, and `buy_exact_quote_in_v2`; `PumpFunSell` covers `sell` and `sell_v2`; and `PumpFunTrade` covers all buy/sell instructions while the parser can emit unified trade events when only the generic trade filter is requested.
|
||||
|
||||
### Upgrading to v1.5.5
|
||||
|
||||
Version 1.5.5 uses `sol-parser-sdk 0.5.5` from crates.io. The SDK exposes LaunchLab as `RaydiumLaunchlab*`; streamer keeps the existing `Bonk*` event structs and `Protocol::Bonk` / `Protocol::RaydiumLaunchpad` aliases for source compatibility, while routing parser calls and upstream gRPC event filters to the new LaunchLab SDK variants. This release also syncs the CLMM/CPMM/Orca account bridges, Meteora DAMM v2 initialize-pool events, Meteora DBC events, and parser warmup on client creation.
|
||||
|
||||
### Upgrading to v1.5.4
|
||||
|
||||
Version 1.5.4 uses `sol-parser-sdk 0.5.4` from crates.io. Pump.fun `create` and `create_v2` are delivered as one canonical `PumpFunCreateTokenEvent`; subscribing to either `PumpFunCreateToken` or `PumpFunCreateV2Token` receives the same complete create-family data. This prevents duplicate new-mint callbacks from gRPC log + instruction parsing while preserving create_v2 account fields on the canonical create event.
|
||||
|
||||
### Upgrading to v1.5.3
|
||||
|
||||
Version 1.5.3 uses `sol-parser-sdk 0.5.3` from crates.io. It preserves real Pump.fun v2 `ix_name` values through the streamer bridge, improves ShredStream Pump.fun v2 best-effort parsing for short account lists, and treats `PumpFunBuy` and `PumpFunBuyExactSolIn` subscriptions as compatible buy-family filters. ShredStream still uses the direct entry-reading path with automatic reconnect; callbacks should remain non-blocking and `tx_index` remains entry-local best-effort.
|
||||
|
||||
### Upgrading to v1.5.2
|
||||
|
||||
Version 1.5.2 uses `sol-parser-sdk 0.5.2` from crates.io. ShredStream delivery uses the SDK parser on a direct entry-reading path with automatic reconnect, avoiding the extra queue consumer task while keeping parser event buffers reused. ShredStream `tx_index` is entry-local best-effort, not the Yellowstone slot-level transaction index. User callbacks on the direct path run on the read task and should avoid blocking work.
|
||||
|
||||
### Upgrading to v1.5.1
|
||||
|
||||
Version 1.5.1 uses `sol-parser-sdk 0.5.1` from crates.io. It improves ShredStream ALT handling by parsing outer instructions best-effort with default placeholders for ALT-loaded accounts, adds dropped-event queue observability, and keeps CPI/inner-only events documented as a ShredStream limitation.
|
||||
|
||||
### Upgrading to v1.5.0
|
||||
|
||||
Version 1.5.0 uses `sol-parser-sdk 0.5.0`, wires Raydium CLMM account parsing through the SDK bridge, and reduces ordered-buffer allocation/move overhead in low-latency delivery paths. `sol-parser-sdk 0.4.19` and `solana-streamer-sdk 1.4.14` were superseded because adding public parser event variants belongs in the 0.5 line.
|
||||
|
||||
### Upgrading to v1.4.14
|
||||
|
||||
Version 1.4.14 was superseded by v1.5.0.
|
||||
|
||||
### Upgrading to v1.4.13
|
||||
|
||||
Version 1.4.13 uses `sol-parser-sdk 0.4.18` and updates Raydium CLMM integration to the official upgraded IDL: current log-side event discriminators, official Swap/Liquidity/Create/Collect layouts, limit-order events, dynamic-fee related events, and the reshaped PoolState/TickState account structs.
|
||||
|
||||
### Upgrading to v1.4.12
|
||||
|
||||
Version 1.4.12 uses `sol-parser-sdk 0.4.17` and normalizes legacy PumpFun SOL quote mints to the Solscan SOL sentinel while preserving real USDC quote mints and quote-reserve fields. Streamer bridge and merger paths keep the parser SDK semantics aligned for Yellowstone gRPC and ShredStream output.
|
||||
|
||||
New optional capabilities:
|
||||
|
||||
- `solana_streamer_sdk::parser_sdk` re-exports the raw `sol-parser-sdk` crate.
|
||||
- `solana_streamer_sdk::sdk_bridge` adapts raw SDK events back into streamer `DexEvent`.
|
||||
- `fetch_rpc_transaction_as_streamer_events` and `parse_encoded_rpc_transaction_as_streamer_events` parse RPC transactions into streamer events.
|
||||
- `grpc::ClientConfig::order_mode` supports `Unordered`, `Ordered`, `StreamingOrdered`, and `MicroBatch`.
|
||||
- `sdk-parse-zero-copy` enables the SDK zero-copy parser backend.
|
||||
|
||||
### Migrating from v0.5.x to v1.x.x
|
||||
|
||||
Version 1.0.0 introduces a major architectural change from trait-based event handling to enum-based events. This provides better type safety, improved performance, and simpler code patterns.
|
||||
|
||||
**Key Changes:**
|
||||
|
||||
1. **Event Type Changed** - `Box<dyn UnifiedEvent>` → `DexEvent` enum
|
||||
2. **Callback Signature** - Callbacks now receive concrete `DexEvent` instead of trait objects
|
||||
3. **Event Matching** - Use standard Rust `match` instead of `match_event!` macro
|
||||
4. **Metadata Access** - Event properties now accessed through `.metadata()` method
|
||||
|
||||
**Quick Migration Example:**
|
||||
|
||||
```rust
|
||||
// Old (v0.5.x)
|
||||
let callback = |event: Box<dyn UnifiedEvent>| {
|
||||
println!("Event: {:?}", event.event_type());
|
||||
};
|
||||
|
||||
// New (v1.x.x)
|
||||
let callback = |event: DexEvent| {
|
||||
println!("Event: {:?}", event.metadata().event_type);
|
||||
};
|
||||
```
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
# 版本记录
|
||||
|
||||
## v5.0.0 — 2026-10-22
|
||||
|
||||
同步 SDK、examples、版本导航及 AI 发布规则。请阅读 [发布与迁移说明](RELEASE_NOTES.md),尤其注意事件精简、V3 默认行为和 Go /v9 模块迁移。
|
||||
|
||||
以下保留旧版 README 的发布与集成记录,其中接口、依赖和验证结果描述当时版本,不代表当前行为。当前用法见 [README](README_CN.md) 和 [发布与迁移说明](RELEASE_NOTES.md)。
|
||||
|
||||
## v4.0.0
|
||||
|
||||
详见 [发布与迁移说明](RELEASE_NOTES.md)。
|
||||
|
||||
## v3.0.17 — Pump.fun 第三方来源透传与解析修复
|
||||
|
||||
更新 sol-parser-sdk 至 0.7.19,Pump.fun 事件桥接保留可选的 `third_program` 第三方来源。同步按 mint 识别创建后买入及保留 IDL 版本化方法名的修复。第三方规则仍须显式启用,解析热路径不调用 RPC。
|
||||
|
||||
[第三方 Pump.fun 包装指令:离线规则、热路径边界与真实交易回放](docs/wrapped-pumpfun.md)
|
||||
|
||||
## v3.0.16 — Shred 元数据透传与顺序范围
|
||||
|
||||
保留并验证 `tx_index`、接收时间从解析入口传到原始指令回调。明确 Entries 消息内序号与 Yellowstone 节点 index 的区别:本地序号不是全 slot 索引;跨消息去重使用交易签名。此版本完善文档和回归保护,不改变现有字段或编号规则。
|
||||
|
||||
## v3.0.16 — RawInstruction 协议过滤与 DEX 枚举
|
||||
|
||||
修复原始指令绕过 DEX 订阅范围的问题。按单条指令引用的官方程序识别 DEX,使用 `RawInstructionDexType` 枚举;JSON 字符串保持不变。未知 router 不推断池子地址、买卖方向或方法版本。
|
||||
|
||||
## v3.0.16 — Pump 执行事件与最新回放示例
|
||||
|
||||
修复官方 Anchor CPI TradeEvent 前缀识别,保留历史编码兼容。RPC/gRPC 的实际 `sol_amount`、`quote_amount`、`token_amount` 只从执行事件合并;预算和最小输出保留在指令参数字段。如果日志及事件 CPI 均缺失,实际金额字段为 0(表示无执行数据,不代表已确认零成交)。非 SOL 报价金额不能当作 SOL。
|
||||
|
||||
在本仓库运行 `cargo run --offline --example rpc_transaction_replay`,离线回放 2026-10-19 重新抓取的真实交易。默认样本为 Delta SellV2;使用 `--fetch SIGNATURE OUTPUT.json` 抓取另一笔,再用 `--fixture OUTPUT.json` 回放。通过 `SOLANA_RPC_URL` 选择 RPC,支持 transaction v1。
|
||||
|
||||
新 Delta 卖出样本:`4ARos3Yq1SMNE3izDpy9YdKrRgMmD7UCDxvnVrBRaGCJHiifPHSmQWc4DPfjUaEUcxS7puGmEN64K7EZdeXLJaj2`,slot 458542546。旧的五种双跳组合仅作为回归样本,未冒充本次新抓取交易。
|
||||
|
||||
## v3.0.16 — Shred 原始指令透传
|
||||
|
||||
协议过滤同时作用于原始指令的 DEX 关联和已解码事件。
|
||||
|
||||
默认 Shred 入口将未适配的第三方程序(包括 Rapid/Delta)作为 `RawInstruction` 返回,不再推断买卖方向、金额或内部 buy 版本。System、Token、ATA、ComputeBudget 等基础程序默认不透传;已支持的官方 DEX 指令继续正常解析,官方 Pump/PumpSwap 多跳仍返回 `PumpRouteIntent`。
|
||||
|
||||
事件包含 `program_id`、`instruction_index`、`accounts`、`account_indices`、`instruction_data` 和交易 metadata。账户保留原顺序与重复项;未解析 ALT 地址为 null/None,原始索引仍保留。使用缓存 loaded-addresses/resolver 补齐,热路径不请求 RPC。data 是完整原始字节,不要求已知布局。
|
||||
|
||||
原始事件保留调用方传入的 `metadata.tx_index` 和 `metadata.grpc_recv_us`(streamer 对应 `metadata.recv_us`)。默认 Entries 客户端的交易序号仅在单条接收消息内递增,下一条消息从 0 重新计数,不等于已确认的整个 slot 交易序号。`instruction_index` 表示交易内外层指令顺序;接收时间是本地微秒时间戳,不保证链上执行顺序。独立回放 API 可能默认填 0,调用时应传入上游已有的序号与接收时间。
|
||||
|
||||
无过滤器时返回未知第三方指令。宽泛交易/Swap 订阅(如 `PumpFunTrade`、`RaydiumCpmmSwap`)也返回关联该 DEX 的原始指令;买/卖方向订阅不推测方向。显式 `RawInstruction` 仅在未限制协议时返回全部外层指令,streamer 的协议限制始终生效;显式排除 `RawInstruction` 优先。`dex_type` 使用公开枚举 `RawInstructionDexType`(Go 为命名字符串类型与常量);JSON 仍为 `"pumpfun"`、`"raydium_cpmm"` 等原有字符串。`dexes` 数组包含各关联 DEX 的 `{ dex_type, program_id, pool }`,只识别本条指令直接调用或账户中引用的 DEX 程序,不借用同笔其他指令的账户;多 DEX 包装保留所有关联。未知或未解析 ALT 中的程序不能匹配 DEX 订阅。`pool` 当前为 null:未知包装布局无法确定池子账户。program 引用不证明执行了 CPI,原始回调不是成交。
|
||||
|
||||
已有 wrapper 适配函数仅作为显式调用的兼容接口保留,不参与默认 Shred 解码。以下已发布版本的历史说明描述旧行为。
|
||||
|
||||
## 🔄 迁移指南
|
||||
|
||||
## v3.0.13 — Pump 路由事件完善
|
||||
|
||||
路由意图新增 `is_buy` 和 `ix_name`,沿用交易事件字段名和官方 IDL 方法名。RapidBuy 为买入意图,方法为 `buy_exact_quote_in_v2`;BuyPumpDelta 仅确定买入方向;多跳方向与未知方法保持为空。币种仍从 `hops[].base_mint` / `quote_mint` 获取。这些信息不代表已成交,过滤器也不会将路由意图转换为交易事件。
|
||||
|
||||
Streamer 现在通过 `DexEvent::PumpRouteIntentEvent` 转发完整路由字段并支持过滤。旧 JSON 缺少新字段时保持未知;Rust 结构体字面量需补齐新字段,穷举 streamer 事件的代码需处理新变体。
|
||||
|
||||
## v3.0.12 — Pump routes and offline replay
|
||||
|
||||
Pins sol-parser-sdk 0.7.14 and includes the latest streaming facade code and native hot-path benchmark. The raw parser re-export provides the new Pump route-intent and cached-ALT APIs.
|
||||
|
||||
Route intents describe instructions before execution; use execution metadata for confirmed fills. Offline CPU timings do not measure production transport or transaction landing.
|
||||
|
||||
## v3.0.11 — Pump depth-2 compatibility
|
||||
|
||||
Pins sol-parser-sdk 0.7.13 and inherits signed Pump depth-2 create-event compatibility coverage through the parser bridge. Existing trading and event interfaces remain unchanged.
|
||||
|
||||
Validation includes official Pump SDK 4.1.0 instruction comparisons, signed local LiteSVM simulations and SDK regressions. Local simulation state/config is synthetic; no funded transactions were broadcast and production latency was not measured.
|
||||
|
||||
### v3.0.10
|
||||
|
||||
锁定 sol-parser-sdk 0.7.12,同步 PumpFun migration event CPI 解析修复。发布当前 bridge 的 compact trade、quote coin、complete/fee sweep 事件、协议费用字段和 synthetic migration 支持,包含离线主网交易回归样本。
|
||||
|
||||
### v3.0.9
|
||||
|
||||
- 锁定 `sol-parser-sdk 0.7.10`,同步创建账户匹配、quote 账户及历史布局修复;通过 RPC facade 与 gRPC bridge 主网回归验证。
|
||||
|
||||
### v3.0.8
|
||||
|
||||
固定依赖 `sol-parser-sdk 0.7.9`,继承 PumpSwap boost 账户回填与预编译指令日志索引修复,保留严格交易匹配和 ALT 账户处理。新增离线主网回归样本,验证 RPC facade 和 gRPC 事件桥接层完整保留池金库、token program 及卖出 token mint。
|
||||
|
||||
### v3.0.7
|
||||
|
||||
Uses `sol-parser-sdk 0.7.8`. Preserves CPMM creator-fee collection events, the AmmConfig share rate, swap instruction arguments and Orca/CLMM accounts through the bridge. Includes independent RPC corpus validation for 13 mainnet transactions and 17 target operations. Run `cargo run --example rpc_corpus_validate -- --list` to view signatures.
|
||||
|
||||
### 升级到 v3.0.6
|
||||
|
||||
v3.0.6 固定使用 `sol-parser-sdk 0.7.7`。通过 `parser_sdk` / `sdk_bridge::raw` 可访问 StonkFun 路由分析、迁移注册表和原始账户订阅。原始快照保留 parser SDK 类型,应直接消费,不要经过旧 streamer 事件转换层。bridge 回归样本已同步当前 Whirlpool/DLMM 账户字段。
|
||||
|
||||
### 升级到 v3.0.5
|
||||
|
||||
v3.0.5 使用 `sol-parser-sdk 0.7.5`,并转发 Meteora DAMM v2 swap 指令中恢复的 mint、vault、payer、token program 及可选 referral 等账户。真实主网回归覆盖 issue #82 报告的两笔交易。
|
||||
|
||||
### 升级到 v3.0.4
|
||||
|
||||
v3.0.4 使用 `sol-parser-sdk 0.7.4`,新增面向用户的 `Protocol::LaunchLab`、`Protocol::StonkFun`、`ProtocolType::LaunchLab` 与 `ProtocolType::StonkFun` 标识,并根据 StonkFun 官方 platform config 过滤共享 LaunchLab 流量。LaunchLab 交易事件现在会完整转发储备量、手续费、池状态与当前新增的三个尾部账户。`Protocol::RaydiumLaunchpad` 继续作为源码兼容别名保留,其显示名称统一为 `LaunchLab`。
|
||||
|
||||
### 升级到 v3.0.3
|
||||
|
||||
v3.0.3 使用 `sol-parser-sdk 0.7.3`,同步当前 PumpFun、PumpSwap 和 Pump Fees 协议 schema。PumpFun create/trade 事件以及 PumpSwap buy/sell/create-pool 事件现在会通过 streamer bridge 完整保留 creator fee 与 holder reward 字段;PumpFun bonding curve 和 PumpSwap pool 账户事件也会暴露新的 creator fee 可编辑状态与 holder reward 状态,同时继续为旧账户布局和旧 JSON 数据提供默认值。解析器会拒绝截断的当前 PumpSwap trade 和 CreatePool 尾部,不再返回字段不完整的事件。
|
||||
|
||||
### 升级到 v3.0.2
|
||||
|
||||
v3.0.2 使用 `sol-parser-sdk 0.7.2`,并转发新增的 Meteora DAMM v2 事件:`UpdateDelegatePermission`、`WithdrawDeadLiquidityReward`、`CreateConfig`、`CreateDynamicConfig`。TransactionCost 事件会完整保留 Solana V1 的四项 config 请求,并通过 `Message.config` 区分 V1 与 V0。接入 V1 要求 Yellowstone geyser 服务端插件至少为 `15.1.1`;更旧的服务端会静默丢弃 config 并把 V1 降级成 V0。
|
||||
|
||||
### 升级到 v3.0.1
|
||||
|
||||
v3.0.1 使用 `sol-parser-sdk 0.7.1`,修复当前 Meteora DAMM v2 Swap 与 AddLiquidity 的投递。bridge 现在会完整保留 swap fee、transfer fee、reserve、mode 和流动性字段;AddLiquidity 精确过滤会跟随链上统一的 `EvtLiquidityChange` 事件。Streamer 不再维护独立的 DAMM swap payload 解码器,由 `sol-parser-sdk` 作为唯一解析实现,并增加两类问题事件的主网 RPC 回归测试。
|
||||
|
||||
### 升级到 v3.0.0
|
||||
|
||||
v3.0.0 使用 `sol-parser-sdk 0.7.0` 和 Solana 4 公开类型。生产 ShredStream Entry 解码已切换到 `wincode 0.5.5`,并支持 Solana V1 交易。通过删除重复的 Solana/SPL 直接依赖并与 parser 对齐版本,normal 依赖图从 677 个 package/version 项降到 544 个,重复 crate 名从 119 个降到 30 个。此版本要求 Rust 1.91 或更新版本,并会继续转发 Meteora DLMM 用户 token 输入/输出账户。
|
||||
|
||||
### 升级到 v2.0.3
|
||||
|
||||
v2.0.3 使用 `sol-parser-sdk 0.6.6`,并固定 `spl-pod 0.7.2`,确保无锁文件的全新构建与 `spl-list-view 0.1.0` 兼容。PumpFun 交易事件会保留 parser SDK 提供的可选交易前后 token 余额(mint 原始精度)和 SOL 余额(lamports),这些字段直接来自交易 metadata,无需额外 RPC 请求。Meteora DLMM swap 也会单独保留 `min_amount_out`,不再与实际成交的 `amount_out` 混淆。
|
||||
|
||||
### 升级到 v2.0.1
|
||||
|
||||
v2.0.1 使用 crates.io 上的 `sol-parser-sdk 0.6.1`。PumpSwap Buy/Sell 事件现在会在 dispatcher 和 SDK bridge 路径中完整保留 cashback、buyback、带符号 virtual quote reserve、boost 和 base supply 尾部字段。默认和 zero-copy 解析后端会一致拒绝截断的当前布局,同时继续兼容历史布局。
|
||||
|
||||
### 升级到 v1.5.16
|
||||
|
||||
v1.5.16 修复 `StreamingOrdered` 模式下同一交易解析出多个事件时的投递问题。同一 `(slot, tx_index)` 的事件会作为一组进入缓冲,streaming watermark 每笔交易只推进一次,并用 stable sort 保留相同交易索引下的解析器输出顺序。同时将 `yellowstone-grpc-proto` 固定到 `sol-parser-sdk 0.5.15` 使用的 `12.4.x` API,避免 CI 和干净安装解析到不兼容的新 proto crate。
|
||||
|
||||
### 升级到 v1.5.15
|
||||
|
||||
v1.5.15 跟随 GitHub rev `36ec202` 上的 `sol-parser-sdk 0.5.15`。Pump.fun `create_v2` 现在会区分 16 账户 SOL sentinel 创建和 19/20 账户 quote-pool 创建;填充账户时会先选择实际的 create/create_v2 指令,再读取 quote 字段。gRPC/RPC inner instruction 解析现在会按 program id + discriminator 守卫解析所有 SDK 已支持 DEX 的 8-byte 普通 CPI instruction,PumpSwap `create_pool` 因此能从 instruction args 读取 `is_cashback_coin` 并与 log 事件合并。ShredStream 仍只解析外层指令,但外层 discriminator gate 已和 SDK 统一,避免支持协议之间规则分叉。
|
||||
|
||||
### 升级到 v1.5.14
|
||||
|
||||
v1.5.14 使用 crates.io 上的 `sol-parser-sdk 0.5.14`。Pump.fun canonical create 事件现在会为 `create_v2` quote 池暴露 `quote_mint`、`quote_vault`、`quote_token_program`,包括 USDC 池;gRPC/RPC parser bridge 和 ShredStream-backed SDK 输出都会保留这些字段。
|
||||
|
||||
### 升级到 v1.5.13
|
||||
|
||||
v1.5.13 使用 crates.io 上的 `sol-parser-sdk 0.5.13`。Pump.fun gRPC 和 ShredStream create/trade 输出现在会保留真实 WSOL quote mint(`So11111111111111111111111111111111111111112`)。只有 legacy 数据缺失 quote mint 时,才使用 Solscan SOL sentinel(`So11111111111111111111111111111111111111111`)。
|
||||
|
||||
### 升级到 v1.5.11
|
||||
|
||||
v1.5.11 使用 crates.io 上的 `sol-parser-sdk 0.5.11`。PumpSwap `PumpSwapCreatePoolEvent` 现在会在 `create_pool` instruction args 可用时携带 `is_cashback_coin`,包括 ShredStream 外层指令解析。log-only 的 `CreatePoolEvent` payload 因为链上 log event IDL 不包含该字段,仍会保持默认 `false`。`AccountPumpSwapPool` 仍是读取池子账户状态里该标记的权威来源。
|
||||
|
||||
### 升级到 v1.5.10
|
||||
|
||||
v1.5.10 使用 crates.io 上的 `sol-parser-sdk 0.5.10`。PumpSwap `CreatePoolEvent` 现在与链上 IDL 对齐:暴露 `is_mayhem_mode`,但不暴露 `is_cashback_coin`。如果需要 cashback 标记,请订阅 `AccountPumpSwapPool`,并读取 `PumpSwapPoolAccountEvent.pool.is_cashback_coin`。PumpSwap CreatePool log payload 长度检查现在包含最后的 `is_mayhem_mode` 字节。
|
||||
|
||||
### 升级到 v1.5.9
|
||||
|
||||
v1.5.9 使用 crates.io 上的 `sol-parser-sdk 0.5.9`。该版本继承 Yellowstone gRPC stop 生命周期修复:`stop()` 现在会通知、abort 并等待当前订阅任务结束,订阅生命周期切换会串行化,并且 gRPC 流错误日志会标记为 `Grpc Stream error`,便于和 ShredStream 日志区分。
|
||||
|
||||
### 升级到 v1.5.8
|
||||
|
||||
v1.5.8 使用 crates.io 上的 `sol-parser-sdk 0.5.8`。该版本继承 parser SDK 的 Pump.fun ShredStream 过滤大类语义:`PumpFunBuy` 覆盖 `buy`、`buy_v2`、`buy_exact_sol_in`、`buy_exact_quote_in_v2`;`PumpFunSell` 覆盖 `sell`、`sell_v2`;`PumpFunTrade` 覆盖所有 buy/sell 指令,并且当只请求通用 trade filter 时,parser 可统一输出 trade 事件。
|
||||
|
||||
### 升级到 v1.5.5
|
||||
|
||||
v1.5.5 使用 crates.io 上的 `sol-parser-sdk 0.5.5`。底层 SDK 已将 LaunchLab 事件统一暴露为 `RaydiumLaunchlab*`;streamer 仍保留现有 `Bonk*` 事件结构以及 `Protocol::Bonk` / `Protocol::RaydiumLaunchpad` 兼容别名,同时把解析调用和上游 gRPC 事件过滤映射到新的 LaunchLab SDK variant。该版本也同步了 CLMM/CPMM/Orca account bridge、Meteora DAMM v2 initialize-pool、Meteora DBC 事件,以及客户端创建时的 parser warmup。
|
||||
|
||||
### 升级到 v1.5.4
|
||||
|
||||
v1.5.4 使用 crates.io 上的 `sol-parser-sdk 0.5.4`。Pump.fun `create` 和 `create_v2` 会统一投递为 canonical `PumpFunCreateTokenEvent`;订阅 `PumpFunCreateToken` 或 `PumpFunCreateV2Token` 任意一个,都能收到同一份完整 create-family 数据。该版本避免 gRPC log + instruction 双路径解析导致新 mint 回调重复,同时在 canonical create 事件上保留 create_v2 账户字段。
|
||||
|
||||
### 升级到 v1.5.3
|
||||
|
||||
v1.5.3 使用 crates.io 上的 `sol-parser-sdk 0.5.3`。该版本会通过 streamer bridge 保留真实的 Pump.fun v2 `ix_name`,改进 ShredStream 对 Pump.fun v2 短账户列表的 best-effort 解析,并让订阅 `PumpFunBuy` 或 `PumpFunBuyExactSolIn` 都能匹配兼容的 buy-family 事件。ShredStream 仍使用直接读取 Entry 的自动重连低延迟路径;回调应避免阻塞,`tx_index` 仍是 Entry 内 best-effort 索引。
|
||||
|
||||
### 升级到 v1.5.2
|
||||
|
||||
v1.5.2 使用 crates.io 上的 `sol-parser-sdk 0.5.2`。ShredStream 投递使用直接读取 Entry 并调用 SDK parser 的低延迟路径,支持自动重连,避免额外的队列消费任务并复用解析事件缓冲。ShredStream 的 `tx_index` 是 Entry 内 best-effort 索引,不是 Yellowstone 的 slot 级交易索引。direct-callback 路径中的用户回调运行在读流任务中,应避免阻塞操作。
|
||||
|
||||
### 升级到 v1.5.1
|
||||
|
||||
v1.5.1 使用 crates.io 上的 `sol-parser-sdk 0.5.1`。该版本改进 ShredStream 的 ALT 处理:ALT-loaded 账户会以默认账户占位,外层指令按 data/discriminator 尽量解析;同时增加队列满时的 dropped event 可观测性,并明确 CPI/inner-only 事件仍是 ShredStream 的固有限制。
|
||||
|
||||
### 升级到 v1.5.0
|
||||
|
||||
v1.5.0 使用 `sol-parser-sdk 0.5.0`,打通 Raydium CLMM 账户解析的 SDK bridge,并降低有序缓冲低延迟投递路径中的分配和搬移开销。`sol-parser-sdk 0.4.19` 和 `solana-streamer-sdk 1.4.14` 已由 v1.5.0 取代,因为新增公开 parser event variant 应放到 0.5 版本线。
|
||||
|
||||
### 升级到 v1.4.14
|
||||
|
||||
v1.4.14 已由 v1.5.0 取代。
|
||||
|
||||
### 升级到 v1.4.13
|
||||
|
||||
v1.4.13 使用 `sol-parser-sdk 0.4.18`,并按 Raydium CLMM 官方升级后 IDL 更新集成:当前 log-side event discriminator、官方 Swap/Liquidity/Create/Collect 事件布局、限价单事件、dynamic fee 相关事件,以及重塑后的 PoolState/TickState 账户结构。
|
||||
|
||||
### 升级到 v1.4.12
|
||||
|
||||
v1.4.12 使用 `sol-parser-sdk 0.4.17`,会把 legacy PumpFun SOL 的 `quote_mint` 归一为 Solscan SOL sentinel,同时保留真实 USDC quote mint 和 quote reserve 字段。Streamer bridge 与 merger 路径继续保持 Yellowstone gRPC 和 ShredStream 输出与 parser SDK 语义一致。
|
||||
|
||||
新增可选能力:
|
||||
|
||||
- `solana_streamer_sdk::parser_sdk` 重新导出原始 `sol-parser-sdk` crate。
|
||||
- `solana_streamer_sdk::sdk_bridge` 可将原始 SDK 事件适配回 streamer `DexEvent`。
|
||||
- `fetch_rpc_transaction_as_streamer_events` 和 `parse_encoded_rpc_transaction_as_streamer_events` 可将 RPC 交易解析为 streamer 事件。
|
||||
- `grpc::ClientConfig::order_mode` 支持 `Unordered`、`Ordered`、`StreamingOrdered` 和 `MicroBatch`。
|
||||
- `sdk-parse-zero-copy` 可启用 SDK zero-copy 解析后端。
|
||||
|
||||
### 从 v0.5.x 迁移到 v1.x.x
|
||||
|
||||
版本 1.0.0 引入了从基于 trait 的事件处理到基于 enum 的事件的重大架构变更。这提供了更好的类型安全性、改进的性能和更简单的代码模式。
|
||||
|
||||
**主要变更:**
|
||||
|
||||
1. **事件类型变更** - `Box<dyn UnifiedEvent>` → `DexEvent` 枚举
|
||||
2. **回调签名** - 回调现在接收具体的 `DexEvent` 而不是 trait 对象
|
||||
3. **事件匹配** - 使用标准 Rust `match` 而不是 `match_event!` 宏
|
||||
4. **元数据访问** - 事件属性现在通过 `.metadata()` 方法访问
|
||||
|
||||
**快速迁移示例:**
|
||||
|
||||
```rust
|
||||
// 旧版 (v0.5.x)
|
||||
let callback = |event: Box<dyn UnifiedEvent>| {
|
||||
println!("Event: {:?}", event.event_type());
|
||||
};
|
||||
|
||||
// 新版 (v1.x.x)
|
||||
let callback = |event: DexEvent| {
|
||||
println!("Event: {:?}", event.metadata().event_type);
|
||||
};
|
||||
```
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-streamer-sdk"
|
||||
version = "4.0.0"
|
||||
version = "5.0.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.91"
|
||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||
@@ -22,7 +22,7 @@ sdk-perf-stats = ["sol-parser-sdk/perf-stats"]
|
||||
sdk-ultra-perf = ["sol-parser-sdk/ultra-perf"]
|
||||
|
||||
[dependencies]
|
||||
sol-parser-sdk = { path = "../sol-parser-sdk", version = "=0.8.0", default-features = false }
|
||||
sol-parser-sdk = { path = "../sol-parser-sdk", version = "=0.9.0", default-features = false }
|
||||
solana-sdk = "=4.0.1"
|
||||
solana-client = "=4.2.2"
|
||||
solana-transaction-status = { version = "=4.2.2", features = ["agave-unstable-api"] }
|
||||
|
||||
@@ -1,103 +1,93 @@
|
||||
Current version: **4.0.0**. SDK, native-language tests, examples and documentation are synchronized in this release. See [RELEASE_NOTES.md](RELEASE_NOTES.md) for migration details.
|
||||
|
||||
<div align="center">
|
||||
|
||||
## v3.0.17 — Wrapped Pump.fun provenance and parser fixes
|
||||
|
||||
Updates sol-parser-sdk to 0.7.19 and preserves optional `third_program` provenance through the Pump.fun event bridge. Includes mint-scoped create-buy context and versioned IDL method-name fixes. Third-party rules remain explicit opt-in; the parsing hot path performs no RPC.
|
||||
|
||||
[Wrapped Pump.fun: offline rules, hot-path boundaries, and real-transaction replays](docs/wrapped-pumpfun.md)
|
||||
|
||||
## v3.0.16 — Shred metadata passthrough and ordering scope
|
||||
|
||||
Preserve and verify transaction position and receive time through raw instruction callbacks. Entries indexes are message-local, unlike Yellowstone node indexes; use signatures for cross-message deduplication. This release clarifies API documentation and adds regression protection without changing metadata fields or numbering behavior.
|
||||
|
||||
|
||||
## v3.0.16 — DEX-scoped RawInstruction and typed DEX identifiers
|
||||
|
||||
Raw instructions now respect DEX subscriptions using programs referenced by each instruction. `RawInstructionDexType` provides typed identifiers with unchanged JSON strings. Unknown router layouts do not establish pool addresses, trade direction, or method versions.
|
||||
|
||||
|
||||
## v3.0.16 — Pump execution replay
|
||||
|
||||
Current Anchor TradeEvent CPI decoding is supported alongside the historical encoding. RPC/gRPC instruction budgets and minimum outputs remain in instruction fields. Execution fields `sol_amount`, `quote_amount`, and `token_amount` come from execution events; without logs or event CPIs they remain zero (unavailable, not a proven zero fill).
|
||||
|
||||
Run `cargo run --offline --example rpc_transaction_replay` from this repository to replay real transactions fetched on 2026-10-19 offline. The default case is Delta SellV2. Fetch another using `--fetch SIGNATURE OUTPUT.json`; replay with `--fixture OUTPUT.json`. Set `SOLANA_RPC_URL` for your RPC; transaction v1 is supported.
|
||||
|
||||
The current Delta sell signature is `4ARos3Yq1SMNE3izDpy9YdKrRgMmD7UCDxvnVrBRaGCJHiifPHSmQWc4DPfjUaEUcxS7puGmEN64K7EZdeXLJaj2` (slot 458542546). Older five-combination multi-hop fixtures are retained as regression tests, not labeled as new mainnet captures.
|
||||
|
||||
## v3.0.16 — raw Shred instructions
|
||||
|
||||
Protocol filters apply to raw DEX associations as well as decoded events.
|
||||
|
||||
Default Shred parsing emits `RawInstruction` for unsupported third-party programs, including Rapid/Delta, without inferring direction, amounts, or internal buy methods. Infrastructure programs (System, Token, ATA, ComputeBudget, etc.) are omitted by default. Supported official DEX parsers are unchanged; official Pump/PumpSwap multi-hop instructions retain `PumpRouteIntent`.
|
||||
|
||||
The payload contains `program_id`, `instruction_index`, `accounts`, `account_indices`, `instruction_data`, and transaction metadata. Account order and duplicates are preserved. Unresolved ALT addresses are null/None, with original indices retained; supply cached loaded addresses or a resolver. No hot-path RPC is performed. Data is copied verbatim without requiring a known layout.
|
||||
|
||||
The raw event retains `metadata.tx_index` and `metadata.grpc_recv_us` from the parser arguments (streamer names the receive field `metadata.recv_us`). The default Entries client index is local to one received Entries message and restarts at zero for the next message; it is not a confirmed slot-wide transaction index. `instruction_index` orders outer instructions within a transaction. Receive time is a local microsecond timestamp, not an execution-order guarantee. Standalone replay APIs may default these values to zero; pass the upstream values when available.
|
||||
|
||||
Without a filter, unknown third-party instructions are returned. Broad trade/swap filters (for example `PumpFunTrade` or `RaydiumCpmmSwap`) also return raw instructions associated with that DEX; direction-specific filters do not infer a buy or sell. Explicit `RawInstruction` selects all outer instructions only when no protocol restriction is set; streamer protocol restrictions always apply. Excluding `RawInstruction` wins. `dex_type` uses the public `RawInstructionDexType` enum (typed string constants in Go); JSON values remain unchanged, such as `"pumpfun"` and `"raydium_cpmm"`. `dexes` contains `{ dex_type, program_id, pool }` for each recognized DEX program targeted or referenced by this instruction, not other instructions in the transaction. Multi-DEX wrappers retain every association. Unknown or unresolved ALT references cannot satisfy a DEX subscription. `pool` is currently null: an unknown wrapper layout cannot establish the pool account. A program reference is not proof of an executed CPI. Raw callbacks are not fills.
|
||||
|
||||
Wrapper adapter functions remain explicit compatibility helpers only; default Shred parsing does not call them. The released-version history below describes previous behavior.
|
||||
|
||||
<h1>🌊 Solana Streamer</h1>
|
||||
<h3><em>Real-time event streaming from Solana DEX trading programs.</em></h3>
|
||||
<h1>Solana Streamer</h1>
|
||||
<p>Rust event subscriptions built on sol-parser-sdk</p>
|
||||
<a href="https://crates.io/crates/solana-streamer-sdk"><img src="https://img.shields.io/crates/v/solana-streamer-sdk.svg" alt="solana-streamer-sdk"></a>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<strong>A lightweight Rust streaming facade over sol-parser-sdk, with low-latency subscriptions and a stable bot-facing API.</strong>
|
||||
<a href="README.md">English</a> · <a href="README_CN.md">中文</a> ·
|
||||
<a href="#usage-examples">Examples</a> ·
|
||||
<a href="docs/wrapped-pumpfun.md">Documentation</a> ·
|
||||
<a href="RELEASE_NOTES.md">Release and migration</a> ·
|
||||
<a href="#related-sdks">Related SDKs</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://crates.io/crates/solana-streamer-sdk">
|
||||
<img src="https://img.shields.io/crates/v/solana-streamer-sdk.svg" alt="Crates.io">
|
||||
</a>
|
||||
<a href="https://docs.rs/solana-streamer-sdk">
|
||||
<img src="https://docs.rs/solana-streamer-sdk/badge.svg" alt="Documentation">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer">
|
||||
<img src="https://img.shields.io/github/stars/0xfnzero/solana-streamer?style=social" alt="GitHub stars">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer/network">
|
||||
<img src="https://img.shields.io/github/forks/0xfnzero/solana-streamer?style=social" alt="GitHub forks">
|
||||
</a>
|
||||
</p>
|
||||
Manage gRPC and ShredStream subscriptions, event filters and dynamic subscriptions while preserving parser provenance and metadata.
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white" alt="Rust">
|
||||
<img src="https://img.shields.io/badge/Solana-9945FF?style=for-the-badge&logo=solana&logoColor=white" alt="Solana">
|
||||
<img src="https://img.shields.io/badge/Streaming-FF6B6B?style=for-the-badge&logo=livestream&logoColor=white" alt="Real-time Streaming">
|
||||
<img src="https://img.shields.io/badge/gRPC-4285F4?style=for-the-badge&logo=grpc&logoColor=white" alt="gRPC">
|
||||
</p>
|
||||
Current version: **5.0.0**. Read the [migration notes](RELEASE_NOTES.md) before upgrading; see the [changelog](CHANGELOG.md) for historical changes.
|
||||
|
||||
<p align="center">
|
||||
<a href="README_CN.md">中文</a> |
|
||||
<a href="README.md">English</a> |
|
||||
<a href="https://fnzero.dev/">Website</a> |
|
||||
<a href="https://t.me/fnzero_group">Telegram</a> |
|
||||
<a href="https://discord.gg/vuazbGkqQE">Discord</a>
|
||||
</p>
|
||||
## Contents
|
||||
|
||||
---
|
||||
- [Related SDKs](#related-sdks)
|
||||
- [Installation](#installation)
|
||||
- [What This SDK Is For](#what-this-sdk-is-for)
|
||||
- [Project Features](#project-features)
|
||||
- [Usage Examples](#usage-examples)
|
||||
- [Trade provenance and parsing boundaries](#trade-provenance-and-parsing-boundaries)
|
||||
- [Supported Protocols](#supported-protocols)
|
||||
- [Documentation](#documentation)
|
||||
- [Configuration](#configuration-system)
|
||||
- [Dynamic subscriptions](#dynamic-subscription-management)
|
||||
|
||||
## Table of Contents
|
||||
<a id="related-sdks"></a>
|
||||
|
||||
- [🚀 Project Features](#-project-features)
|
||||
- [⚡ Installation](#-installation)
|
||||
- [🔄 Migration Guide](#-migration-guide)
|
||||
- [⚙️ Configuration System](#️-configuration-system)
|
||||
- [📚 Usage Examples](#-usage-examples)
|
||||
- [🔧 Supported Protocols](#-supported-protocols)
|
||||
- [🌐 Event Streaming Services](#-event-streaming-services)
|
||||
- [🏗️ Architecture Features](#️-architecture-features)
|
||||
- [📁 Project Structure](#-project-structure)
|
||||
- [⚡ Performance Considerations](#-performance-considerations)
|
||||
- [📄 License](#-license)
|
||||
- [📞 Contact](#-contact)
|
||||
- [⚠️ Important Notes](#️-important-notes)
|
||||
## Related SDKs
|
||||
|
||||
Repositories are versioned independently; follow each SDK’s installation guide for compatible dependencies.
|
||||
|
||||
| Language | Repository | Purpose | Version |
|
||||
|----------|------------|-------------|---------|
|
||||
| Rust | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) | DEX transaction and account event parsing | `v0.9.0` |
|
||||
| Node.js | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) | DEX transaction and account event parsing | `v0.9.0` |
|
||||
| Python | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) | DEX transaction and account event parsing | `v0.9.0` |
|
||||
| Go | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) | DEX transaction and account event parsing | `v0.9.0` |
|
||||
| Rust | [sol-trade-sdk](https://github.com/0xfnzero/sol-trade-sdk) | Transaction building, signing and multi-channel submission | `v9.0.0` |
|
||||
| Node.js | [sol-trade-sdk-nodejs](https://github.com/0xfnzero/sol-trade-sdk-nodejs) | Transaction building, signing and multi-channel submission | `v9.0.0` |
|
||||
| Python | [sol-trade-sdk-python](https://github.com/0xfnzero/sol-trade-sdk-python) | Transaction building, signing and multi-channel submission | `v9.0.0` |
|
||||
| Go | [sol-trade-sdk-golang](https://github.com/0xfnzero/sol-trade-sdk-golang) | Transaction building, signing and multi-channel submission | `v9.0.0` |
|
||||
| Rust | [sol-shred-sdk](https://github.com/0xfnzero/sol-shred-sdk) | Raw shred decoding and ShredStream instruction events | `v6.0.0` |
|
||||
| Rust | [solana-streamer](https://github.com/0xfnzero/solana-streamer) | gRPC / ShredStream subscriptions and event streaming | `v5.0.0` |
|
||||
| Rust | [sol-trade-router-sdk](https://github.com/0xfnzero/sol-trade-router-sdk) | On-chain multi-hop router and client SDK | `v0.3.0` |
|
||||
|
||||
<a id="installation"></a>
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = "5.0.0"
|
||||
```
|
||||
|
||||
Parser backend features:
|
||||
|
||||
```toml
|
||||
# Default: sol-parser-sdk parse-borsh backend
|
||||
solana-streamer-sdk = "5.0.0"
|
||||
|
||||
# Zero-copy parser backend for latency-sensitive bots
|
||||
solana-streamer-sdk = { version = "5.0.0", default-features = false, features = ["sdk-parse-zero-copy"] }
|
||||
```
|
||||
|
||||
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.6.1+` uses the zero-copy backend.
|
||||
|
||||
### Use from source
|
||||
|
||||
Clone this project to your project directory:
|
||||
|
||||
```bash
|
||||
cd your_project_root_directory
|
||||
git clone https://github.com/0xfnzero/solana-streamer
|
||||
```
|
||||
|
||||
Add the dependency to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "5.0.0" }
|
||||
```
|
||||
|
||||
<a id="what-this-sdk-is-for"></a>
|
||||
|
||||
## What This SDK Is For
|
||||
|
||||
@@ -110,13 +100,15 @@ Wrapper adapter functions remain explicit compatibility helpers only; default Sh
|
||||
| Use cases | Real-time DEX event streaming, token launch monitoring, copy trading, account-state subscriptions, bot signal pipelines |
|
||||
| Parser backend | `sol-parser-sdk` with default Borsh parsing and optional zero-copy backend for latency-sensitive workloads |
|
||||
|
||||
<a id="project-features"></a>
|
||||
|
||||
## 🚀 Project Features
|
||||
|
||||
### Core Capabilities
|
||||
- **Real-time Event Streaming**: Subscribe to live trading events from multiple Solana DEX protocols
|
||||
- **SDK-backed Parser Core**: Transaction, RPC, account, and ShredStream parsing are backed by `sol-parser-sdk`
|
||||
- **Yellowstone gRPC Support**: High-performance event subscription using Yellowstone gRPC
|
||||
- **ShredStream Support**: Alternative event streaming using ShredStream protocol; ALT-loaded accounts are parsed best-effort with default account placeholders
|
||||
- **ShredStream Support**: Alternative event streaming using ShredStream protocol; ALT addresses must come from supplied loaded addresses or a local cache; unresolved addresses are not guessed
|
||||
- **Unified Event Interface**: Consistent event handling across all supported protocols
|
||||
|
||||
### Multi-Protocol Support
|
||||
@@ -125,7 +117,7 @@ Wrapper adapter functions remain explicit compatibility helpers only; default Sh
|
||||
- **PumpSwap**: PumpFun's swap protocol events
|
||||
- **LaunchLab**: Shared token-launch program events through `Protocol::LaunchLab`; `Protocol::Bonk` and `Protocol::RaydiumLaunchpad` remain compatible aliases
|
||||
- **StonkFun**: StonkFun-attributed LaunchLab events through `Protocol::StonkFun`; event metadata reports `ProtocolType::StonkFun`
|
||||
- **Raydium CPMM**: Raydium's Concentrated Pool Market Maker events
|
||||
- **Raydium CPMM**: Raydium's Constant Product Market Maker events
|
||||
- **Raydium CLMM**: Raydium's Concentrated Liquidity Market Maker events
|
||||
- **Raydium AMM V4**: Raydium's Automated Market Maker V4 events
|
||||
- **Meteora DAMM v2**: Meteora DAMM v2 swap and liquidity events
|
||||
@@ -156,315 +148,7 @@ Wrapper adapter functions remain explicit compatibility helpers only; default Sh
|
||||
- **Runtime Configuration Updates**: Dynamic configuration parameter updates at runtime
|
||||
- **Graceful Shutdown**: Support for programmatic stop() method for clean shutdown
|
||||
|
||||
## ⚡ Installation
|
||||
|
||||
### Direct Clone
|
||||
|
||||
Clone this project to your project directory:
|
||||
|
||||
```bash
|
||||
cd your_project_root_directory
|
||||
git clone https://github.com/0xfnzero/solana-streamer
|
||||
```
|
||||
|
||||
Add the dependency to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "4.0.0" }
|
||||
```
|
||||
|
||||
### Use crates.io
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = "4.0.0"
|
||||
```
|
||||
|
||||
Parser backend features:
|
||||
|
||||
```toml
|
||||
# Default: sol-parser-sdk parse-borsh backend
|
||||
solana-streamer-sdk = "4.0.0"
|
||||
|
||||
# Zero-copy parser backend for latency-sensitive bots
|
||||
solana-streamer-sdk = { version = "4.0.0", default-features = false, features = ["sdk-parse-zero-copy"] }
|
||||
```
|
||||
|
||||
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.6.1+` uses the zero-copy backend.
|
||||
|
||||
## 🔄 Migration Guide
|
||||
|
||||
## v3.0.13 — Pump route event support
|
||||
|
||||
Route intents expose `is_buy` and `ix_name`, using existing trade field names and official IDL names. RapidBuy reports a buy intent and `buy_exact_quote_in_v2`; BuyPumpDelta reports only a buy intent. Multi-hop direction and unknown methods remain null. Currencies remain in `hops[].base_mint` / `quote_mint`. These hints do not confirm execution; filtering does not convert intents into trades.
|
||||
|
||||
Streamer forwards complete route payloads as `DexEvent::PumpRouteIntentEvent` with protocol/event filtering. Old JSON defaults missing hints to unknown. Rust struct literals need the new fields; exhaustive streamer event matches need the new variant.
|
||||
|
||||
## v3.0.12 — Pump routes and offline replay
|
||||
|
||||
Pins sol-parser-sdk 0.7.14 and includes the latest streaming facade code and native hot-path benchmark. The raw parser re-export provides the new Pump route-intent and cached-ALT APIs.
|
||||
|
||||
Route intents describe instructions before execution; use execution metadata for confirmed fills. Offline CPU timings do not measure production transport or transaction landing.
|
||||
|
||||
## v3.0.11 — Pump depth-2 compatibility
|
||||
|
||||
Pins sol-parser-sdk 0.7.13 and inherits signed Pump depth-2 create-event compatibility coverage through the parser bridge. Existing trading and event interfaces remain unchanged.
|
||||
|
||||
Validation includes official Pump SDK 4.1.0 instruction comparisons, signed local LiteSVM simulations and SDK regressions. Local simulation state/config is synthetic; no funded transactions were broadcast and production latency was not measured.
|
||||
|
||||
|
||||
### v3.0.10
|
||||
|
||||
Pins `sol-parser-sdk =0.7.12` and inherits the PumpFun migration event CPI parsing fix. Publishes the current bridge support for compact Pump trades, quote-coin fields, completion and fee-sweep events, protocol fee fields and synthetic migration handling. Includes captured mainnet compact-trade regression fixtures.
|
||||
|
||||
Validation covers the streaming facade, parser bridge and offline transaction fixtures. Network transaction-landing latency is not an SLA.
|
||||
|
||||
### v3.0.9
|
||||
|
||||
- Pins `sol-parser-sdk 0.7.10` and inherits creation account matching, quote-account and historical-layout fixes, verified through the RPC facade and gRPC bridge.
|
||||
|
||||
### v3.0.8
|
||||
|
||||
Pins `sol-parser-sdk 0.7.9` and inherits PumpSwap boost account backfills and precompile log-index fixes. Preserves strict trade matching and ALT account handling. Adds offline mainnet regressions verifying pool vaults, token programs and sell mints through both the RPC facade and gRPC event bridge.
|
||||
|
||||
### v3.0.7
|
||||
|
||||
Uses `sol-parser-sdk 0.7.8`. Preserves CPMM creator-fee collection events, the AmmConfig share rate, swap instruction arguments and Orca/CLMM accounts through the bridge. Includes independent RPC corpus validation for 13 mainnet transactions and 17 target operations. Run `cargo run --example rpc_corpus_validate -- --list` to view signatures.
|
||||
|
||||
### Upgrading to v3.0.6
|
||||
|
||||
Version 3.0.6 pins `sol-parser-sdk 0.7.7`. Advanced callers can access StonkFun route analysis, migration registry and raw account subscriptions through `parser_sdk` / `sdk_bridge::raw`. Raw snapshots retain their parser SDK type and should be consumed directly rather than passed through the legacy streamer event adapter. Bridge regression fixtures are synchronized with the current Whirlpool/DLMM account fields.
|
||||
|
||||
### Upgrading to v3.0.5
|
||||
|
||||
Version 3.0.5 uses `sol-parser-sdk 0.7.5` and forwards the recovered Meteora DAMM v2 swap instruction accounts, including token mints, vaults, payer, token programs, and optional referral. Live mainnet regressions cover both swaps reported in issue #82.
|
||||
|
||||
### Upgrading to v3.0.4
|
||||
|
||||
Version 3.0.4 uses `sol-parser-sdk 0.7.4`, adds the user-facing `Protocol::LaunchLab`, `Protocol::StonkFun`, `ProtocolType::LaunchLab`, and `ProtocolType::StonkFun` identifiers, and filters shared LaunchLab traffic by StonkFun's official platform configuration accounts. LaunchLab trade events now forward complete reserves, fee legs, pool status, and the current three appended accounts. `Protocol::RaydiumLaunchpad` remains a source-compatible alias and displays as `LaunchLab`.
|
||||
|
||||
### Upgrading to v3.0.3
|
||||
|
||||
Version 3.0.3 uses `sol-parser-sdk 0.7.3` and synchronizes the current PumpFun, PumpSwap, and Pump Fees protocol schemas. PumpFun create/trade events and PumpSwap buy/sell/create-pool events now preserve creator-fee and holder-reward fields through the streamer bridge. PumpFun bonding-curve and PumpSwap pool account events also expose the new creator-fee editability and holder-reward state while retaining defaults for legacy accounts and JSON payloads. The parser rejects truncated current PumpSwap trade and CreatePool tails instead of returning partially populated events.
|
||||
|
||||
### Upgrading to v3.0.2
|
||||
|
||||
Version 3.0.2 uses `sol-parser-sdk 0.7.2` and forwards the new Meteora DAMM v2 events: `UpdateDelegatePermission`, `WithdrawDeadLiquidityReward`, `CreateConfig`, and `CreateDynamicConfig`. Transaction-cost events preserve all four Solana V1 config requests, and Yellowstone V1 messages are distinguished from V0 through `Message.config`. V1 ingestion requires a Yellowstone geyser server plugin version of at least `15.1.1`; older servers silently discard the config while downgrading V1 to V0.
|
||||
|
||||
### Upgrading to v3.0.1
|
||||
|
||||
Version 3.0.1 uses `sol-parser-sdk 0.7.1` and fixes current Meteora DAMM v2 Swap and AddLiquidity delivery. The bridge now preserves all current swap fee, transfer-fee, reserve, mode, and liquidity fields; exact AddLiquidity filtering follows the unified on-chain `EvtLiquidityChange` event. Streamer no longer maintains a separate DAMM swap payload decoder, keeping `sol-parser-sdk` as the single parsing implementation. Mainnet RPC regression tests cover both reported event types.
|
||||
|
||||
### Upgrading to v3.0.0
|
||||
|
||||
Version 3.0.0 uses `sol-parser-sdk 0.7.0` and Solana 4 public types. ShredStream Entry decoding now uses `wincode 0.5.5` in production and supports Solana V1 transactions. The normal dependency graph dropped from 677 to 544 package/version entries, while duplicated crate names dropped from 119 to 30 by removing redundant direct Solana/SPL dependencies and aligning versions with the parser. This release requires Rust 1.91 or newer and also forwards Meteora DLMM user token input/output accounts.
|
||||
|
||||
### Upgrading to v2.0.3
|
||||
|
||||
Version 2.0.3 uses `sol-parser-sdk 0.6.6` and pins `spl-pod 0.7.2` to keep fresh, lock-free builds compatible with `spl-list-view 0.1.0`. PumpFun trade events preserve the parser SDK's optional pre/post token balances in raw mint units and pre/post SOL balances in lamports, populated from transaction metadata without additional RPC calls. Meteora DLMM swaps also preserve `min_amount_out` separately from the executed `amount_out`.
|
||||
|
||||
### Upgrading to v2.0.1
|
||||
|
||||
Version 2.0.1 uses `sol-parser-sdk 0.6.1` from crates.io. PumpSwap Buy/Sell events now preserve the complete current cashback, buyback, signed virtual quote reserve, boost, and base-supply tail through dispatcher and SDK bridge paths. Truncated current layouts are rejected consistently by the default and zero-copy parser backends while historical layouts remain supported.
|
||||
|
||||
### Upgrading to v1.5.16
|
||||
|
||||
Version 1.5.16 fixes `StreamingOrdered` delivery for transactions that parse into multiple events. Events from the same `(slot, tx_index)` are admitted as a group, the streaming watermark advances once per transaction, and stable sorting preserves parser order for equal transaction indexes. It also pins `yellowstone-grpc-proto` to the `12.4.x` API used by `sol-parser-sdk 0.5.15` so CI and clean installs do not resolve an incompatible newer proto crate.
|
||||
|
||||
### Upgrading to v1.5.15
|
||||
|
||||
Version 1.5.15 tracks `sol-parser-sdk 0.5.15` at GitHub rev `36ec202`. Pump.fun `create_v2` now distinguishes 16-account SOL-sentinel creates from 19/20-account quote-pool creates, models Yellowstone gRPC loaded writable/readonly addresses correctly, rejects PumpFun program-account fillers as quote mints, and keeps ShredStream from guessing ALT-loaded quote mints when the static transaction keys do not contain them. gRPC/RPC inner instruction parsing now handles guarded 8-byte ordinary CPI instructions for all SDK-supported DEX parsers, so PumpSwap `create_pool` reads `is_cashback_coin` from instruction args before merging with log-derived `CreatePoolEvent` output. ShredStream remains outer-instruction only, but its outer discriminator gate is shared with the SDK parser and no longer diverges for supported DEX protocols.
|
||||
|
||||
### Upgrading to v1.5.14
|
||||
|
||||
Version 1.5.14 uses `sol-parser-sdk 0.5.14` from crates.io. Pump.fun canonical create events now expose `quote_mint`, `quote_vault`, and `quote_token_program` for `create_v2` quote pools, including USDC pools, across gRPC/RPC parser bridge and ShredStream-backed SDK output.
|
||||
|
||||
### Upgrading to v1.5.13
|
||||
|
||||
Version 1.5.13 uses `sol-parser-sdk 0.5.13` from crates.io. Pump.fun gRPC and ShredStream create/trade outputs now preserve real WSOL quote mints (`So11111111111111111111111111111111111111112`). The Solscan SOL sentinel (`So11111111111111111111111111111111111111111`) is used only when legacy data omits a quote mint.
|
||||
|
||||
### Upgrading to v1.5.11
|
||||
|
||||
Version 1.5.11 uses `sol-parser-sdk 0.5.11` from crates.io. PumpSwap `PumpSwapCreatePoolEvent` now carries `is_cashback_coin` when it is available from the `create_pool` instruction args, including ShredStream outer-instruction parsing. Log-only `CreatePoolEvent` payloads still default this field to `false` because the on-chain log event IDL does not carry it. `AccountPumpSwapPool` remains the authoritative account-state source for the pool flag.
|
||||
|
||||
### Upgrading to v1.5.10
|
||||
|
||||
Version 1.5.10 uses `sol-parser-sdk 0.5.10` from crates.io. PumpSwap `CreatePoolEvent` now matches the on-chain IDL: it exposes `is_mayhem_mode` but does not expose `is_cashback_coin`. To read the cashback flag, subscribe to `AccountPumpSwapPool` and use `PumpSwapPoolAccountEvent.pool.is_cashback_coin`. The PumpSwap CreatePool log payload length check now includes the final `is_mayhem_mode` byte.
|
||||
|
||||
### Upgrading to v1.5.9
|
||||
|
||||
Version 1.5.9 uses `sol-parser-sdk 0.5.9` from crates.io. It inherits the Yellowstone gRPC stop lifecycle fix: `stop()` now signals, aborts, and awaits the active subscription task, subscription lifecycle transitions are serialized, and gRPC stream errors are labeled as `Grpc Stream error` for easier log separation from ShredStream.
|
||||
|
||||
### Upgrading to v1.5.8
|
||||
|
||||
Version 1.5.8 uses `sol-parser-sdk 0.5.8` from crates.io. It inherits the Pump.fun ShredStream filter-family semantics from the parser SDK: `PumpFunBuy` covers `buy`, `buy_v2`, `buy_exact_sol_in`, and `buy_exact_quote_in_v2`; `PumpFunSell` covers `sell` and `sell_v2`; and `PumpFunTrade` covers all buy/sell instructions while the parser can emit unified trade events when only the generic trade filter is requested.
|
||||
|
||||
### Upgrading to v1.5.5
|
||||
|
||||
Version 1.5.5 uses `sol-parser-sdk 0.5.5` from crates.io. The SDK exposes LaunchLab as `RaydiumLaunchlab*`; streamer keeps the existing `Bonk*` event structs and `Protocol::Bonk` / `Protocol::RaydiumLaunchpad` aliases for source compatibility, while routing parser calls and upstream gRPC event filters to the new LaunchLab SDK variants. This release also syncs the CLMM/CPMM/Orca account bridges, Meteora DAMM v2 initialize-pool events, Meteora DBC events, and parser warmup on client creation.
|
||||
|
||||
### Upgrading to v1.5.4
|
||||
|
||||
Version 1.5.4 uses `sol-parser-sdk 0.5.4` from crates.io. Pump.fun `create` and `create_v2` are delivered as one canonical `PumpFunCreateTokenEvent`; subscribing to either `PumpFunCreateToken` or `PumpFunCreateV2Token` receives the same complete create-family data. This prevents duplicate new-mint callbacks from gRPC log + instruction parsing while preserving create_v2 account fields on the canonical create event.
|
||||
|
||||
### Upgrading to v1.5.3
|
||||
|
||||
Version 1.5.3 uses `sol-parser-sdk 0.5.3` from crates.io. It preserves real Pump.fun v2 `ix_name` values through the streamer bridge, improves ShredStream Pump.fun v2 best-effort parsing for short account lists, and treats `PumpFunBuy` and `PumpFunBuyExactSolIn` subscriptions as compatible buy-family filters. ShredStream still uses the direct entry-reading path with automatic reconnect; callbacks should remain non-blocking and `tx_index` remains entry-local best-effort.
|
||||
|
||||
### Upgrading to v1.5.2
|
||||
|
||||
Version 1.5.2 uses `sol-parser-sdk 0.5.2` from crates.io. ShredStream delivery uses the SDK parser on a direct entry-reading path with automatic reconnect, avoiding the extra queue consumer task while keeping parser event buffers reused. ShredStream `tx_index` is entry-local best-effort, not the Yellowstone slot-level transaction index. User callbacks on the direct path run on the read task and should avoid blocking work.
|
||||
|
||||
### Upgrading to v1.5.1
|
||||
|
||||
Version 1.5.1 uses `sol-parser-sdk 0.5.1` from crates.io. It improves ShredStream ALT handling by parsing outer instructions best-effort with default placeholders for ALT-loaded accounts, adds dropped-event queue observability, and keeps CPI/inner-only events documented as a ShredStream limitation.
|
||||
|
||||
### Upgrading to v1.5.0
|
||||
|
||||
Version 1.5.0 uses `sol-parser-sdk 0.5.0`, wires Raydium CLMM account parsing through the SDK bridge, and reduces ordered-buffer allocation/move overhead in low-latency delivery paths. `sol-parser-sdk 0.4.19` and `solana-streamer-sdk 1.4.14` were superseded because adding public parser event variants belongs in the 0.5 line.
|
||||
|
||||
### Upgrading to v1.4.14
|
||||
|
||||
Version 1.4.14 was superseded by v1.5.0.
|
||||
|
||||
### Upgrading to v1.4.13
|
||||
|
||||
Version 1.4.13 uses `sol-parser-sdk 0.4.18` and updates Raydium CLMM integration to the official upgraded IDL: current log-side event discriminators, official Swap/Liquidity/Create/Collect layouts, limit-order events, dynamic-fee related events, and the reshaped PoolState/TickState account structs.
|
||||
|
||||
### Upgrading to v1.4.12
|
||||
|
||||
Version 1.4.12 uses `sol-parser-sdk 0.4.17` and normalizes legacy PumpFun SOL quote mints to the Solscan SOL sentinel while preserving real USDC quote mints and quote-reserve fields. Streamer bridge and merger paths keep the parser SDK semantics aligned for Yellowstone gRPC and ShredStream output.
|
||||
|
||||
New optional capabilities:
|
||||
|
||||
- `solana_streamer_sdk::parser_sdk` re-exports the raw `sol-parser-sdk` crate.
|
||||
- `solana_streamer_sdk::sdk_bridge` adapts raw SDK events back into streamer `DexEvent`.
|
||||
- `fetch_rpc_transaction_as_streamer_events` and `parse_encoded_rpc_transaction_as_streamer_events` parse RPC transactions into streamer events.
|
||||
- `grpc::ClientConfig::order_mode` supports `Unordered`, `Ordered`, `StreamingOrdered`, and `MicroBatch`.
|
||||
- `sdk-parse-zero-copy` enables the SDK zero-copy parser backend.
|
||||
|
||||
### Migrating from v0.5.x to v1.x.x
|
||||
|
||||
Version 1.0.0 introduces a major architectural change from trait-based event handling to enum-based events. This provides better type safety, improved performance, and simpler code patterns.
|
||||
|
||||
**Key Changes:**
|
||||
|
||||
1. **Event Type Changed** - `Box<dyn UnifiedEvent>` → `DexEvent` enum
|
||||
2. **Callback Signature** - Callbacks now receive concrete `DexEvent` instead of trait objects
|
||||
3. **Event Matching** - Use standard Rust `match` instead of `match_event!` macro
|
||||
4. **Metadata Access** - Event properties now accessed through `.metadata()` method
|
||||
|
||||
**Quick Migration Example:**
|
||||
|
||||
```rust
|
||||
// Old (v0.5.x)
|
||||
let callback = |event: Box<dyn UnifiedEvent>| {
|
||||
println!("Event: {:?}", event.event_type());
|
||||
};
|
||||
|
||||
// New (v1.x.x)
|
||||
let callback = |event: DexEvent| {
|
||||
println!("Event: {:?}", event.metadata().event_type);
|
||||
};
|
||||
```
|
||||
|
||||
## ⚙️ Configuration System
|
||||
|
||||
You can customize client configuration:
|
||||
|
||||
```rust
|
||||
use solana_streamer_sdk::streaming::{
|
||||
grpc::{ClientConfig, OrderMode},
|
||||
YellowstoneGrpc,
|
||||
};
|
||||
|
||||
// Use default configuration
|
||||
let grpc = YellowstoneGrpc::new(endpoint, token)?;
|
||||
|
||||
// Or create custom configuration
|
||||
let mut config = ClientConfig::default();
|
||||
config.enable_metrics = true; // Enable performance monitoring
|
||||
config.connection.connect_timeout = 30; // 30 seconds
|
||||
config.connection.request_timeout = 120; // 120 seconds
|
||||
config.order_mode = OrderMode::MicroBatch; // Unordered / Ordered / StreamingOrdered / MicroBatch
|
||||
config.order_timeout_ms = 100;
|
||||
config.micro_batch_us = 100;
|
||||
|
||||
let grpc = YellowstoneGrpc::new_with_config(endpoint, token, config)?;
|
||||
```
|
||||
|
||||
**Available Configuration Options:**
|
||||
- `enable_metrics`: Enable/disable performance monitoring (default: false)
|
||||
- `connection.connect_timeout`: Connection timeout in seconds (default: 10)
|
||||
- `connection.request_timeout`: Request timeout in seconds (default: 60)
|
||||
- `connection.max_decoding_message_size`: Maximum message size in bytes (default: 10MB)
|
||||
- `order_mode`: Transaction event output ordering mode (default: `Unordered`)
|
||||
- `order_timeout_ms`: Flush timeout for `Ordered` and `StreamingOrdered` modes (default: 100)
|
||||
- `micro_batch_us`: Micro-batch window for `MicroBatch` mode (default: 100)
|
||||
|
||||
### Minimal gRPC Subscription
|
||||
|
||||
```rust
|
||||
use solana_streamer_sdk::streaming::{
|
||||
event_parser::{
|
||||
common::{filter::EventTypeFilter, EventType},
|
||||
core::EventDispatcher,
|
||||
DexEvent, Protocol,
|
||||
},
|
||||
yellowstone_grpc::{AccountFilter, TransactionFilter},
|
||||
YellowstoneGrpc,
|
||||
};
|
||||
|
||||
let grpc = YellowstoneGrpc::new(endpoint, token)?;
|
||||
|
||||
let protocols = vec![
|
||||
Protocol::PumpFun,
|
||||
Protocol::PumpFees,
|
||||
Protocol::PumpSwap,
|
||||
Protocol::RaydiumLaunchpad,
|
||||
Protocol::RaydiumCpmm,
|
||||
Protocol::RaydiumClmm,
|
||||
Protocol::RaydiumAmmV4,
|
||||
Protocol::OrcaWhirlpool,
|
||||
Protocol::MeteoraPools,
|
||||
Protocol::MeteoraDammV2,
|
||||
Protocol::MeteoraDlmm,
|
||||
];
|
||||
|
||||
let program_ids = EventDispatcher::get_program_ids(&protocols)
|
||||
.into_iter()
|
||||
.map(|pubkey| pubkey.to_string())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let transaction_filter = TransactionFilter {
|
||||
account_include: program_ids.clone(),
|
||||
account_exclude: vec![],
|
||||
account_required: vec![],
|
||||
};
|
||||
let account_filter = AccountFilter { account: vec![], owner: program_ids, filters: vec![] };
|
||||
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFunBuy,
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::BonkBuyExactIn,
|
||||
EventType::RaydiumCpmmSwapBaseInput,
|
||||
EventType::MeteoraDlmmSwap,
|
||||
]));
|
||||
|
||||
grpc.subscribe_events_immediate(
|
||||
protocols,
|
||||
None,
|
||||
vec![transaction_filter],
|
||||
vec![account_filter],
|
||||
event_type_filter,
|
||||
None,
|
||||
|event: DexEvent| {
|
||||
println!("{:?}", event.metadata().event_type);
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
<a id="usage-examples"></a>
|
||||
|
||||
## 📚 Usage Examples
|
||||
|
||||
@@ -479,8 +163,7 @@ grpc.subscribe_events_immediate(
|
||||
| Parse PumpFun quote-mint cases from RPC | `TX_SIGNATURES=<sig1,sig2> cargo run --example parse_pumpfun_quote_cases --release` | [examples/parse_pumpfun_quote_cases.rs](examples/parse_pumpfun_quote_cases.rs) |
|
||||
| Parse PumpSwap transaction from RPC | `cargo run --example parse_pumpswap_tx --release` | [examples/parse_pumpswap_tx.rs](examples/parse_pumpswap_tx.rs) |
|
||||
| Parse Meteora DAMM v2 transaction from RPC | `TX_SIGNATURE=<sig> cargo run --example parse_meteora_damm_tx --release` | [examples/parse_meteora_damm_tx.rs](examples/parse_meteora_damm_tx.rs) |
|
||||
| Debug PumpFun transaction (fetch, print meta/logs, parse) | `TX_SIGNATURE=<sig> cargo run --example debug_pump_tx --release` | [examples/debug_pump_tx.rs](examples/debug_pump_tx.rs) |
|
||||
| Debug PumpSwap transaction (fetch, print meta, parse) | `TX_SIGNATURE=<sig> cargo run --example debug_pumpswap_tx --release` | [examples/debug_pumpswap_tx.rs](examples/debug_pumpswap_tx.rs) |
|
||||
| Fetch any transaction and replay offline (preserves raw meta/logs/accounts) | `cargo run --example rpc_transaction_replay -- --fetch <SIGNATURE> /tmp/transaction.json` | [examples/rpc_transaction_replay.rs](examples/rpc_transaction_replay.rs) |
|
||||
| Update filters at runtime | `cargo run --example dynamic_subscription` | [examples/dynamic_subscription.rs](examples/dynamic_subscription.rs) |
|
||||
| Quick test: subscribe to PumpFun, print first 10 or run 60s | `cargo run --example pumpfun_quick_test --release` | [examples/pumpfun_quick_test.rs](examples/pumpfun_quick_test.rs) |
|
||||
| PumpFun trade filter: Buy/Sell/Create with latency | `cargo run --example pumpfun_trade_filter --release` | [examples/pumpfun_trade_filter.rs](examples/pumpfun_trade_filter.rs) |
|
||||
@@ -593,6 +276,115 @@ instruction args, while log-only `CreatePoolEvent` payloads keep the default
|
||||
account value is also available from
|
||||
`PumpSwapPoolAccountEvent.pool.is_cashback_coin`.
|
||||
|
||||
<a id="trade-provenance-and-parsing-boundaries"></a>
|
||||
|
||||
## Trade provenance and parsing boundaries
|
||||
|
||||
gRPC/RPC use supplied execution metadata and actual CPI instructions; Shred sees outer instructions and locally resolved accounts. An unknown third-party instruction referencing Pump.fun in its own accounts can produce a `PumpFunTrade` candidate with the original input in `third_program` and `Unresolved` status. This does not establish execution, direction or amounts. Buy/sell-only filters do not treat an unknown direction as a fill.
|
||||
|
||||
The parsing hot path performs no RPC. Check `parse_status` before interpreting defaults as amounts. Original account order and instruction bytes remain in `third_program`; transaction position and receive time remain in event metadata. A local Shred index is not confirmed slot-wide execution order. See [wrapped transactions](docs/wrapped-pumpfun.md).
|
||||
|
||||
<a id="configuration-system"></a>
|
||||
|
||||
## ⚙️ Configuration System
|
||||
|
||||
You can customize client configuration:
|
||||
|
||||
```rust
|
||||
use solana_streamer_sdk::streaming::{
|
||||
grpc::{ClientConfig, OrderMode},
|
||||
YellowstoneGrpc,
|
||||
};
|
||||
|
||||
// Use default configuration
|
||||
let grpc = YellowstoneGrpc::new(endpoint, token)?;
|
||||
|
||||
// Or create custom configuration
|
||||
let mut config = ClientConfig::default();
|
||||
config.enable_metrics = true; // Enable performance monitoring
|
||||
config.connection.connect_timeout = 30; // 30 seconds
|
||||
config.connection.request_timeout = 120; // 120 seconds
|
||||
config.order_mode = OrderMode::MicroBatch; // Unordered / Ordered / StreamingOrdered / MicroBatch
|
||||
config.order_timeout_ms = 100;
|
||||
config.micro_batch_us = 100;
|
||||
|
||||
let grpc = YellowstoneGrpc::new_with_config(endpoint, token, config)?;
|
||||
```
|
||||
|
||||
**Available Configuration Options:**
|
||||
- `enable_metrics`: Enable/disable performance monitoring (default: false)
|
||||
- `connection.connect_timeout`: Connection timeout in seconds (default: 10)
|
||||
- `connection.request_timeout`: Request timeout in seconds (default: 60)
|
||||
- `connection.max_decoding_message_size`: Maximum message size in bytes (default: 10MB)
|
||||
- `order_mode`: Transaction event output ordering mode (default: `Unordered`)
|
||||
- `order_timeout_ms`: Flush timeout for `Ordered` and `StreamingOrdered` modes (default: 100)
|
||||
- `micro_batch_us`: Micro-batch window for `MicroBatch` mode (default: 100)
|
||||
|
||||
### Minimal gRPC Subscription
|
||||
|
||||
```rust
|
||||
use solana_streamer_sdk::streaming::{
|
||||
event_parser::{
|
||||
common::{filter::EventTypeFilter, EventType},
|
||||
core::EventDispatcher,
|
||||
DexEvent, Protocol,
|
||||
},
|
||||
yellowstone_grpc::{AccountFilter, TransactionFilter},
|
||||
YellowstoneGrpc,
|
||||
};
|
||||
|
||||
let grpc = YellowstoneGrpc::new(endpoint, token)?;
|
||||
|
||||
let protocols = vec![
|
||||
Protocol::PumpFun,
|
||||
Protocol::PumpFees,
|
||||
Protocol::PumpSwap,
|
||||
Protocol::RaydiumLaunchpad,
|
||||
Protocol::RaydiumCpmm,
|
||||
Protocol::RaydiumClmm,
|
||||
Protocol::RaydiumAmmV4,
|
||||
Protocol::OrcaWhirlpool,
|
||||
Protocol::MeteoraPools,
|
||||
Protocol::MeteoraDammV2,
|
||||
Protocol::MeteoraDlmm,
|
||||
];
|
||||
|
||||
let program_ids = EventDispatcher::get_program_ids(&protocols)
|
||||
.into_iter()
|
||||
.map(|pubkey| pubkey.to_string())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let transaction_filter = TransactionFilter {
|
||||
account_include: program_ids.clone(),
|
||||
account_exclude: vec![],
|
||||
account_required: vec![],
|
||||
};
|
||||
let account_filter = AccountFilter { account: vec![], owner: program_ids, filters: vec![] };
|
||||
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFunBuy,
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::BonkBuyExactIn,
|
||||
EventType::RaydiumCpmmSwapBaseInput,
|
||||
EventType::MeteoraDlmmSwap,
|
||||
]));
|
||||
|
||||
grpc.subscribe_events_immediate(
|
||||
protocols,
|
||||
None,
|
||||
vec![transaction_filter],
|
||||
vec![account_filter],
|
||||
event_type_filter,
|
||||
None,
|
||||
|event: DexEvent| {
|
||||
println!("{:?}", event.metadata().event_type);
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
|
||||
<a id="dynamic-subscription-management"></a>
|
||||
|
||||
## Dynamic Subscription Management
|
||||
|
||||
Update subscription filters at runtime without reconnecting to the stream.
|
||||
@@ -620,6 +412,8 @@ grpc.update_subscription(
|
||||
|
||||
Note: Multiple subscription attempts on the same client return an error.
|
||||
|
||||
<a id="supported-protocols"></a>
|
||||
|
||||
## 🔧 Supported Protocols
|
||||
|
||||
- **PumpFun**: Primary meme coin trading platform
|
||||
@@ -627,7 +421,7 @@ Note: Multiple subscription attempts on the same client return an error.
|
||||
- **PumpSwap**: PumpFun's swap protocol
|
||||
- **LaunchLab**: Token launch platform; `Bonk` and `RaydiumLaunchpad` are kept as compatibility aliases
|
||||
- **StonkFun**: StonkFun-attributed LaunchLab trade and pool-create events
|
||||
- **Raydium CPMM**: Raydium's Concentrated Pool Market Maker protocol
|
||||
- **Raydium CPMM**: Raydium's Constant Product Market Maker protocol
|
||||
- **Raydium CLMM**: Raydium's Concentrated Liquidity Market Maker protocol
|
||||
- **Raydium AMM V4**: Raydium's Automated Market Maker V4 protocol
|
||||
- **Meteora DAMM v2**: Meteora DAMM v2 protocol
|
||||
@@ -637,11 +431,15 @@ Note: Multiple subscription attempts on the same client return an error.
|
||||
- **Meteora DLMM**: Meteora Dynamic Liquidity Market Maker protocol
|
||||
- **Common/account events**: Token accounts, token metadata, nonce accounts, block metadata, ComputeBudget events, and supported protocol account states such as Raydium CLMM/CPMM, Pump/PumpSwap, and Orca Whirlpool accounts
|
||||
|
||||
<a id="event-streaming-services"></a>
|
||||
|
||||
## 🌐 Event Streaming Services
|
||||
|
||||
- **Yellowstone gRPC**: High-performance Solana event streaming
|
||||
- **ShredStream**: Alternative event streaming protocol
|
||||
|
||||
<a id="architecture-features"></a>
|
||||
|
||||
## 🏗️ Architecture Features
|
||||
|
||||
### Unified Event Interface
|
||||
@@ -662,6 +460,8 @@ Note: Multiple subscription attempts on the same client return an error.
|
||||
- **ShredStream Client**: Alternative streaming implementation
|
||||
- **Async Processing**: Non-blocking event handling
|
||||
|
||||
<a id="project-structure"></a>
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
```
|
||||
@@ -684,6 +484,8 @@ src/
|
||||
└── main.rs # Example program
|
||||
```
|
||||
|
||||
<a id="performance-considerations"></a>
|
||||
|
||||
## ⚡ Performance Considerations
|
||||
|
||||
1. **Connection Management**: Properly handle connection lifecycle and reconnection
|
||||
@@ -694,18 +496,7 @@ src/
|
||||
6. **Performance Monitoring**: Enable performance monitoring to identify bottlenecks and optimization opportunities
|
||||
7. **Graceful Shutdown**: Use the stop() method for clean shutdown and implement signal handlers for proper resource cleanup
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License
|
||||
|
||||
## 📞 Contact
|
||||
|
||||
- **Website**: https://fnzero.dev/
|
||||
- **Project Repository**: https://github.com/0xfnzero/solana-streamer
|
||||
- **Telegram Group**: https://t.me/fnzero_group
|
||||
- **Discord**: https://discord.gg/vuazbGkqQE
|
||||
<a id="important-notes"></a>
|
||||
|
||||
## ⚠️ Important Notes
|
||||
|
||||
@@ -714,20 +505,17 @@ MIT License
|
||||
3. **Error Recovery**: Implement proper error handling and reconnection logic
|
||||
5. **Compliance**: Ensure compliance with relevant laws and regulations
|
||||
|
||||
## Language Versions
|
||||
|
||||
- [English](README.md)
|
||||
- [中文](README_CN.md)
|
||||
|
||||
<a id="pump-upgrade-october-2026"></a>
|
||||
|
||||
## Pump upgrade (October 2026)
|
||||
|
||||
Compact Pump v3 and PumpSwap v2 trades use their new 17-account layouts. New typed events cover `PumpFunPostCompleteBuy`, `PumpFunComplete`, `PumpFunSweepBondingCurveFee` and `PumpSwapSweepPoolFee`, with program-scoped log and CPI parsing. Historical SOL CompleteEvent payloads remain supported. Curve/pool retained fees and synthetic counters are exposed; optional historical tails default to zero.
|
||||
|
||||
For a synthetic completing buy, retain TradeEvent **and** PostCompleteBuyEvent and aggregate execution amounts within the same invocation. CompleteEvent is the completion notification. For `multi_hop_swap`, retain each venue's trade events; different venues are not merged into one fill. The multi-hop intent decoder exposes the fixed user accounts, input/minimum limits and 5 roles per hop; these limits are not actual executed amounts. Streamer forwards the typed events and account fields through its parser bridge (its re-exported `parser_sdk` also provides the intent decoder).
|
||||
For completing buys, aggregate TradeEvent and PostCompleteBuyEvent amounts within the same invocation. CompleteEvent is a notification. Multi-hop execution retains each venue’s trade events in order; separate venues are not merged into one fill. There is no route-intent decoder or raw-event callback. Shred candidates carry original wrapper input in third_program and remain unresolved; gRPC/RPC uses actual execution metadata.
|
||||
|
||||
Reference: [pump-public-docs](https://github.com/pump-fun/pump-public-docs/tree/8cda1fa30ea658b20909d8aedf002047119388d2). Validation uses offline official IDL fixtures; no live trade is sent by the tests.
|
||||
|
||||
<a id="reproducible-local-hot-path-latency"></a>
|
||||
|
||||
## Reproducible local hot-path latency
|
||||
|
||||
@@ -745,3 +533,36 @@ same configuration and fixtures before comparing changes.
|
||||
The workload measures the public Pump trade event bridge, with and without a
|
||||
recent blockhash. Input cloning happens outside the measured interval; output
|
||||
destruction is included. This is CPU conversion latency, not network latency.
|
||||
|
||||
<a id="documentation"></a>
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Release and migration](RELEASE_NOTES.md)
|
||||
- [Usage guide](docs/wrapped-pumpfun.md)
|
||||
|
||||
<a id="language-versions"></a>
|
||||
|
||||
## Language Versions
|
||||
|
||||
- [English](README.md)
|
||||
- [中文](README_CN.md)
|
||||
|
||||
|
||||
<a id="license"></a>
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License
|
||||
|
||||
<a id="contact"></a>
|
||||
|
||||
## 📞 Contact
|
||||
|
||||
- **Website**: https://fnzero.dev/
|
||||
- **Project Repository**: https://github.com/0xfnzero/solana-streamer
|
||||
- **Telegram Group**: https://t.me/fnzero_group
|
||||
- **Discord**: https://discord.gg/vuazbGkqQE
|
||||
|
||||
|
||||
Shared stock bridges: 34 official stock/ETF mints and 63 pools. See [eleven-SDK catalog and routing alignment](docs/STOCK_BRIDGE_SYNC.md) for configuration, USDC routing and cache-only boundaries.
|
||||
|
||||
+237
-415
@@ -1,102 +1,93 @@
|
||||
当前版本:**4.0.0**。本轮同步 SDK、原生语言测试、示例及文档。升级说明见 [RELEASE_NOTES.md](RELEASE_NOTES.md)。
|
||||
|
||||
<div align="center">
|
||||
|
||||
## v3.0.17 — Pump.fun 第三方来源透传与解析修复
|
||||
|
||||
更新 sol-parser-sdk 至 0.7.19,Pump.fun 事件桥接保留可选的 `third_program` 第三方来源。同步按 mint 识别创建后买入及保留 IDL 版本化方法名的修复。第三方规则仍须显式启用,解析热路径不调用 RPC。
|
||||
|
||||
[第三方 Pump.fun 包装指令:离线规则、热路径边界与真实交易回放](docs/wrapped-pumpfun.md)
|
||||
|
||||
## v3.0.16 — Shred 元数据透传与顺序范围
|
||||
|
||||
保留并验证 `tx_index`、接收时间从解析入口传到原始指令回调。明确 Entries 消息内序号与 Yellowstone 节点 index 的区别:本地序号不是全 slot 索引;跨消息去重使用交易签名。此版本完善文档和回归保护,不改变现有字段或编号规则。
|
||||
|
||||
|
||||
## v3.0.16 — RawInstruction 协议过滤与 DEX 枚举
|
||||
|
||||
修复原始指令绕过 DEX 订阅范围的问题。按单条指令引用的官方程序识别 DEX,使用 `RawInstructionDexType` 枚举;JSON 字符串保持不变。未知 router 不推断池子地址、买卖方向或方法版本。
|
||||
|
||||
|
||||
## v3.0.16 — Pump 执行事件与最新回放示例
|
||||
|
||||
修复官方 Anchor CPI TradeEvent 前缀识别,保留历史编码兼容。RPC/gRPC 的实际 `sol_amount`、`quote_amount`、`token_amount` 只从执行事件合并;预算和最小输出保留在指令参数字段。如果日志及事件 CPI 均缺失,实际金额字段为 0(表示无执行数据,不代表已确认零成交)。非 SOL 报价金额不能当作 SOL。
|
||||
|
||||
在本仓库运行 `cargo run --offline --example rpc_transaction_replay`,离线回放 2026-10-19 重新抓取的真实交易。默认样本为 Delta SellV2;使用 `--fetch SIGNATURE OUTPUT.json` 抓取另一笔,再用 `--fixture OUTPUT.json` 回放。通过 `SOLANA_RPC_URL` 选择 RPC,支持 transaction v1。
|
||||
|
||||
新 Delta 卖出样本:`4ARos3Yq1SMNE3izDpy9YdKrRgMmD7UCDxvnVrBRaGCJHiifPHSmQWc4DPfjUaEUcxS7puGmEN64K7EZdeXLJaj2`,slot 458542546。旧的五种双跳组合仅作为回归样本,未冒充本次新抓取交易。
|
||||
|
||||
## v3.0.16 — Shred 原始指令透传
|
||||
|
||||
协议过滤同时作用于原始指令的 DEX 关联和已解码事件。
|
||||
|
||||
默认 Shred 入口将未适配的第三方程序(包括 Rapid/Delta)作为 `RawInstruction` 返回,不再推断买卖方向、金额或内部 buy 版本。System、Token、ATA、ComputeBudget 等基础程序默认不透传;已支持的官方 DEX 指令继续正常解析,官方 Pump/PumpSwap 多跳仍返回 `PumpRouteIntent`。
|
||||
|
||||
事件包含 `program_id`、`instruction_index`、`accounts`、`account_indices`、`instruction_data` 和交易 metadata。账户保留原顺序与重复项;未解析 ALT 地址为 null/None,原始索引仍保留。使用缓存 loaded-addresses/resolver 补齐,热路径不请求 RPC。data 是完整原始字节,不要求已知布局。
|
||||
|
||||
原始事件保留调用方传入的 `metadata.tx_index` 和 `metadata.grpc_recv_us`(streamer 对应 `metadata.recv_us`)。默认 Entries 客户端的交易序号仅在单条接收消息内递增,下一条消息从 0 重新计数,不等于已确认的整个 slot 交易序号。`instruction_index` 表示交易内外层指令顺序;接收时间是本地微秒时间戳,不保证链上执行顺序。独立回放 API 可能默认填 0,调用时应传入上游已有的序号与接收时间。
|
||||
|
||||
无过滤器时返回未知第三方指令。宽泛交易/Swap 订阅(如 `PumpFunTrade`、`RaydiumCpmmSwap`)也返回关联该 DEX 的原始指令;买/卖方向订阅不推测方向。显式 `RawInstruction` 仅在未限制协议时返回全部外层指令,streamer 的协议限制始终生效;显式排除 `RawInstruction` 优先。`dex_type` 使用公开枚举 `RawInstructionDexType`(Go 为命名字符串类型与常量);JSON 仍为 `"pumpfun"`、`"raydium_cpmm"` 等原有字符串。`dexes` 数组包含各关联 DEX 的 `{ dex_type, program_id, pool }`,只识别本条指令直接调用或账户中引用的 DEX 程序,不借用同笔其他指令的账户;多 DEX 包装保留所有关联。未知或未解析 ALT 中的程序不能匹配 DEX 订阅。`pool` 当前为 null:未知包装布局无法确定池子账户。program 引用不证明执行了 CPI,原始回调不是成交。
|
||||
|
||||
已有 wrapper 适配函数仅作为显式调用的兼容接口保留,不参与默认 Shred 解码。以下已发布版本的历史说明描述旧行为。
|
||||
|
||||
<h1>🌊 Solana Streamer</h1>
|
||||
<h3><em>从 Solana DEX 交易程序实时流式传输事件。</em></h3>
|
||||
<h1>Solana Streamer</h1>
|
||||
<p>基于 sol-parser-sdk 的 Rust 事件订阅接口</p>
|
||||
<a href="https://crates.io/crates/solana-streamer-sdk"><img src="https://img.shields.io/crates/v/solana-streamer-sdk.svg" alt="solana-streamer-sdk"></a>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<strong>一个基于 sol-parser-sdk 的轻量级 Rust 流式封装库,提供低延迟订阅能力,并保持面向 Bot 用户的稳定 API。</strong>
|
||||
<a href="README.md">English</a> · <a href="README_CN.md">中文</a> ·
|
||||
<a href="#使用示例">示例</a> ·
|
||||
<a href="docs/wrapped-pumpfun.md">文档</a> ·
|
||||
<a href="RELEASE_NOTES.md">发布与迁移</a> ·
|
||||
<a href="#related-sdks">相关 SDK</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://crates.io/crates/solana-streamer-sdk">
|
||||
<img src="https://img.shields.io/crates/v/solana-streamer-sdk.svg" alt="Crates.io">
|
||||
</a>
|
||||
<a href="https://docs.rs/solana-streamer-sdk">
|
||||
<img src="https://docs.rs/solana-streamer-sdk/badge.svg" alt="Documentation">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer">
|
||||
<img src="https://img.shields.io/github/stars/0xfnzero/solana-streamer?style=social" alt="GitHub stars">
|
||||
</a>
|
||||
<a href="https://github.com/0xfnzero/solana-streamer/network">
|
||||
<img src="https://img.shields.io/github/forks/0xfnzero/solana-streamer?style=social" alt="GitHub forks">
|
||||
</a>
|
||||
</p>
|
||||
封装 gRPC 与 ShredStream 订阅、事件过滤和动态订阅管理,保留底层解析器的交易来源与元数据。
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white" alt="Rust">
|
||||
<img src="https://img.shields.io/badge/Solana-9945FF?style=for-the-badge&logo=solana&logoColor=white" alt="Solana">
|
||||
<img src="https://img.shields.io/badge/Streaming-FF6B6B?style=for-the-badge&logo=livestream&logoColor=white" alt="Real-time Streaming">
|
||||
<img src="https://img.shields.io/badge/gRPC-4285F4?style=for-the-badge&logo=grpc&logoColor=white" alt="gRPC">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="README_CN.md">中文</a> |
|
||||
<a href="README.md">English</a> |
|
||||
<a href="https://fnzero.dev/">Website</a> |
|
||||
<a href="https://t.me/fnzero_group">Telegram</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
当前版本:**5.0.0**。升级前请阅读 [迁移说明](RELEASE_NOTES.md);历史变更见 [版本记录](CHANGELOG_CN.md)。
|
||||
|
||||
## 目录
|
||||
|
||||
- [🚀 项目特性](#-项目特性)
|
||||
- [⚡ 安装](#-安装)
|
||||
- [🔄 迁移指南](#-迁移指南)
|
||||
- [⚙️ 配置系统](#️-配置系统)
|
||||
- [📚 使用示例](#-使用示例)
|
||||
- [🔧 支持的协议](#-支持的协议)
|
||||
- [🌐 事件流服务](#-事件流服务)
|
||||
- [🏗️ 架构特性](#️-架构特性)
|
||||
- [📁 项目结构](#-项目结构)
|
||||
- [⚡ 性能考虑](#-性能考虑)
|
||||
- [📄 许可证](#-许可证)
|
||||
- [📞 联系方式](#-联系方式)
|
||||
- [⚠️ 重要注意事项](#️-重要注意事项)
|
||||
- [相关 SDK](#related-sdks)
|
||||
- [安装](#安装)
|
||||
- [这个 SDK 适合什么场景](#这个-sdk-适合什么场景)
|
||||
- [项目特性](#项目特性)
|
||||
- [使用示例](#使用示例)
|
||||
- [交易来源与解析边界](#交易来源与解析边界)
|
||||
- [支持的协议](#支持的协议)
|
||||
- [文档导航](#文档导航)
|
||||
- [配置系统](#配置系统)
|
||||
- [动态订阅管理](#动态订阅管理)
|
||||
|
||||
<a id="related-sdks"></a>
|
||||
|
||||
## 相关 SDK
|
||||
|
||||
各仓库版本独立,依赖兼容要求以对应 SDK 的安装说明为准。
|
||||
|
||||
| 语言 | 仓库 | 用途 | 版本 |
|
||||
|----------|------------|-------------|---------|
|
||||
| Rust | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) | DEX 交易与账户事件解析 | `v0.9.0` |
|
||||
| Node.js | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) | DEX 交易与账户事件解析 | `v0.9.0` |
|
||||
| Python | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) | DEX 交易与账户事件解析 | `v0.9.0` |
|
||||
| Go | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) | DEX 交易与账户事件解析 | `v0.9.0` |
|
||||
| Rust | [sol-trade-sdk](https://github.com/0xfnzero/sol-trade-sdk) | 交易构建、签名与多通道提交 | `v9.0.0` |
|
||||
| Node.js | [sol-trade-sdk-nodejs](https://github.com/0xfnzero/sol-trade-sdk-nodejs) | 交易构建、签名与多通道提交 | `v9.0.0` |
|
||||
| Python | [sol-trade-sdk-python](https://github.com/0xfnzero/sol-trade-sdk-python) | 交易构建、签名与多通道提交 | `v9.0.0` |
|
||||
| Go | [sol-trade-sdk-golang](https://github.com/0xfnzero/sol-trade-sdk-golang) | 交易构建、签名与多通道提交 | `v9.0.0` |
|
||||
| Rust | [sol-shred-sdk](https://github.com/0xfnzero/sol-shred-sdk) | 原始 Shred 解码与 ShredStream 指令事件 | `v6.0.0` |
|
||||
| Rust | [solana-streamer](https://github.com/0xfnzero/solana-streamer) | gRPC / ShredStream 订阅与事件流封装 | `v5.0.0` |
|
||||
| Rust | [sol-trade-router-sdk](https://github.com/0xfnzero/sol-trade-router-sdk) | 链上多跳 Router 与客户端 SDK | `v0.3.0` |
|
||||
|
||||
<a id="安装"></a>
|
||||
|
||||
## 安装
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = "5.0.0"
|
||||
```
|
||||
|
||||
解析后端 feature:
|
||||
|
||||
```toml
|
||||
# 默认:sol-parser-sdk parse-borsh 后端
|
||||
solana-streamer-sdk = "5.0.0"
|
||||
|
||||
# 面向低延迟 Bot 的 zero-copy 解析后端
|
||||
solana-streamer-sdk = { version = "5.0.0", default-features = false, features = ["sdk-parse-zero-copy"] }
|
||||
```
|
||||
|
||||
如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.6.1+` 会优先使用 zero-copy 后端。
|
||||
|
||||
### 从源码使用
|
||||
|
||||
将项目克隆到您的项目目录:
|
||||
|
||||
```bash
|
||||
cd your_project_root_directory
|
||||
git clone https://github.com/0xfnzero/solana-streamer
|
||||
```
|
||||
|
||||
在您的 `Cargo.toml` 中添加依赖:
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "5.0.0" }
|
||||
```
|
||||
|
||||
<a id="这个-sdk-适合什么场景"></a>
|
||||
|
||||
## 这个 SDK 适合什么场景
|
||||
|
||||
@@ -109,13 +100,15 @@
|
||||
| 使用场景 | 实时 DEX 事件流、代币发射监控、跟单交易、账户状态订阅、Bot 信号管道 |
|
||||
| 解析后端 | `sol-parser-sdk`,默认 Borsh 解析,并可为低延迟场景启用 zero-copy 后端 |
|
||||
|
||||
<a id="项目特性"></a>
|
||||
|
||||
## 🚀 项目特性
|
||||
|
||||
### 核心功能
|
||||
- **实时事件流**: 订阅多个 Solana DEX 协议的实时交易事件
|
||||
- **SDK 底层解析核心**: 交易、RPC、账户和 ShredStream 解析都优先复用 `sol-parser-sdk`
|
||||
- **Yellowstone gRPC 支持**: 使用 Yellowstone gRPC 进行高性能事件订阅
|
||||
- **ShredStream 支持**: 使用 ShredStream 协议进行替代事件流传输;ALT-loaded 账户会以默认账户占位并尽量解析外层事件
|
||||
- **ShredStream 支持**: 使用 ShredStream 协议进行替代事件流传输;ALT 账户需由传入的加载地址或本地缓存解析,不猜测未解析地址
|
||||
- **统一事件接口**: 在所有支持的协议中保持一致的事件处理
|
||||
|
||||
### 多协议支持
|
||||
@@ -124,7 +117,7 @@
|
||||
- **PumpSwap**: PumpFun 的交换协议事件
|
||||
- **LaunchLab**: 通过 `Protocol::LaunchLab` 订阅共享代币发射程序事件;`Protocol::Bonk` 和 `Protocol::RaydiumLaunchpad` 仍作为兼容别名保留
|
||||
- **StonkFun**: 通过 `Protocol::StonkFun` 订阅归属于 StonkFun 的 LaunchLab 事件;事件 metadata 使用 `ProtocolType::StonkFun`
|
||||
- **Raydium CPMM**: Raydium 集中池做市商事件
|
||||
- **Raydium CPMM**: Raydium 恒定乘积做市商事件
|
||||
- **Raydium CLMM**: Raydium 集中流动性做市商事件
|
||||
- **Raydium AMM V4**: Raydium 自动做市商 V4 事件
|
||||
- **Meteora DAMM v2**: Meteora DAMM v2 交易和流动性事件
|
||||
@@ -155,217 +148,124 @@
|
||||
- **运行时配置更新**: 支持在运行时动态更新配置参数
|
||||
- **优雅关闭**: 支持编程式 stop() 方法进行干净的关闭
|
||||
|
||||
## ⚡ 安装
|
||||
|
||||
### 直接克隆
|
||||
|
||||
将项目克隆到您的项目目录:
|
||||
|
||||
```bash
|
||||
cd your_project_root_directory
|
||||
git clone https://github.com/0xfnzero/solana-streamer
|
||||
```
|
||||
|
||||
在您的 `Cargo.toml` 中添加依赖:
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "4.0.0" }
|
||||
```
|
||||
|
||||
### 使用 crates.io
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = "4.0.0"
|
||||
```
|
||||
|
||||
解析后端 feature:
|
||||
|
||||
```toml
|
||||
# 默认:sol-parser-sdk parse-borsh 后端
|
||||
solana-streamer-sdk = "4.0.0"
|
||||
|
||||
# 面向低延迟 Bot 的 zero-copy 解析后端
|
||||
solana-streamer-sdk = { version = "4.0.0", default-features = false, features = ["sdk-parse-zero-copy"] }
|
||||
```
|
||||
|
||||
如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.6.1+` 会优先使用 zero-copy 后端。
|
||||
|
||||
## 🔄 迁移指南
|
||||
|
||||
## v3.0.13 — Pump 路由事件完善
|
||||
|
||||
路由意图新增 `is_buy` 和 `ix_name`,沿用交易事件字段名和官方 IDL 方法名。RapidBuy 为买入意图,方法为 `buy_exact_quote_in_v2`;BuyPumpDelta 仅确定买入方向;多跳方向与未知方法保持为空。币种仍从 `hops[].base_mint` / `quote_mint` 获取。这些信息不代表已成交,过滤器也不会将路由意图转换为交易事件。
|
||||
|
||||
Streamer 现在通过 `DexEvent::PumpRouteIntentEvent` 转发完整路由字段并支持过滤。旧 JSON 缺少新字段时保持未知;Rust 结构体字面量需补齐新字段,穷举 streamer 事件的代码需处理新变体。
|
||||
|
||||
## v3.0.12 — Pump routes and offline replay
|
||||
|
||||
Pins sol-parser-sdk 0.7.14 and includes the latest streaming facade code and native hot-path benchmark. The raw parser re-export provides the new Pump route-intent and cached-ALT APIs.
|
||||
|
||||
Route intents describe instructions before execution; use execution metadata for confirmed fills. Offline CPU timings do not measure production transport or transaction landing.
|
||||
|
||||
## v3.0.11 — Pump depth-2 compatibility
|
||||
|
||||
Pins sol-parser-sdk 0.7.13 and inherits signed Pump depth-2 create-event compatibility coverage through the parser bridge. Existing trading and event interfaces remain unchanged.
|
||||
|
||||
Validation includes official Pump SDK 4.1.0 instruction comparisons, signed local LiteSVM simulations and SDK regressions. Local simulation state/config is synthetic; no funded transactions were broadcast and production latency was not measured.
|
||||
|
||||
|
||||
### v3.0.10
|
||||
|
||||
锁定 sol-parser-sdk 0.7.12,同步 PumpFun migration event CPI 解析修复。发布当前 bridge 的 compact trade、quote coin、complete/fee sweep 事件、协议费用字段和 synthetic migration 支持,包含离线主网交易回归样本。
|
||||
|
||||
### v3.0.9
|
||||
|
||||
- 锁定 `sol-parser-sdk 0.7.10`,同步创建账户匹配、quote 账户及历史布局修复;通过 RPC facade 与 gRPC bridge 主网回归验证。
|
||||
|
||||
### v3.0.8
|
||||
|
||||
固定依赖 `sol-parser-sdk 0.7.9`,继承 PumpSwap boost 账户回填与预编译指令日志索引修复,保留严格交易匹配和 ALT 账户处理。新增离线主网回归样本,验证 RPC facade 和 gRPC 事件桥接层完整保留池金库、token program 及卖出 token mint。
|
||||
|
||||
### v3.0.7
|
||||
|
||||
Uses `sol-parser-sdk 0.7.8`. Preserves CPMM creator-fee collection events, the AmmConfig share rate, swap instruction arguments and Orca/CLMM accounts through the bridge. Includes independent RPC corpus validation for 13 mainnet transactions and 17 target operations. Run `cargo run --example rpc_corpus_validate -- --list` to view signatures.
|
||||
|
||||
### 升级到 v3.0.6
|
||||
|
||||
v3.0.6 固定使用 `sol-parser-sdk 0.7.7`。通过 `parser_sdk` / `sdk_bridge::raw` 可访问 StonkFun 路由分析、迁移注册表和原始账户订阅。原始快照保留 parser SDK 类型,应直接消费,不要经过旧 streamer 事件转换层。bridge 回归样本已同步当前 Whirlpool/DLMM 账户字段。
|
||||
|
||||
### 升级到 v3.0.5
|
||||
|
||||
v3.0.5 使用 `sol-parser-sdk 0.7.5`,并转发 Meteora DAMM v2 swap 指令中恢复的 mint、vault、payer、token program 及可选 referral 等账户。真实主网回归覆盖 issue #82 报告的两笔交易。
|
||||
|
||||
### 升级到 v3.0.4
|
||||
|
||||
v3.0.4 使用 `sol-parser-sdk 0.7.4`,新增面向用户的 `Protocol::LaunchLab`、`Protocol::StonkFun`、`ProtocolType::LaunchLab` 与 `ProtocolType::StonkFun` 标识,并根据 StonkFun 官方 platform config 过滤共享 LaunchLab 流量。LaunchLab 交易事件现在会完整转发储备量、手续费、池状态与当前新增的三个尾部账户。`Protocol::RaydiumLaunchpad` 继续作为源码兼容别名保留,其显示名称统一为 `LaunchLab`。
|
||||
|
||||
### 升级到 v3.0.3
|
||||
|
||||
v3.0.3 使用 `sol-parser-sdk 0.7.3`,同步当前 PumpFun、PumpSwap 和 Pump Fees 协议 schema。PumpFun create/trade 事件以及 PumpSwap buy/sell/create-pool 事件现在会通过 streamer bridge 完整保留 creator fee 与 holder reward 字段;PumpFun bonding curve 和 PumpSwap pool 账户事件也会暴露新的 creator fee 可编辑状态与 holder reward 状态,同时继续为旧账户布局和旧 JSON 数据提供默认值。解析器会拒绝截断的当前 PumpSwap trade 和 CreatePool 尾部,不再返回字段不完整的事件。
|
||||
|
||||
### 升级到 v3.0.2
|
||||
|
||||
v3.0.2 使用 `sol-parser-sdk 0.7.2`,并转发新增的 Meteora DAMM v2 事件:`UpdateDelegatePermission`、`WithdrawDeadLiquidityReward`、`CreateConfig`、`CreateDynamicConfig`。TransactionCost 事件会完整保留 Solana V1 的四项 config 请求,并通过 `Message.config` 区分 V1 与 V0。接入 V1 要求 Yellowstone geyser 服务端插件至少为 `15.1.1`;更旧的服务端会静默丢弃 config 并把 V1 降级成 V0。
|
||||
|
||||
### 升级到 v3.0.1
|
||||
|
||||
v3.0.1 使用 `sol-parser-sdk 0.7.1`,修复当前 Meteora DAMM v2 Swap 与 AddLiquidity 的投递。bridge 现在会完整保留 swap fee、transfer fee、reserve、mode 和流动性字段;AddLiquidity 精确过滤会跟随链上统一的 `EvtLiquidityChange` 事件。Streamer 不再维护独立的 DAMM swap payload 解码器,由 `sol-parser-sdk` 作为唯一解析实现,并增加两类问题事件的主网 RPC 回归测试。
|
||||
|
||||
### 升级到 v3.0.0
|
||||
|
||||
v3.0.0 使用 `sol-parser-sdk 0.7.0` 和 Solana 4 公开类型。生产 ShredStream Entry 解码已切换到 `wincode 0.5.5`,并支持 Solana V1 交易。通过删除重复的 Solana/SPL 直接依赖并与 parser 对齐版本,normal 依赖图从 677 个 package/version 项降到 544 个,重复 crate 名从 119 个降到 30 个。此版本要求 Rust 1.91 或更新版本,并会继续转发 Meteora DLMM 用户 token 输入/输出账户。
|
||||
|
||||
### 升级到 v2.0.3
|
||||
|
||||
v2.0.3 使用 `sol-parser-sdk 0.6.6`,并固定 `spl-pod 0.7.2`,确保无锁文件的全新构建与 `spl-list-view 0.1.0` 兼容。PumpFun 交易事件会保留 parser SDK 提供的可选交易前后 token 余额(mint 原始精度)和 SOL 余额(lamports),这些字段直接来自交易 metadata,无需额外 RPC 请求。Meteora DLMM swap 也会单独保留 `min_amount_out`,不再与实际成交的 `amount_out` 混淆。
|
||||
|
||||
### 升级到 v2.0.1
|
||||
|
||||
v2.0.1 使用 crates.io 上的 `sol-parser-sdk 0.6.1`。PumpSwap Buy/Sell 事件现在会在 dispatcher 和 SDK bridge 路径中完整保留 cashback、buyback、带符号 virtual quote reserve、boost 和 base supply 尾部字段。默认和 zero-copy 解析后端会一致拒绝截断的当前布局,同时继续兼容历史布局。
|
||||
|
||||
### 升级到 v1.5.16
|
||||
|
||||
v1.5.16 修复 `StreamingOrdered` 模式下同一交易解析出多个事件时的投递问题。同一 `(slot, tx_index)` 的事件会作为一组进入缓冲,streaming watermark 每笔交易只推进一次,并用 stable sort 保留相同交易索引下的解析器输出顺序。同时将 `yellowstone-grpc-proto` 固定到 `sol-parser-sdk 0.5.15` 使用的 `12.4.x` API,避免 CI 和干净安装解析到不兼容的新 proto crate。
|
||||
|
||||
### 升级到 v1.5.15
|
||||
|
||||
v1.5.15 跟随 GitHub rev `36ec202` 上的 `sol-parser-sdk 0.5.15`。Pump.fun `create_v2` 现在会区分 16 账户 SOL sentinel 创建和 19/20 账户 quote-pool 创建;填充账户时会先选择实际的 create/create_v2 指令,再读取 quote 字段。gRPC/RPC inner instruction 解析现在会按 program id + discriminator 守卫解析所有 SDK 已支持 DEX 的 8-byte 普通 CPI instruction,PumpSwap `create_pool` 因此能从 instruction args 读取 `is_cashback_coin` 并与 log 事件合并。ShredStream 仍只解析外层指令,但外层 discriminator gate 已和 SDK 统一,避免支持协议之间规则分叉。
|
||||
|
||||
### 升级到 v1.5.14
|
||||
|
||||
v1.5.14 使用 crates.io 上的 `sol-parser-sdk 0.5.14`。Pump.fun canonical create 事件现在会为 `create_v2` quote 池暴露 `quote_mint`、`quote_vault`、`quote_token_program`,包括 USDC 池;gRPC/RPC parser bridge 和 ShredStream-backed SDK 输出都会保留这些字段。
|
||||
|
||||
### 升级到 v1.5.13
|
||||
|
||||
v1.5.13 使用 crates.io 上的 `sol-parser-sdk 0.5.13`。Pump.fun gRPC 和 ShredStream create/trade 输出现在会保留真实 WSOL quote mint(`So11111111111111111111111111111111111111112`)。只有 legacy 数据缺失 quote mint 时,才使用 Solscan SOL sentinel(`So11111111111111111111111111111111111111111`)。
|
||||
|
||||
### 升级到 v1.5.11
|
||||
|
||||
v1.5.11 使用 crates.io 上的 `sol-parser-sdk 0.5.11`。PumpSwap `PumpSwapCreatePoolEvent` 现在会在 `create_pool` instruction args 可用时携带 `is_cashback_coin`,包括 ShredStream 外层指令解析。log-only 的 `CreatePoolEvent` payload 因为链上 log event IDL 不包含该字段,仍会保持默认 `false`。`AccountPumpSwapPool` 仍是读取池子账户状态里该标记的权威来源。
|
||||
|
||||
### 升级到 v1.5.10
|
||||
|
||||
v1.5.10 使用 crates.io 上的 `sol-parser-sdk 0.5.10`。PumpSwap `CreatePoolEvent` 现在与链上 IDL 对齐:暴露 `is_mayhem_mode`,但不暴露 `is_cashback_coin`。如果需要 cashback 标记,请订阅 `AccountPumpSwapPool`,并读取 `PumpSwapPoolAccountEvent.pool.is_cashback_coin`。PumpSwap CreatePool log payload 长度检查现在包含最后的 `is_mayhem_mode` 字节。
|
||||
|
||||
### 升级到 v1.5.9
|
||||
|
||||
v1.5.9 使用 crates.io 上的 `sol-parser-sdk 0.5.9`。该版本继承 Yellowstone gRPC stop 生命周期修复:`stop()` 现在会通知、abort 并等待当前订阅任务结束,订阅生命周期切换会串行化,并且 gRPC 流错误日志会标记为 `Grpc Stream error`,便于和 ShredStream 日志区分。
|
||||
|
||||
### 升级到 v1.5.8
|
||||
|
||||
v1.5.8 使用 crates.io 上的 `sol-parser-sdk 0.5.8`。该版本继承 parser SDK 的 Pump.fun ShredStream 过滤大类语义:`PumpFunBuy` 覆盖 `buy`、`buy_v2`、`buy_exact_sol_in`、`buy_exact_quote_in_v2`;`PumpFunSell` 覆盖 `sell`、`sell_v2`;`PumpFunTrade` 覆盖所有 buy/sell 指令,并且当只请求通用 trade filter 时,parser 可统一输出 trade 事件。
|
||||
|
||||
### 升级到 v1.5.5
|
||||
|
||||
v1.5.5 使用 crates.io 上的 `sol-parser-sdk 0.5.5`。底层 SDK 已将 LaunchLab 事件统一暴露为 `RaydiumLaunchlab*`;streamer 仍保留现有 `Bonk*` 事件结构以及 `Protocol::Bonk` / `Protocol::RaydiumLaunchpad` 兼容别名,同时把解析调用和上游 gRPC 事件过滤映射到新的 LaunchLab SDK variant。该版本也同步了 CLMM/CPMM/Orca account bridge、Meteora DAMM v2 initialize-pool、Meteora DBC 事件,以及客户端创建时的 parser warmup。
|
||||
|
||||
### 升级到 v1.5.4
|
||||
|
||||
v1.5.4 使用 crates.io 上的 `sol-parser-sdk 0.5.4`。Pump.fun `create` 和 `create_v2` 会统一投递为 canonical `PumpFunCreateTokenEvent`;订阅 `PumpFunCreateToken` 或 `PumpFunCreateV2Token` 任意一个,都能收到同一份完整 create-family 数据。该版本避免 gRPC log + instruction 双路径解析导致新 mint 回调重复,同时在 canonical create 事件上保留 create_v2 账户字段。
|
||||
|
||||
### 升级到 v1.5.3
|
||||
|
||||
v1.5.3 使用 crates.io 上的 `sol-parser-sdk 0.5.3`。该版本会通过 streamer bridge 保留真实的 Pump.fun v2 `ix_name`,改进 ShredStream 对 Pump.fun v2 短账户列表的 best-effort 解析,并让订阅 `PumpFunBuy` 或 `PumpFunBuyExactSolIn` 都能匹配兼容的 buy-family 事件。ShredStream 仍使用直接读取 Entry 的自动重连低延迟路径;回调应避免阻塞,`tx_index` 仍是 Entry 内 best-effort 索引。
|
||||
|
||||
### 升级到 v1.5.2
|
||||
|
||||
v1.5.2 使用 crates.io 上的 `sol-parser-sdk 0.5.2`。ShredStream 投递使用直接读取 Entry 并调用 SDK parser 的低延迟路径,支持自动重连,避免额外的队列消费任务并复用解析事件缓冲。ShredStream 的 `tx_index` 是 Entry 内 best-effort 索引,不是 Yellowstone 的 slot 级交易索引。direct-callback 路径中的用户回调运行在读流任务中,应避免阻塞操作。
|
||||
|
||||
### 升级到 v1.5.1
|
||||
|
||||
v1.5.1 使用 crates.io 上的 `sol-parser-sdk 0.5.1`。该版本改进 ShredStream 的 ALT 处理:ALT-loaded 账户会以默认账户占位,外层指令按 data/discriminator 尽量解析;同时增加队列满时的 dropped event 可观测性,并明确 CPI/inner-only 事件仍是 ShredStream 的固有限制。
|
||||
|
||||
### 升级到 v1.5.0
|
||||
|
||||
v1.5.0 使用 `sol-parser-sdk 0.5.0`,打通 Raydium CLMM 账户解析的 SDK bridge,并降低有序缓冲低延迟投递路径中的分配和搬移开销。`sol-parser-sdk 0.4.19` 和 `solana-streamer-sdk 1.4.14` 已由 v1.5.0 取代,因为新增公开 parser event variant 应放到 0.5 版本线。
|
||||
|
||||
### 升级到 v1.4.14
|
||||
|
||||
v1.4.14 已由 v1.5.0 取代。
|
||||
|
||||
### 升级到 v1.4.13
|
||||
|
||||
v1.4.13 使用 `sol-parser-sdk 0.4.18`,并按 Raydium CLMM 官方升级后 IDL 更新集成:当前 log-side event discriminator、官方 Swap/Liquidity/Create/Collect 事件布局、限价单事件、dynamic fee 相关事件,以及重塑后的 PoolState/TickState 账户结构。
|
||||
|
||||
### 升级到 v1.4.12
|
||||
|
||||
v1.4.12 使用 `sol-parser-sdk 0.4.17`,会把 legacy PumpFun SOL 的 `quote_mint` 归一为 Solscan SOL sentinel,同时保留真实 USDC quote mint 和 quote reserve 字段。Streamer bridge 与 merger 路径继续保持 Yellowstone gRPC 和 ShredStream 输出与 parser SDK 语义一致。
|
||||
|
||||
新增可选能力:
|
||||
|
||||
- `solana_streamer_sdk::parser_sdk` 重新导出原始 `sol-parser-sdk` crate。
|
||||
- `solana_streamer_sdk::sdk_bridge` 可将原始 SDK 事件适配回 streamer `DexEvent`。
|
||||
- `fetch_rpc_transaction_as_streamer_events` 和 `parse_encoded_rpc_transaction_as_streamer_events` 可将 RPC 交易解析为 streamer 事件。
|
||||
- `grpc::ClientConfig::order_mode` 支持 `Unordered`、`Ordered`、`StreamingOrdered` 和 `MicroBatch`。
|
||||
- `sdk-parse-zero-copy` 可启用 SDK zero-copy 解析后端。
|
||||
|
||||
### 从 v0.5.x 迁移到 v1.x.x
|
||||
|
||||
版本 1.0.0 引入了从基于 trait 的事件处理到基于 enum 的事件的重大架构变更。这提供了更好的类型安全性、改进的性能和更简单的代码模式。
|
||||
|
||||
**主要变更:**
|
||||
|
||||
1. **事件类型变更** - `Box<dyn UnifiedEvent>` → `DexEvent` 枚举
|
||||
2. **回调签名** - 回调现在接收具体的 `DexEvent` 而不是 trait 对象
|
||||
3. **事件匹配** - 使用标准 Rust `match` 而不是 `match_event!` 宏
|
||||
4. **元数据访问** - 事件属性现在通过 `.metadata()` 方法访问
|
||||
|
||||
**快速迁移示例:**
|
||||
<a id="使用示例"></a>
|
||||
|
||||
## 📚 使用示例
|
||||
|
||||
### 使用示例概览表
|
||||
|
||||
| 描述 | 运行命令 | 源码路径 |
|
||||
|------|---------|----------|
|
||||
| 使用 Yellowstone gRPC 监控交易事件 | `cargo run --example grpc_example` | [examples/grpc_example.rs](examples/grpc_example.rs) |
|
||||
| 使用 ShredStream 监控交易事件 | `cargo run --example shred_example` | [examples/shred_example.rs](examples/shred_example.rs) |
|
||||
| 解析 Solana 主网交易数据 | `cargo run --example parse_tx_events` | [examples/parse_tx_events.rs](examples/parse_tx_events.rs) |
|
||||
| 从 RPC 解析 PumpFun 交易(签名:环境变量 `TX_SIGNATURE` 或 CLI 参数) | `cargo run --example parse_pump_tx --release` | [examples/parse_pump_tx.rs](examples/parse_pump_tx.rs) |
|
||||
| 从 RPC 解析 PumpFun quote_mint 边界案例 | `TX_SIGNATURES=<sig1,sig2> cargo run --example parse_pumpfun_quote_cases --release` | [examples/parse_pumpfun_quote_cases.rs](examples/parse_pumpfun_quote_cases.rs) |
|
||||
| 从 RPC 解析 PumpSwap 交易 | `cargo run --example parse_pumpswap_tx --release` | [examples/parse_pumpswap_tx.rs](examples/parse_pumpswap_tx.rs) |
|
||||
| 从 RPC 解析 Meteora DAMM v2 交易 | `TX_SIGNATURE=<sig> cargo run --example parse_meteora_damm_tx --release` | [examples/parse_meteora_damm_tx.rs](examples/parse_meteora_damm_tx.rs) |
|
||||
| 抓取任意交易并离线回放(保存原始 meta/logs/账户) | `cargo run --example rpc_transaction_replay -- --fetch <SIGNATURE> /tmp/transaction.json` | [examples/rpc_transaction_replay.rs](examples/rpc_transaction_replay.rs) |
|
||||
| 运行时更新过滤器 | `cargo run --example dynamic_subscription` | [examples/dynamic_subscription.rs](examples/dynamic_subscription.rs) |
|
||||
| 快速测试:订阅 PumpFun,打印前 10 条或运行 60 秒 | `cargo run --example pumpfun_quick_test --release` | [examples/pumpfun_quick_test.rs](examples/pumpfun_quick_test.rs) |
|
||||
| PumpFun 交易过滤:买入/卖出/创建及延迟统计 | `cargo run --example pumpfun_trade_filter --release` | [examples/pumpfun_trade_filter.rs](examples/pumpfun_trade_filter.rs) |
|
||||
| PumpFun gRPC 订阅(含指标) | `cargo run --example pumpfun_with_metrics --release` | [examples/pumpfun_with_metrics.rs](examples/pumpfun_with_metrics.rs) |
|
||||
| PumpSwap gRPC 订阅(含指标) | `cargo run --example pumpswap_with_metrics --release` | [examples/pumpswap_with_metrics.rs](examples/pumpswap_with_metrics.rs) |
|
||||
| Meteora DAMM v2 gRPC 订阅 | `cargo run --example meteora_damm_grpc --release` | [examples/meteora_damm_grpc.rs](examples/meteora_damm_grpc.rs) |
|
||||
| 监控特定代币账户余额变化 | `cargo run --example token_balance_listen_example` | [examples/token_balance_listen_example.rs](examples/token_balance_listen_example.rs) |
|
||||
| 通过账户订阅监控代币精度 | `cargo run --example token_decimals_listen_example` | [examples/token_decimals_listen_example.rs](examples/token_decimals_listen_example.rs) |
|
||||
| 跟踪 nonce 账户状态变化 | `cargo run --example nonce_listen_example` | [examples/nonce_listen_example.rs](examples/nonce_listen_example.rs) |
|
||||
| 使用 memcmp 过滤器监控 PumpSwap 池账户 | `cargo run --example pumpswap_pool_account_listen_example` | [examples/pumpswap_pool_account_listen_example.rs](examples/pumpswap_pool_account_listen_example.rs) |
|
||||
| 使用 memcmp 过滤器监控特定代币的所有关联代币账户 | `cargo run --example mint_all_ata_account_listen_example` | [examples/mint_all_ata_account_listen_example.rs](examples/mint_all_ata_account_listen_example.rs) |
|
||||
|
||||
### 事件过滤
|
||||
|
||||
库支持灵活的事件过滤以减少处理开销并提升性能:
|
||||
|
||||
#### 基础过滤
|
||||
|
||||
```rust
|
||||
// 旧版 (v0.5.x)
|
||||
let callback = |event: Box<dyn UnifiedEvent>| {
|
||||
println!("Event: {:?}", event.event_type());
|
||||
};
|
||||
use solana_streamer_sdk::streaming::event_parser::common::{filter::EventTypeFilter, EventType};
|
||||
|
||||
// 新版 (v1.x.x)
|
||||
let callback = |event: DexEvent| {
|
||||
println!("Event: {:?}", event.metadata().event_type);
|
||||
};
|
||||
// 无过滤 - 接收所有事件
|
||||
let event_type_filter = None;
|
||||
|
||||
// 过滤特定事件类型 - 只接收 PumpSwap 买入/卖出事件
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::PumpSwapSell,
|
||||
]));
|
||||
|
||||
// 排除高频噪声事件,保留其他所有事件
|
||||
let event_type_filter = Some(EventTypeFilter::exclude_only(vec![EventType::BlockMeta]));
|
||||
```
|
||||
|
||||
#### 性能影响
|
||||
|
||||
事件过滤可以带来显著的性能提升:
|
||||
- **减少 60-80%** 的不必要事件处理
|
||||
- **降低内存使用** 通过过滤掉无关事件
|
||||
- **减少网络带宽** 在分布式环境中
|
||||
- **更好的专注性** 只处理对应用有意义的事件
|
||||
|
||||
#### 按使用场景的过滤示例
|
||||
|
||||
**交易机器人(专注交易事件)**
|
||||
```rust
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFunBuy,
|
||||
EventType::PumpFunBuyExactSolIn,
|
||||
EventType::PumpFunSell,
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::PumpSwapSell,
|
||||
EventType::BonkBuyExactIn,
|
||||
EventType::BonkSellExactIn,
|
||||
EventType::RaydiumCpmmSwapBaseInput,
|
||||
EventType::RaydiumCpmmSwapBaseOutput,
|
||||
EventType::RaydiumClmmSwap,
|
||||
EventType::RaydiumAmmV4SwapBaseIn,
|
||||
EventType::RaydiumAmmV4SwapBaseOut,
|
||||
EventType::OrcaWhirlpoolSwap,
|
||||
EventType::MeteoraPoolsSwap,
|
||||
EventType::MeteoraDammV2Swap,
|
||||
EventType::MeteoraDlmmSwap,
|
||||
]));
|
||||
```
|
||||
|
||||
**池监控(专注流动性事件)**
|
||||
```rust
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFeesUpdateFeeShares,
|
||||
EventType::PumpSwapCreatePool,
|
||||
EventType::AccountPumpSwapPool,
|
||||
EventType::PumpSwapDeposit,
|
||||
EventType::PumpSwapWithdraw,
|
||||
EventType::RaydiumCpmmInitialize,
|
||||
EventType::RaydiumCpmmDeposit,
|
||||
EventType::RaydiumCpmmWithdraw,
|
||||
EventType::RaydiumClmmCreatePool,
|
||||
EventType::OrcaWhirlpoolPoolInitialized,
|
||||
EventType::MeteoraPoolsPoolCreated,
|
||||
EventType::MeteoraDammV2AddLiquidity,
|
||||
EventType::MeteoraPoolsAddLiquidity,
|
||||
EventType::MeteoraDlmmAddLiquidity,
|
||||
]));
|
||||
```
|
||||
|
||||
`PumpSwapCreatePool` 包含 `is_mayhem_mode`。对于 `is_cashback_coin`,
|
||||
ShredStream/外层指令解析会从 `create_pool` instruction args 读取;
|
||||
log-only 的 `CreatePoolEvent` payload 因为 IDL 不包含该字段,会保持默认
|
||||
`false`。账户里的权威值也可通过
|
||||
`PumpSwapPoolAccountEvent.pool.is_cashback_coin` 读取。
|
||||
|
||||
<a id="交易来源与解析边界"></a>
|
||||
|
||||
## 交易来源与解析边界
|
||||
|
||||
gRPC/RPC 使用提供的执行元数据和实际 CPI 指令;Shred 只能看到外层指令与本地已解析的账户。未知第三方指令在自身账户中引用 Pump.fun 时,可回调 `PumpFunTrade` 候选,携带 `third_program` 原始输入与 `Unresolved` 状态;这不证明交易已执行,也不确定方向或金额。买入/卖出专用过滤器不会把未知方向当作成交。
|
||||
|
||||
解析热路径不调用 RPC。按 `parse_status` 判断证据,缺失字段的默认值不代表实际零成交。账户顺序与原始指令数据保留在 `third_program`;交易序号和接收时间仍在事件元数据中,本地 Shred 序号不等于全 slot 执行顺序。详见 [第三方包装交易](docs/wrapped-pumpfun.md)。
|
||||
|
||||
<a id="配置系统"></a>
|
||||
|
||||
## ⚙️ 配置系统
|
||||
|
||||
您可以自定义客户端配置:
|
||||
@@ -463,112 +363,7 @@ grpc.subscribe_events_immediate(
|
||||
.await?;
|
||||
```
|
||||
|
||||
## 📚 使用示例
|
||||
|
||||
### 使用示例概览表
|
||||
|
||||
| 描述 | 运行命令 | 源码路径 |
|
||||
|------|---------|----------|
|
||||
| 使用 Yellowstone gRPC 监控交易事件 | `cargo run --example grpc_example` | [examples/grpc_example.rs](examples/grpc_example.rs) |
|
||||
| 使用 ShredStream 监控交易事件 | `cargo run --example shred_example` | [examples/shred_example.rs](examples/shred_example.rs) |
|
||||
| 解析 Solana 主网交易数据 | `cargo run --example parse_tx_events` | [examples/parse_tx_events.rs](examples/parse_tx_events.rs) |
|
||||
| 从 RPC 解析 PumpFun 交易(签名:环境变量 `TX_SIGNATURE` 或 CLI 参数) | `cargo run --example parse_pump_tx --release` | [examples/parse_pump_tx.rs](examples/parse_pump_tx.rs) |
|
||||
| 从 RPC 解析 PumpFun quote_mint 边界案例 | `TX_SIGNATURES=<sig1,sig2> cargo run --example parse_pumpfun_quote_cases --release` | [examples/parse_pumpfun_quote_cases.rs](examples/parse_pumpfun_quote_cases.rs) |
|
||||
| 从 RPC 解析 PumpSwap 交易 | `cargo run --example parse_pumpswap_tx --release` | [examples/parse_pumpswap_tx.rs](examples/parse_pumpswap_tx.rs) |
|
||||
| 从 RPC 解析 Meteora DAMM v2 交易 | `TX_SIGNATURE=<sig> cargo run --example parse_meteora_damm_tx --release` | [examples/parse_meteora_damm_tx.rs](examples/parse_meteora_damm_tx.rs) |
|
||||
| 调试 PumpFun 交易(拉取、打印 meta/logs、解析) | `TX_SIGNATURE=<sig> cargo run --example debug_pump_tx --release` | [examples/debug_pump_tx.rs](examples/debug_pump_tx.rs) |
|
||||
| 调试 PumpSwap 交易(拉取、打印 meta、解析) | `TX_SIGNATURE=<sig> cargo run --example debug_pumpswap_tx --release` | [examples/debug_pumpswap_tx.rs](examples/debug_pumpswap_tx.rs) |
|
||||
| 运行时更新过滤器 | `cargo run --example dynamic_subscription` | [examples/dynamic_subscription.rs](examples/dynamic_subscription.rs) |
|
||||
| 快速测试:订阅 PumpFun,打印前 10 条或运行 60 秒 | `cargo run --example pumpfun_quick_test --release` | [examples/pumpfun_quick_test.rs](examples/pumpfun_quick_test.rs) |
|
||||
| PumpFun 交易过滤:买入/卖出/创建及延迟统计 | `cargo run --example pumpfun_trade_filter --release` | [examples/pumpfun_trade_filter.rs](examples/pumpfun_trade_filter.rs) |
|
||||
| PumpFun gRPC 订阅(含指标) | `cargo run --example pumpfun_with_metrics --release` | [examples/pumpfun_with_metrics.rs](examples/pumpfun_with_metrics.rs) |
|
||||
| PumpSwap gRPC 订阅(含指标) | `cargo run --example pumpswap_with_metrics --release` | [examples/pumpswap_with_metrics.rs](examples/pumpswap_with_metrics.rs) |
|
||||
| Meteora DAMM v2 gRPC 订阅 | `cargo run --example meteora_damm_grpc --release` | [examples/meteora_damm_grpc.rs](examples/meteora_damm_grpc.rs) |
|
||||
| 监控特定代币账户余额变化 | `cargo run --example token_balance_listen_example` | [examples/token_balance_listen_example.rs](examples/token_balance_listen_example.rs) |
|
||||
| 通过账户订阅监控代币精度 | `cargo run --example token_decimals_listen_example` | [examples/token_decimals_listen_example.rs](examples/token_decimals_listen_example.rs) |
|
||||
| 跟踪 nonce 账户状态变化 | `cargo run --example nonce_listen_example` | [examples/nonce_listen_example.rs](examples/nonce_listen_example.rs) |
|
||||
| 使用 memcmp 过滤器监控 PumpSwap 池账户 | `cargo run --example pumpswap_pool_account_listen_example` | [examples/pumpswap_pool_account_listen_example.rs](examples/pumpswap_pool_account_listen_example.rs) |
|
||||
| 使用 memcmp 过滤器监控特定代币的所有关联代币账户 | `cargo run --example mint_all_ata_account_listen_example` | [examples/mint_all_ata_account_listen_example.rs](examples/mint_all_ata_account_listen_example.rs) |
|
||||
|
||||
### 事件过滤
|
||||
|
||||
库支持灵活的事件过滤以减少处理开销并提升性能:
|
||||
|
||||
#### 基础过滤
|
||||
|
||||
```rust
|
||||
use solana_streamer_sdk::streaming::event_parser::common::{filter::EventTypeFilter, EventType};
|
||||
|
||||
// 无过滤 - 接收所有事件
|
||||
let event_type_filter = None;
|
||||
|
||||
// 过滤特定事件类型 - 只接收 PumpSwap 买入/卖出事件
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::PumpSwapSell,
|
||||
]));
|
||||
|
||||
// 排除高频噪声事件,保留其他所有事件
|
||||
let event_type_filter = Some(EventTypeFilter::exclude_only(vec![EventType::BlockMeta]));
|
||||
```
|
||||
|
||||
#### 性能影响
|
||||
|
||||
事件过滤可以带来显著的性能提升:
|
||||
- **减少 60-80%** 的不必要事件处理
|
||||
- **降低内存使用** 通过过滤掉无关事件
|
||||
- **减少网络带宽** 在分布式环境中
|
||||
- **更好的专注性** 只处理对应用有意义的事件
|
||||
|
||||
#### 按使用场景的过滤示例
|
||||
|
||||
**交易机器人(专注交易事件)**
|
||||
```rust
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFunBuy,
|
||||
EventType::PumpFunBuyExactSolIn,
|
||||
EventType::PumpFunSell,
|
||||
EventType::PumpSwapBuy,
|
||||
EventType::PumpSwapSell,
|
||||
EventType::BonkBuyExactIn,
|
||||
EventType::BonkSellExactIn,
|
||||
EventType::RaydiumCpmmSwapBaseInput,
|
||||
EventType::RaydiumCpmmSwapBaseOutput,
|
||||
EventType::RaydiumClmmSwap,
|
||||
EventType::RaydiumAmmV4SwapBaseIn,
|
||||
EventType::RaydiumAmmV4SwapBaseOut,
|
||||
EventType::OrcaWhirlpoolSwap,
|
||||
EventType::MeteoraPoolsSwap,
|
||||
EventType::MeteoraDammV2Swap,
|
||||
EventType::MeteoraDlmmSwap,
|
||||
]));
|
||||
```
|
||||
|
||||
**池监控(专注流动性事件)**
|
||||
```rust
|
||||
let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFeesUpdateFeeShares,
|
||||
EventType::PumpSwapCreatePool,
|
||||
EventType::AccountPumpSwapPool,
|
||||
EventType::PumpSwapDeposit,
|
||||
EventType::PumpSwapWithdraw,
|
||||
EventType::RaydiumCpmmInitialize,
|
||||
EventType::RaydiumCpmmDeposit,
|
||||
EventType::RaydiumCpmmWithdraw,
|
||||
EventType::RaydiumClmmCreatePool,
|
||||
EventType::OrcaWhirlpoolPoolInitialized,
|
||||
EventType::MeteoraPoolsPoolCreated,
|
||||
EventType::MeteoraDammV2AddLiquidity,
|
||||
EventType::MeteoraPoolsAddLiquidity,
|
||||
EventType::MeteoraDlmmAddLiquidity,
|
||||
]));
|
||||
```
|
||||
|
||||
`PumpSwapCreatePool` 包含 `is_mayhem_mode`。对于 `is_cashback_coin`,
|
||||
ShredStream/外层指令解析会从 `create_pool` instruction args 读取;
|
||||
log-only 的 `CreatePoolEvent` payload 因为 IDL 不包含该字段,会保持默认
|
||||
`false`。账户里的权威值也可通过
|
||||
`PumpSwapPoolAccountEvent.pool.is_cashback_coin` 读取。
|
||||
<a id="动态订阅管理"></a>
|
||||
|
||||
## 动态订阅管理
|
||||
|
||||
@@ -597,6 +392,8 @@ grpc.update_subscription(
|
||||
|
||||
注意:在同一客户端上多次尝试订阅会返回错误。
|
||||
|
||||
<a id="支持的协议"></a>
|
||||
|
||||
## 🔧 支持的协议
|
||||
|
||||
- **PumpFun**: 主要迷因币交易平台
|
||||
@@ -604,7 +401,7 @@ grpc.update_subscription(
|
||||
- **PumpSwap**: PumpFun 的交换协议
|
||||
- **LaunchLab**: 代币发射平台;`Bonk` 和 `RaydiumLaunchpad` 作为兼容别名保留
|
||||
- **StonkFun**: 归属于 StonkFun 的 LaunchLab 交易和建池事件
|
||||
- **Raydium CPMM**: Raydium 集中池做市商协议
|
||||
- **Raydium CPMM**: Raydium 恒定乘积做市商协议
|
||||
- **Raydium CLMM**: Raydium 集中流动性做市商协议
|
||||
- **Raydium AMM V4**: Raydium 自动做市商 V4 协议
|
||||
- **Meteora DAMM v2**: Meteora DAMM v2 协议
|
||||
@@ -614,11 +411,15 @@ grpc.update_subscription(
|
||||
- **Meteora DLMM**: Meteora 动态流动性做市商协议
|
||||
- **通用/账户事件**: Token 账户、Token 元信息、Nonce 账户、区块元数据、ComputeBudget 事件,以及 Raydium CLMM/CPMM、Pump/PumpSwap、Orca Whirlpool 等已支持协议账户状态
|
||||
|
||||
<a id="事件流服务"></a>
|
||||
|
||||
## 🌐 事件流服务
|
||||
|
||||
- **Yellowstone gRPC**: 高性能 Solana 事件流
|
||||
- **ShredStream**: 替代事件流协议
|
||||
|
||||
<a id="架构特性"></a>
|
||||
|
||||
## 🏗️ 架构特性
|
||||
|
||||
### 统一事件接口
|
||||
@@ -639,6 +440,8 @@ grpc.update_subscription(
|
||||
- **ShredStream 客户端**: 替代流实现
|
||||
- **高性能处理**: 优化的事件处理机制
|
||||
|
||||
<a id="项目结构"></a>
|
||||
|
||||
## 📁 项目结构
|
||||
|
||||
```
|
||||
@@ -660,6 +463,8 @@ src/
|
||||
└── lib.rs # 主库文件
|
||||
```
|
||||
|
||||
<a id="性能考虑"></a>
|
||||
|
||||
## ⚡ 性能考虑
|
||||
|
||||
1. **连接管理**: 正确处理连接生命周期和重连
|
||||
@@ -670,17 +475,7 @@ src/
|
||||
6. **性能监控**: 启用性能监控以识别瓶颈和优化机会
|
||||
7. **优雅关闭**: 使用 stop() 方法进行干净关闭,并实现信号处理器以正确清理资源
|
||||
|
||||
---
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT 许可证
|
||||
|
||||
## 📞 联系方式
|
||||
|
||||
- **网站**: https://fnzero.dev/
|
||||
- **项目仓库**: https://github.com/0xfnzero/solana-streamer
|
||||
- **Telegram 群组**: https://t.me/fnzero_group
|
||||
<a id="重要注意事项"></a>
|
||||
|
||||
## ⚠️ 重要注意事项
|
||||
|
||||
@@ -689,7 +484,34 @@ MIT 许可证
|
||||
3. **错误恢复**: 实现适当的错误处理和重连逻辑
|
||||
5. **合规性**: 确保遵守相关法律法规
|
||||
|
||||
<a id="文档导航"></a>
|
||||
|
||||
## 文档导航
|
||||
|
||||
- [发布与迁移](RELEASE_NOTES.md)
|
||||
- [使用指南](docs/wrapped-pumpfun.md)
|
||||
|
||||
<a id="语言版本"></a>
|
||||
|
||||
## 语言版本
|
||||
|
||||
- [English](README.md)
|
||||
- [中文](README_CN.md)
|
||||
|
||||
|
||||
<a id="许可证"></a>
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT 许可证
|
||||
|
||||
<a id="联系方式"></a>
|
||||
|
||||
## 📞 联系方式
|
||||
|
||||
- **网站**: https://fnzero.dev/
|
||||
- **项目仓库**: https://github.com/0xfnzero/solana-streamer
|
||||
- **Telegram 群组**: https://t.me/fnzero_group
|
||||
|
||||
|
||||
股票池同步:34 种官方股票/ETF、63 个股票池;配置扩展、USDC 起点、缓存选路与使用边界见 [11 SDK 同步说明](docs/STOCK_BRIDGE_SYNC.md)。
|
||||
|
||||
+14
-9
@@ -1,15 +1,20 @@
|
||||
# solana-streamer v4.0.0
|
||||
# solana-streamer v5.0.0
|
||||
|
||||
Trade provenance bridge synchronized with sol-parser-sdk 0.8.0.
|
||||
Released 2026-10-22. The Rust, Node.js, Python and Go parser packages use the same family version, 0.9.0. Streamer 5.0.0 and Shred 6.0.0 are separately versioned integrations.
|
||||
|
||||
## Changes
|
||||
## Changes / 更新
|
||||
|
||||
- Preserve original router payloads and parsing evidence through supported trade event bridges.
|
||||
- Use sol-parser-sdk =0.8.0; retain versioned official instruction names and transaction/receive metadata.
|
||||
- Organize examples and documentation; tests use the SDK's own language. Offline captured transactions do not represent fresh mainnet execution or production latency measurements.
|
||||
- Remove standalone PumpRouteIntent and RawInstruction callbacks and their obsolete decoding helpers/examples. Wrapped Pump.fun callbacks retain the original outer program, ordered accounts and data in third_program.
|
||||
- Preserve the distinction between unresolved Shred candidates, decoded instruction inputs and confirmed execution. The parser hot path performs no RPC and does not infer opaque third-party arguments.
|
||||
- Synchronize Pump.fun V3 instruction handling, gRPC execution evidence and create-before-trade ordering. Preserve supplied transaction-position and receive-time metadata.
|
||||
- Clean up examples and README navigation; maintain the shared stock catalog and native-language validation.
|
||||
|
||||
## Migration
|
||||
## Migration / 升级
|
||||
|
||||
third_program now contains RawInstructionPayload rather than a rule identifier. It does not contain duplicated metadata/dexes; metadata remains on the event. Check parse_status: Unresolved is only a possible DEX interaction, InstructionDecoded establishes input decoding, and ExecutionConfirmed reflects supplied execution evidence, not necessarily known fill amounts. Do not treat zero defaults as proven zero fills. Rust callers constructing trade structs must initialize the new fields or use ..Default::default().
|
||||
Subscribe to PumpFunTrade and inspect third_program and parse_status. Remove matches/filters for the retired PumpRouteIntent and RawInstruction events. Unresolved is only a possible interaction; defaults are not a proven direction or zero fill. ExecutionConfirmed does not guarantee all amounts are available. Unresolved ALT addresses remain unknown.
|
||||
|
||||
No RPC is performed by the parsing hot path. Explicit analysis/discovery tools can fetch RPC data outside that path. Wrapper reconstruction remains opt-in and is not proof of future third-party program behavior.
|
||||
中文:独立的路由意图和原始指令回调已删除。第三方包装信息保留在交易事件的 third_program 中;Shred 候选与实际成交必须按 parse_status 区分。SDK 不猜测第三方合约参数,热路径不调用 RPC。
|
||||
|
||||
Version alignment does not imply identical APIs across languages. Offline fixtures validate captured cases, not current chain state or production latency. See README and docs/wrapped-pumpfun.md for the supported surface.
|
||||
|
||||
Pins sol-parser-sdk =0.9.0 and forwards the simplified callback model. Update exhaustive streamer event matches when upgrading.
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Shared stock bridge catalog (2026-10-21, unreleased)
|
||||
|
||||
All eleven SDKs align with the screened sol-parser-sdk / sol-trade-sdk catalog:
|
||||
34 official stock/ETF mints and 63 stock pools, comprising 46 USDC pairs and
|
||||
17 WSOL pairs. These are historical identities and reserve/fee observations,
|
||||
not live quotes. Admission used at least $500 of liquid-side reserve and usable
|
||||
bidirectional probes. Retain all admitted alternatives; the historical preferred
|
||||
pool does not force the live route.
|
||||
|
||||
Trade registries include the 63 stock pools plus WSOL/USDC (64 total). Custom
|
||||
pools merge by address; reverse pairs and SOL/WSOL aliases deduplicate. Conflicting
|
||||
identities reject the entire merge. The bound is 128 unique registered pools,
|
||||
with a default search budget of 512 nodes and two conversion hops (excluding
|
||||
the target PumpSwap hop). Custom-only configurations remain supported.
|
||||
|
||||
Each conversion hop defaults to 100 bps execution slippage and 100 bps maximum
|
||||
price impact against a 1/100-size cached probe. These are independent user settings;
|
||||
the target trade has its own slippage. Integer arithmetic accounts for net output;
|
||||
unusable probes fail closed. No guarantee of a 1% total-route loss is implied.
|
||||
A chosen independent buy or sell is built as one transaction, subject to packet,
|
||||
account, compute and CPI limits; it is never silently split.
|
||||
|
||||
Search starts at the requested payment/receipt asset. USDC input considers direct
|
||||
USDC/stock pools without first wrapping SOL. All valid paths rank by protected net
|
||||
output, then fewer hops and deterministic pool order. Paths never revisit a mint.
|
||||
Only the selected route contributes swap/ATA instructions to the transaction;
|
||||
registering 64 pools does not insert 64 swaps or create all their ATAs. Reusable
|
||||
intermediate ATAs use idempotent setup. Build fresh snapshots from background
|
||||
account subscriptions and invalidate them on continuity loss. Configuration,
|
||||
quote/search and preparation perform no RPC; no cache miss triggers a fallback.
|
||||
|
||||
Parser SDKs own parsing, stock monitoring and historical identities. Streamer and
|
||||
Shred transport signals; incomplete Shred observations never become confirmed
|
||||
prices or executable reserves. Trade SDKs own quoting and transaction preparation.
|
||||
The router reuses parser 0.8.0 and trade 8.0.0; its re-exported PumpSwapRouting
|
||||
builds trade-sdk direct instructions, not automatic router-program CPI dispatch.
|
||||
Single-market conversion cannot resolve PumpSwapAutoRoute without a routing cache.
|
||||
|
||||
## Keeping catalogs aligned
|
||||
|
||||
From the eleven-repository workspace root:
|
||||
|
||||
```sh
|
||||
cargo run --manifest-path sol-parser-sdk/Cargo.toml --example stock_catalog_sync -- \
|
||||
--report sol-parser-sdk/docs/research/stock-catalog-20261020.json \
|
||||
--fee-audit sol-trade-sdk/docs/research/bridge-defaults-20261020-expanded-scan.json \
|
||||
--parser-root sol-parser-sdk --trade-root sol-trade-sdk --workspace-root . --check
|
||||
```
|
||||
|
||||
Omit `--check` to regenerate the nine packaged JSON copies. Streamer and router
|
||||
reuse the parser catalog through dependencies instead of storing duplicate data.
|
||||
The check validates saved screening evidence and byte equality without RPC.
|
||||
|
||||
Use `solana_streamer_sdk::stock_prices::StockTokenCatalog::screened_defaults()`;
|
||||
the existing `parser_sdk` facade also exposes the same module and tracker.
|
||||
@@ -1,165 +0,0 @@
|
||||
//! Debug PumpFun transaction: fetch from RPC, print meta/logs, then parse with EventParser.
|
||||
//!
|
||||
//! Usage: cargo run --example debug_pump_tx --release
|
||||
//! TX_SIGNATURE=<sig> SOLANA_RPC_URL=<url> cargo run --example debug_pump_tx --release
|
||||
|
||||
use anyhow::Result;
|
||||
use solana_commitment_config::CommitmentConfig;
|
||||
use solana_streamer_sdk::streaming::event_parser::core::event_parser::EventParser;
|
||||
use solana_streamer_sdk::streaming::event_parser::{DexEvent, Protocol};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let default_sig =
|
||||
"5curEt85cQhAK6R9pntSJ4fmYCiPEG22NjZyGrnGSbNwAkHJMN25T9Efp1n9Tf9vGXhnDXMQYrCNpoRHQTMcZ1s9";
|
||||
let tx_sig = std::env::var("TX_SIGNATURE").unwrap_or_else(|_| default_sig.to_string());
|
||||
let rpc_url = std::env::var("SOLANA_RPC_URL")
|
||||
.unwrap_or_else(|_| "https://api.mainnet-beta.solana.com".to_string());
|
||||
|
||||
println!("=== Debug PumpFun Transaction ===\n");
|
||||
println!("Signature: {}\n", tx_sig);
|
||||
println!("RPC: {}\n", rpc_url);
|
||||
|
||||
let signature = solana_sdk::signature::Signature::from_str(&tx_sig)?;
|
||||
let client = solana_client::nonblocking::rpc_client::RpcClient::new(rpc_url.clone());
|
||||
|
||||
let transaction = match client
|
||||
.get_transaction_with_config(
|
||||
&signature,
|
||||
solana_client::rpc_config::RpcTransactionConfig {
|
||||
encoding: Some(solana_transaction_status::UiTransactionEncoding::Base64),
|
||||
commitment: Some(CommitmentConfig::confirmed()),
|
||||
max_supported_transaction_version: Some(1),
|
||||
},
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(tx) => tx,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to fetch: {}", e);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
println!("Slot: {}", transaction.slot);
|
||||
println!("Block time: {:?}", transaction.block_time);
|
||||
|
||||
if let Some(ref meta) = transaction.transaction.meta {
|
||||
println!("\n=== Transaction Meta ===");
|
||||
println!("Fee: {}", meta.fee);
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(units) =
|
||||
&meta.compute_units_consumed
|
||||
{
|
||||
println!("Compute units: {}", units);
|
||||
}
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(logs) =
|
||||
&meta.log_messages
|
||||
{
|
||||
println!("\n=== Logs ({} lines) ===", logs.len());
|
||||
for (i, log) in logs.iter().enumerate() {
|
||||
if log.contains("Program 6EF8") || log.contains("invoke") || log.contains("success")
|
||||
{
|
||||
println!(" {}: {}", i, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!("\n=== Parsing with EventParser ===");
|
||||
let versioned_tx = match transaction.transaction.transaction.decode() {
|
||||
Some(tx) => tx,
|
||||
None => {
|
||||
println!("Failed to decode transaction");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
use prost_types::Timestamp;
|
||||
use solana_sdk::{message::compiled_instruction::CompiledInstruction, pubkey::Pubkey};
|
||||
use solana_transaction_status::{InnerInstruction, InnerInstructions, UiInstruction};
|
||||
|
||||
let mut inner_instructions_vec: Vec<InnerInstructions> = Vec::new();
|
||||
if let Some(meta) = &transaction.transaction.meta {
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(
|
||||
ui_inner_insts,
|
||||
) = &meta.inner_instructions
|
||||
{
|
||||
for ui_inner in ui_inner_insts {
|
||||
let mut converted = Vec::new();
|
||||
for ui_instruction in &ui_inner.instructions {
|
||||
if let UiInstruction::Compiled(ui_compiled) = ui_instruction {
|
||||
if let Ok(data) = solana_sdk::bs58::decode(&ui_compiled.data).into_vec() {
|
||||
converted.push(InnerInstruction {
|
||||
instruction: CompiledInstruction {
|
||||
program_id_index: ui_compiled.program_id_index,
|
||||
accounts: ui_compiled.accounts.to_vec(),
|
||||
data,
|
||||
},
|
||||
stack_height: ui_compiled.stack_height,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
inner_instructions_vec
|
||||
.push(InnerInstructions { index: ui_inner.index, instructions: converted });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut address_table_lookups: Vec<Pubkey> = vec![];
|
||||
if let Some(meta) = &transaction.transaction.meta {
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(loaded) =
|
||||
&meta.loaded_addresses
|
||||
{
|
||||
for s in loaded.writable.iter().chain(loaded.readonly.iter()) {
|
||||
if let Ok(p) = s.parse::<Pubkey>() {
|
||||
address_table_lookups.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut accounts: Vec<Pubkey> = versioned_tx.message.static_account_keys().to_vec();
|
||||
accounts.extend(address_table_lookups);
|
||||
|
||||
let slot = transaction.slot;
|
||||
let block_time = transaction.block_time.map(|t| Timestamp { seconds: t, nanos: 0 });
|
||||
let recv_us =
|
||||
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_micros()
|
||||
as i64;
|
||||
|
||||
let protocols = vec![
|
||||
Protocol::PumpFun,
|
||||
Protocol::PumpSwap,
|
||||
Protocol::Bonk,
|
||||
Protocol::RaydiumClmm,
|
||||
Protocol::RaydiumCpmm,
|
||||
Protocol::RaydiumAmmV4,
|
||||
Protocol::MeteoraDammV2,
|
||||
];
|
||||
|
||||
let callback = Arc::new(|event: DexEvent| {
|
||||
println!("Parsed event: {:?}\n", event);
|
||||
});
|
||||
|
||||
EventParser::parse_instruction_events_from_versioned_transaction(
|
||||
&protocols,
|
||||
None,
|
||||
&versioned_tx,
|
||||
signature,
|
||||
Some(slot),
|
||||
block_time,
|
||||
recv_us,
|
||||
&accounts,
|
||||
&inner_instructions_vec,
|
||||
None,
|
||||
None,
|
||||
callback,
|
||||
)
|
||||
.await?;
|
||||
|
||||
println!("\n✓ Done.");
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
//! Debug PumpSwap transaction: fetch from RPC, print meta, then parse with EventParser.
|
||||
//!
|
||||
//! Usage: TX_SIGNATURE=<sig> cargo run --example debug_pumpswap_tx --release
|
||||
|
||||
use anyhow::Result;
|
||||
use solana_commitment_config::CommitmentConfig;
|
||||
use solana_streamer_sdk::streaming::event_parser::core::event_parser::EventParser;
|
||||
use solana_streamer_sdk::streaming::event_parser::{DexEvent, Protocol};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let tx_sig = std::env::var("TX_SIGNATURE").unwrap_or_else(|_| {
|
||||
eprintln!("Usage: TX_SIGNATURE=<sig> cargo run --example debug_pumpswap_tx --release");
|
||||
std::process::exit(1);
|
||||
});
|
||||
let rpc_url = std::env::var("SOLANA_RPC_URL")
|
||||
.unwrap_or_else(|_| "https://api.mainnet-beta.solana.com".to_string());
|
||||
|
||||
println!("=== Debug PumpSwap Transaction ===\n");
|
||||
println!("Signature: {}\n", tx_sig);
|
||||
|
||||
let signature = solana_sdk::signature::Signature::from_str(&tx_sig)?;
|
||||
let client = solana_client::nonblocking::rpc_client::RpcClient::new(rpc_url.clone());
|
||||
|
||||
let transaction = match client
|
||||
.get_transaction_with_config(
|
||||
&signature,
|
||||
solana_client::rpc_config::RpcTransactionConfig {
|
||||
encoding: Some(solana_transaction_status::UiTransactionEncoding::Base64),
|
||||
commitment: Some(CommitmentConfig::confirmed()),
|
||||
max_supported_transaction_version: Some(1),
|
||||
},
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(tx) => tx,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to fetch: {}", e);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
println!("Slot: {}", transaction.slot);
|
||||
if let Some(ref meta) = transaction.transaction.meta {
|
||||
println!("Fee: {}", meta.fee);
|
||||
}
|
||||
|
||||
let versioned_tx = match transaction.transaction.transaction.decode() {
|
||||
Some(tx) => tx,
|
||||
None => {
|
||||
println!("Failed to decode");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
use prost_types::Timestamp;
|
||||
use solana_sdk::{message::compiled_instruction::CompiledInstruction, pubkey::Pubkey};
|
||||
use solana_transaction_status::{InnerInstruction, InnerInstructions, UiInstruction};
|
||||
|
||||
let mut inner_instructions_vec: Vec<InnerInstructions> = Vec::new();
|
||||
if let Some(meta) = &transaction.transaction.meta {
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(
|
||||
ui_inner_insts,
|
||||
) = &meta.inner_instructions
|
||||
{
|
||||
for ui_inner in ui_inner_insts {
|
||||
let mut converted = Vec::new();
|
||||
for ui_instruction in &ui_inner.instructions {
|
||||
if let UiInstruction::Compiled(ui_compiled) = ui_instruction {
|
||||
if let Ok(data) = solana_sdk::bs58::decode(&ui_compiled.data).into_vec() {
|
||||
converted.push(InnerInstruction {
|
||||
instruction: CompiledInstruction {
|
||||
program_id_index: ui_compiled.program_id_index,
|
||||
accounts: ui_compiled.accounts.to_vec(),
|
||||
data,
|
||||
},
|
||||
stack_height: ui_compiled.stack_height,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
inner_instructions_vec
|
||||
.push(InnerInstructions { index: ui_inner.index, instructions: converted });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut address_table_lookups: Vec<Pubkey> = vec![];
|
||||
if let Some(meta) = &transaction.transaction.meta {
|
||||
if let solana_transaction_status::option_serializer::OptionSerializer::Some(loaded) =
|
||||
&meta.loaded_addresses
|
||||
{
|
||||
for s in loaded.writable.iter().chain(loaded.readonly.iter()) {
|
||||
if let Ok(p) = s.parse::<Pubkey>() {
|
||||
address_table_lookups.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut accounts: Vec<Pubkey> = versioned_tx.message.static_account_keys().to_vec();
|
||||
accounts.extend(address_table_lookups);
|
||||
|
||||
let slot = transaction.slot;
|
||||
let block_time = transaction.block_time.map(|t| Timestamp { seconds: t, nanos: 0 });
|
||||
let recv_us =
|
||||
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_micros()
|
||||
as i64;
|
||||
|
||||
let protocols = vec![
|
||||
Protocol::PumpFun,
|
||||
Protocol::PumpSwap,
|
||||
Protocol::Bonk,
|
||||
Protocol::RaydiumClmm,
|
||||
Protocol::RaydiumCpmm,
|
||||
Protocol::RaydiumAmmV4,
|
||||
Protocol::MeteoraDammV2,
|
||||
];
|
||||
|
||||
let callback = Arc::new(|event: DexEvent| {
|
||||
println!("Event: {:?}\n", event);
|
||||
});
|
||||
|
||||
EventParser::parse_instruction_events_from_versioned_transaction(
|
||||
&protocols,
|
||||
None,
|
||||
&versioned_tx,
|
||||
signature,
|
||||
Some(slot),
|
||||
block_time,
|
||||
recv_us,
|
||||
&accounts,
|
||||
&inner_instructions_vec,
|
||||
None,
|
||||
None,
|
||||
callback,
|
||||
)
|
||||
.await?;
|
||||
|
||||
println!("\n✓ Done.");
|
||||
Ok(())
|
||||
}
|
||||
@@ -9,8 +9,9 @@ use solana_streamer_sdk::streaming::event_parser::common::{filter::EventTypeFilt
|
||||
|
||||
fn main() {
|
||||
let streamer_filter = EventTypeFilter::include_only(vec![
|
||||
EventType::PumpFunBuy,
|
||||
EventType::PumpFunSell,
|
||||
// Include unresolved Shred candidates as well as decoded buys/sells.
|
||||
// Inspect parse_status and third_program before using amounts.
|
||||
EventType::PumpFunTrade,
|
||||
EventType::TokenAccount,
|
||||
]);
|
||||
let sdk_filter = sdk_bridge::event_type_filter_to_sdk(Some(&streamer_filter));
|
||||
|
||||
@@ -11,3 +11,6 @@ pub use streaming::{
|
||||
fetch_rpc_transaction_as_streamer_events, fetch_rpc_transaction_as_streamer_events_async,
|
||||
parse_encoded_rpc_transaction_as_streamer_events, RpcParseError,
|
||||
};
|
||||
|
||||
/// Shared screened identities and stock price tracking from the parser.
|
||||
pub use sol_parser_sdk::stock_prices;
|
||||
|
||||
Reference in New Issue
Block a user