From 9fd0d6a21b9576ced6c34ca35427b4277cf2545f Mon Sep 17 00:00:00 2001 From: bijianing97 <826015751@qq.com> Date: Tue, 2 Dec 2025 15:51:53 +0800 Subject: [PATCH] Update amm buy --- example/tx.go | 9 +++++++-- pumpamm.go | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/example/tx.go b/example/tx.go index afb56ac..d0157af 100644 --- a/example/tx.go +++ b/example/tx.go @@ -1,4 +1,4 @@ -package example +package parser import ( "time" @@ -74,6 +74,11 @@ func FromTx(tx *parser.Tx) []*Tx { token0Address := s.BaseMint token0Decimals := s.BaseMintDecimals if s.Program == "Pump" { + quoteMint := s.QuoteMint + // 有些数据里 quote 会给 SystemProgram,统一转成 WSOL + if quoteMint.Equals(solana.WrappedSol) || quoteMint.Equals(solana.SystemProgramID) { + quoteMint = solana.WrappedSol + } newTx = &Tx{ Err: nil, BondingCurve: s.Pool.String(), @@ -82,7 +87,7 @@ func FromTx(tx *parser.Tx) []*Tx { Token0Address: s.BaseMint.String(), Token0Program: s.BaseTokenProgram.String(), Token0Decimals: s.BaseMintDecimals, - Token1Address: "", + Token1Address: quoteMint.String(), Token0Amount: s.BaseAmount.Div(decimal.NewFromInt(1e6)), Token1Amount: s.QuoteAmount.Div(decimal.NewFromInt(1e9)), Block: tx.Block, diff --git a/pumpamm.go b/pumpamm.go index af2683f..9eb53c7 100644 --- a/pumpamm.go +++ b/pumpamm.go @@ -20,6 +20,7 @@ type ammBuyEvent struct { QuoteAmountIn uint64 LpFeeBasisPoints uint64 LpFee uint64 + ProtocolFeeBasisPoints uint64 ProtocolFee uint64 QuoteAmountInWithLpFee uint64 UserQuoteAmountIn uint64 @@ -31,6 +32,15 @@ type ammBuyEvent struct { ProtocolFeeRecipient solana.PublicKey ProtocolFeeRecipientTokenAccount solana.PublicKey CoinCreator solana.PublicKey + CoinCreatorFeeBasisPoints uint64 + CoinCreatorFee uint64 + TrackVolume bool + TotalUnclaimedTokens uint64 + TotalClaimedTokens uint64 + CurrentSolVolume uint64 + LastUpdateTimestamp int64 + MinBaseAmountOut uint64 + IxName string } type ammCreatePoolEvent struct { @@ -101,6 +111,8 @@ type ammSellEvent struct { ProtocolFeeRecipient solana.PublicKey ProtocolFeeRecipientTokenAccount solana.PublicKey CoinCreator solana.PublicKey + CoinCreatorFeeBasisPoints uint64 + CoinCreatorFee uint64 } type ammWithdrawEvent struct {