pump buy_exact_sol_in parsered

This commit is contained in:
thloyi
2025-11-24 17:47:56 +08:00
parent f86c5591c1
commit 1f63a3a18f
6 changed files with 72 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"time"
"github.com/shopspring/decimal"
parser "github.com/thloyi/pump-parser"
example "github.com/thloyi/pump-parser/example"
"github.com/thloyi/pump-parser/example/geyser"
@@ -21,7 +22,7 @@ func main() {
ch := make(chan geyser.SubscriptionMessage, 1)
go geyser.RunLoopWithReConnect(context.Background(), "127.0.0.1:10001", parser.SolProgramPump, ch)
// var tokenTxs = make(map[string]*types.Tx)
currentBlock := uint64(0)
// currentBlock := uint64(0)
for msg := range ch {
if msg.Tx == nil {
block := msg.Block
@@ -42,9 +43,9 @@ func main() {
//if tx.Program != parser.SolProgramPump {
// continue
//}
if currentBlock == ptx.Block {
continue
}
//if currentBlock == ptx.Block {
// continue
//}
// 处理交易
txErr, ok := ptx.Err.(*geyser.TransactionError)
@@ -64,11 +65,14 @@ func main() {
if tx.Program != parser.SolProgramPump {
continue
}
if tx.Token1Amount.GreaterThanOrEqual(decimal.NewFromFloat(0.1)) || tx.Event != "buy" {
continue
}
printed = true
fmt.Printf("t: %s, block: %d, hash: %s, signer: %s, program: %s, event: %s, token1: %s, cuPrice: %s, mevAgent: %s, mevFee: %s, platform: %s, platformFee: %s, entryContract: %s, mayhem: %t\n",
time.Now().Format(time.RFC3339Nano),
tx.Block, tx.GetTxHash(), tx.Maker, tx.Program, tx.Event, tx.Token1Amount, tx.CUPrice, tx.MevAgent, tx.MevAgentFee, tx.Platform, tx.PlatformFee, tx.EntryContract, tx.Mayhem)
break
//break
}
if !printed {
continue
@@ -79,7 +83,7 @@ func main() {
// tx.BeforeSolBalance, tx.AfterSOLBalance, tx.AfterSignerToken0Balance, tx.TokenCreator, tx.Token0Program, tx.Mayhem)
}
currentBlock = ptx.Block
// currentBlock = ptx.Block
//
//if tx.Event == "create" {
// if err := pool.Submit(func() {