mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-17 10:58:06 +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:
@@ -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