mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-13 08:58:05 +00:00
feat: upgrade to v0.1.8 and add volume accumulator support
- Bump version from 0.1.7 to 0.1.8 - Update version references in README.md and README_CN.md - Add global_volume_accumulator and user_volume_accumulator fields to PumpFunTradeEvent - Fix account index mapping in trade parser (creator_vault index adjusted from 8 to 9) This update introduces volume accumulator support for PumpFun protocol event parsing, aligning with the latest protocol account structure changes.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-streamer-sdk"
|
||||
version = "0.1.7"
|
||||
version = "0.1.8"
|
||||
edition = "2021"
|
||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||
repository = "https://github.com/0xfnzero/solana-streamer"
|
||||
|
||||
@@ -33,14 +33,14 @@ Add the dependency to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.7" }
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.8" }
|
||||
```
|
||||
|
||||
### Use crates.io
|
||||
|
||||
```toml
|
||||
# Add to your Cargo.toml
|
||||
solana-streamer-sdk = "0.1.7"
|
||||
solana-streamer-sdk = "0.1.8"
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
+2
-2
@@ -33,14 +33,14 @@ git clone https://github.com/0xfnzero/solana-streamer
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.7" }
|
||||
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.8" }
|
||||
```
|
||||
|
||||
### 使用 crates.io
|
||||
|
||||
```toml
|
||||
# 添加到您的 Cargo.toml
|
||||
solana-streamer-sdk = "0.1.7"
|
||||
solana-streamer-sdk = "0.1.8"
|
||||
```
|
||||
|
||||
## 使用示例
|
||||
|
||||
@@ -2,8 +2,8 @@ use borsh::BorshDeserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
||||
use crate::streaming::event_parser::common::EventMetadata;
|
||||
use crate::impl_unified_event;
|
||||
use crate::streaming::event_parser::common::EventMetadata;
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, BorshDeserialize)]
|
||||
pub struct PumpFunCreateTokenEvent {
|
||||
@@ -55,7 +55,7 @@ pub struct PumpFunTradeEvent {
|
||||
pub real_sol_reserves: u64,
|
||||
pub real_token_reserves: u64,
|
||||
pub fee_recipient: Pubkey,
|
||||
pub fee_basis_points: u64,
|
||||
pub fee_basis_points: u64,
|
||||
pub fee: u64,
|
||||
pub creator: Pubkey,
|
||||
pub creator_fee_basis_points: u64,
|
||||
@@ -78,6 +78,10 @@ pub struct PumpFunTradeEvent {
|
||||
pub is_bot: bool,
|
||||
#[borsh(skip)]
|
||||
pub is_dev_create_token_trade: bool, // 是否是dev创建token的交易
|
||||
#[borsh(skip)]
|
||||
pub global_volume_accumulator: Pubkey,
|
||||
#[borsh(skip)]
|
||||
pub user_volume_accumulator: Pubkey,
|
||||
}
|
||||
|
||||
impl_unified_event!(
|
||||
|
||||
@@ -174,7 +174,9 @@ impl PumpFunEventParser {
|
||||
associated_bonding_curve: accounts[4],
|
||||
associated_user: accounts[5],
|
||||
user: accounts[6],
|
||||
creator_vault: accounts[8],
|
||||
creator_vault: accounts[9],
|
||||
global_volume_accumulator: accounts[12],
|
||||
user_volume_accumulator: accounts[13],
|
||||
max_sol_cost,
|
||||
amount,
|
||||
is_buy: true,
|
||||
@@ -209,7 +211,7 @@ impl PumpFunEventParser {
|
||||
associated_bonding_curve: accounts[4],
|
||||
associated_user: accounts[5],
|
||||
user: accounts[6],
|
||||
creator_vault: accounts[8],
|
||||
creator_vault: accounts[9],
|
||||
min_sol_output,
|
||||
amount,
|
||||
is_buy: false,
|
||||
|
||||
Reference in New Issue
Block a user