Propagate PumpFun instruction amount fields

This commit is contained in:
0xfnzero
2026-05-17 21:32:48 +08:00
parent c0883dfc7b
commit b60838a840
5 changed files with 26 additions and 17 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "solana-streamer-sdk"
version = "1.4.4"
version = "1.4.5"
edition = "2021"
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
repository = "https://github.com/0xfnzero/solana-streamer"
@@ -15,14 +15,14 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["sdk-parse-borsh"]
sdk-parse-borsh = ["sol-parser-sdk/parse-borsh"]
# If both parser backend features are enabled, sol-parser-sdk 0.4.9+ uses zero-copy.
# If both parser backend features are enabled, sol-parser-sdk 0.4.10+ uses zero-copy.
sdk-parse-zero-copy = ["sol-parser-sdk/parse-zero-copy"]
sdk-perf-stats = ["sol-parser-sdk/perf-stats"]
sdk-ultra-perf = ["sol-parser-sdk/ultra-perf"]
[dependencies]
# Keep the streamer facade in lockstep with the sibling SDK while both crates evolve together.
sol-parser-sdk = { version = "0.4.9", default-features = false }
sol-parser-sdk = { version = "0.4.10", default-features = false }
solana-sdk = "3.0.0"
solana-client = "3.1.12"
solana-transaction-status = "3.1.12"
+7 -7
View File
@@ -123,33 +123,33 @@ Add the dependency to your `Cargo.toml`:
```toml
# Add to your Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.4" }
solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.5" }
```
### Use crates.io
```toml
# Add to your Cargo.toml
solana-streamer-sdk = "1.4.4"
solana-streamer-sdk = "1.4.5"
```
Parser backend features:
```toml
# Default: sol-parser-sdk parse-borsh backend
solana-streamer-sdk = "1.4.4"
solana-streamer-sdk = "1.4.5"
# Zero-copy parser backend for latency-sensitive bots
solana-streamer-sdk = { version = "1.4.4", default-features = false, features = ["sdk-parse-zero-copy"] }
solana-streamer-sdk = { version = "1.4.5", default-features = false, features = ["sdk-parse-zero-copy"] }
```
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.4.9+` uses the zero-copy backend.
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.4.10+` uses the zero-copy backend.
## 🔄 Migration Guide
### Upgrading to v1.4.4
### Upgrading to v1.4.5
Version 1.4.4 uses `sol-parser-sdk 0.4.9` from crates.io for all supported protocol parsing across Yellowstone gRPC, ShredStream, RPC transaction parsing, and account parsing while preserving the existing subscription and callback API. Existing bots can usually upgrade by changing only the crate version.
Version 1.4.5 uses `sol-parser-sdk 0.4.10` from crates.io and preserves PumpFun instruction args (`amount`, `max_sol_cost`, `min_sol_output`) across Yellowstone gRPC, ShredStream, RPC transaction parsing, and account parsing while preserving the existing subscription and callback API. Existing bots can usually upgrade by changing only the crate version.
New optional capabilities:
+7 -7
View File
@@ -122,33 +122,33 @@ git clone https://github.com/0xfnzero/solana-streamer
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.4" }
solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.5" }
```
### 使用 crates.io
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = "1.4.4"
solana-streamer-sdk = "1.4.5"
```
解析后端 feature
```toml
# 默认:sol-parser-sdk parse-borsh 后端
solana-streamer-sdk = "1.4.4"
solana-streamer-sdk = "1.4.5"
# 面向低延迟 Bot 的 zero-copy 解析后端
solana-streamer-sdk = { version = "1.4.4", default-features = false, features = ["sdk-parse-zero-copy"] }
solana-streamer-sdk = { version = "1.4.5", default-features = false, features = ["sdk-parse-zero-copy"] }
```
如果同时启用 `sdk-parse-borsh``sdk-parse-zero-copy``sol-parser-sdk 0.4.9+` 会优先使用 zero-copy 后端。
如果同时启用 `sdk-parse-borsh``sdk-parse-zero-copy``sol-parser-sdk 0.4.10+` 会优先使用 zero-copy 后端。
## 🔄 迁移指南
### 升级到 v1.4.4
### 升级到 v1.4.5
v1.4.4 使用 crates.io 上的 `sol-parser-sdk 0.4.9` 处理 Yellowstone gRPC、ShredStream、RPC 交易解析和账户解析中的所有当前支持协议,同时保留已有订阅和回调 API。大多数 Bot 只需要修改 crate 版本即可升级。
v1.4.5 使用 crates.io 上的 `sol-parser-sdk 0.4.10`,并在 Yellowstone gRPC、ShredStream、RPC 交易解析和账户解析中保留 PumpFun 指令参数 `amount``max_sol_cost``min_sol_output`,同时保留已有订阅和回调 API。大多数 Bot 只需要修改 crate 版本即可升级。
新增可选能力:
+6
View File
@@ -62,6 +62,9 @@ mod tests {
t.user = Pubkey::new_unique();
t.sol_amount = 100;
t.token_amount = 200;
t.amount = 200;
t.max_sol_cost = 150;
t.min_sol_output = 0;
t.is_buy = true;
let ev = convert_parser_event(PbDexEvent::PumpFunTrade(t), None, 999).expect("convert");
@@ -71,6 +74,9 @@ mod tests {
assert_eq!(st.metadata.recv_us, 999);
assert_eq!(st.sol_amount, 100);
assert_eq!(st.token_amount, 200);
assert_eq!(st.amount, 200);
assert_eq!(st.max_sol_cost, 150);
assert_eq!(st.min_sol_output, 0);
assert!(st.is_buy);
}
_ => panic!("expected PumpFunTradeEvent"),
@@ -556,6 +556,9 @@ pub(crate) fn pumpfun_trade_from_parser_with_event_type(
cashback_fee_basis_points: t.cashback_fee_basis_points,
cashback: t.cashback,
is_cashback_coin: t.is_cashback_coin,
amount: t.amount,
max_sol_cost: t.max_sol_cost,
min_sol_output: t.min_sol_output,
..Default::default()
};
DexEvent::PumpFunTradeEvent(st)