diff --git a/README.md b/README.md index 3c7fdc2..a92729b 100755 --- a/README.md +++ b/README.md @@ -652,3 +652,12 @@ MIT License - [English](README.md) - [中文](README_CN.md) + + +## 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). + +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. diff --git a/src/streaming/event_parser/common/filter.rs b/src/streaming/event_parser/common/filter.rs index 732f094..52d2825 100644 --- a/src/streaming/event_parser/common/filter.rs +++ b/src/streaming/event_parser/common/filter.rs @@ -251,6 +251,10 @@ fn push_streamer_event_sdk_grpc_types( St::PumpFeesUpdateFeeConfig => out.push(Sdk::PumpFeesUpdateFeeConfig), St::PumpFeesUpdateFeeShares => out.push(Sdk::PumpFeesUpdateFeeShares), St::PumpFeesUpsertFeeTiers => out.push(Sdk::PumpFeesUpsertFeeTiers), + St::PumpFunPostCompleteBuy => out.push(Sdk::PumpFunPostCompleteBuy), + St::PumpFunSweepBondingCurveFee => out.push(Sdk::PumpFunSweepBondingCurveFee), + St::PumpFunComplete => out.push(Sdk::PumpFunComplete), + St::PumpSwapSweepPoolFee => out.push(Sdk::PumpSwapSweepPoolFee), St::PumpFunMigrateBondingCurveCreator => out.push(Sdk::PumpFunMigrateBondingCurveCreator), St::PumpSwapBuy => out.push(Sdk::PumpSwapBuy), St::PumpSwapSell => out.push(Sdk::PumpSwapSell), @@ -373,6 +377,9 @@ fn push_protocol_sdk_grpc_event_types(protocol: &Protocol, out: &mut Vec Pool { Pool { + creator_fees: p.creator_fees, + protocol_fees: p.protocol_fees, pool_bump: p.pool_bump, index: p.index, creator: p.creator, diff --git a/src/streaming/parser_sdk_bridge/convert.rs b/src/streaming/parser_sdk_bridge/convert.rs index 36ac6d6..e1a7993 100644 --- a/src/streaming/parser_sdk_bridge/convert.rs +++ b/src/streaming/parser_sdk_bridge/convert.rs @@ -23,6 +23,60 @@ pub(crate) fn convert_parser_event( recv_wall_us: i64, ) -> Option { match ev { + PbDexEvent::PumpFunPostCompleteBuy(e) => { + let meta = adapt_pm( + e.metadata.clone(), + bt, + recv_wall_us, + ProtocolType::PumpFun, + EventType::PumpFunPostCompleteBuy, + pump_program(), + ); + Some(DexEvent::PumpFunPostCompleteBuyEvent(crate::streaming::event_parser::protocols::pumpfun::events::PumpFunPostCompleteBuyEvent{metadata:meta,user:e.user,mint:e.mint,bonding_curve:e.bonding_curve,quote_mint:e.quote_mint,timestamp:e.timestamp,base_out:e.base_out,quote_in:e.quote_in,fee_basis_points:e.fee_basis_points,fee:e.fee,creator_fee_basis_points:e.creator_fee_basis_points,creator_fee:e.creator_fee,buyback_fee:e.buyback_fee,pool_base_reserves_before:e.pool_base_reserves_before,pool_quote_reserves_before:e.pool_quote_reserves_before,pool_base_reserves_after:e.pool_base_reserves_after,pool_quote_reserves_after:e.pool_quote_reserves_after,})) + } + PbDexEvent::PumpFunSweepBondingCurveFee(e) => { + let meta = adapt_pm( + e.metadata.clone(), + bt, + recv_wall_us, + ProtocolType::PumpFun, + EventType::PumpFunSweepBondingCurveFee, + pump_program(), + ); + Some(DexEvent::PumpFunSweepBondingCurveFeeEvent(crate::streaming::event_parser::protocols::pumpfun::events::PumpFunSweepBondingCurveFeeEvent{metadata:meta,timestamp:e.timestamp,mint:e.mint,bonding_curve:e.bonding_curve,quote_mint:e.quote_mint,recipient:e.recipient,amount:e.amount,bucket:e.bucket,})) + } + PbDexEvent::PumpFunComplete(e) => { + let meta = adapt_pm( + e.metadata.clone(), + bt, + recv_wall_us, + ProtocolType::PumpFun, + EventType::PumpFunComplete, + pump_program(), + ); + Some(DexEvent::PumpFunCompleteEvent( + crate::streaming::event_parser::protocols::pumpfun::events::PumpFunCompleteEvent { + metadata: meta, + user: e.user, + mint: e.mint, + bonding_curve: e.bonding_curve, + timestamp: e.timestamp, + quote_mint: e.quote_mint, + }, + )) + } + PbDexEvent::PumpSwapSweepPoolFee(e) => { + let meta = adapt_pm( + e.metadata.clone(), + bt, + recv_wall_us, + ProtocolType::PumpSwap, + EventType::PumpSwapSweepPoolFee, + pumpswap_program(), + ); + Some(DexEvent::PumpSwapSweepPoolFeeEvent(crate::streaming::event_parser::protocols::pumpswap::events::PumpSwapSweepPoolFeeEvent{metadata:meta,timestamp:e.timestamp,pool:e.pool,base_mint:e.base_mint,quote_mint:e.quote_mint,recipient:e.recipient,payer:e.payer,amount:e.amount,bucket:e.bucket,})) + } + PbDexEvent::PumpFunTrade(t) => Some(pumpfun_trade_from_parser_with_event_type( t, bt, diff --git a/src/streaming/parser_sdk_bridge/mod.rs b/src/streaming/parser_sdk_bridge/mod.rs index 427329a..d0cab6b 100644 --- a/src/streaming/parser_sdk_bridge/mod.rs +++ b/src/streaming/parser_sdk_bridge/mod.rs @@ -419,6 +419,8 @@ mod tests { owner: Pubkey::new_unique(), rent_epoch: 0, pool: PbPumpSwapPool { + protocol_fees: 0, + creator_fees: 0, pool_bump: 7, index: 42, creator: Pubkey::new_unique(), diff --git a/src/streaming/parser_sdk_bridge/pump_pumpswap.rs b/src/streaming/parser_sdk_bridge/pump_pumpswap.rs index 6a5e92a..120ddd1 100644 --- a/src/streaming/parser_sdk_bridge/pump_pumpswap.rs +++ b/src/streaming/parser_sdk_bridge/pump_pumpswap.rs @@ -58,6 +58,7 @@ pub(crate) fn pumpfun_create_token_from_parser( virtual_quote_reserves: c.virtual_quote_reserves, creator_fee_bps: c.creator_fee_bps, is_holder_reward: c.is_holder_reward, + depth: c.depth, ix_name: "create".to_string(), ..Default::default() } @@ -356,6 +357,11 @@ pub(crate) fn pumpfun_global_account_from_parser( buyback_basis_points: e.global.buyback_basis_points, initial_virtual_quote_reserves: e.global.initial_virtual_quote_reserves, whitelisted_quote_mints: e.global.whitelisted_quote_mints, + creator_fee_configurable: e.global.creator_fee_configurable, + max_configurable_creator_fee_bps: e.global.max_configurable_creator_fee_bps, + holder_reward_claim_authority: e.global.holder_reward_claim_authority, + is_holder_reward_enabled: e.global.is_holder_reward_enabled, + max_curve_depth: e.global.max_curve_depth, }, } } @@ -372,6 +378,13 @@ pub(crate) fn pumpfun_bonding_curve_account_from_parser( owner: pump_program(), rent_epoch: 0, bonding_curve: BondingCurve { + creator_fee: e.bonding_curve.creator_fee, + protocol_fees: e.bonding_curve.protocol_fees, + depth: e.bonding_curve.depth, + initial_virtual_quote_reserves: e.bonding_curve.initial_virtual_quote_reserves, + post_complete_base_out: e.bonding_curve.post_complete_base_out, + post_complete_quote_in: e.bonding_curve.post_complete_quote_in, + virtual_token_reserves: e.bonding_curve.virtual_token_reserves, virtual_quote_reserves: e.bonding_curve.virtual_quote_reserves, real_token_reserves: e.bonding_curve.real_token_reserves, @@ -401,6 +414,7 @@ pub(crate) fn pumpfun_fee_config_account_from_parser( owner: pump_program(), rent_epoch: 0, fee_config: PumpFunFeeConfig { + exotic_flat_fees: pump_fees_fees_from_parser(e.fee_config.exotic_flat_fees), bump: e.fee_config.bump, admin: e.fee_config.admin, flat_fees: pump_fees_fees_from_parser(e.fee_config.flat_fees), @@ -533,6 +547,7 @@ pub(crate) fn pumpswap_buy_full_from_parser( buyback_fee_basis_points: b.buyback_fee_basis_points, buyback_fee: b.buyback_fee, virtual_quote_reserves: b.virtual_quote_reserves, + creator_fee_unclaimed: b.creator_fee_unclaimed, can_boost: b.can_boost, base_supply: b.base_supply, holder_rewards_bps: b.holder_rewards_bps, @@ -586,6 +601,7 @@ pub(crate) fn pumpswap_sell_full_from_parser( buyback_fee_basis_points: s.buyback_fee_basis_points, buyback_fee: s.buyback_fee, virtual_quote_reserves: s.virtual_quote_reserves, + creator_fee_unclaimed: s.creator_fee_unclaimed, can_boost: s.can_boost, base_supply: s.base_supply, holder_rewards_bps: s.holder_rewards_bps, @@ -757,6 +773,7 @@ pub(crate) fn pumpfun_trade_from_parser_with_event_type( quote_mint: normalize_pumpfun_quote_mint(t.quote_mint), quote_amount: t.quote_amount, virtual_quote_reserves: t.virtual_quote_reserves, + creator_fee_unclaimed: t.creator_fee_unclaimed, real_quote_reserves: t.real_quote_reserves, holder_rewards_bps: t.holder_rewards_bps, holder_rewards: t.holder_rewards,