fix okx user
This commit is contained in:
@@ -5,10 +5,8 @@ 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"
|
||||
example "github.com/thloyi/pump-parser/internal/example"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -19,8 +17,8 @@ func main() {
|
||||
//xt := tracker.NewTwitterTracker(nil) // Initialize Twitter tracker if needed
|
||||
// laserstream-mainnet-slc.helius-rpc.com:80
|
||||
|
||||
ch := make(chan geyser.SubscriptionMessage, 1)
|
||||
go geyser.RunLoopWithReConnect(context.Background(), "127.0.0.1:10001", parser.SolProgramPump, ch)
|
||||
ch := make(chan example.SubscriptionMessage, 1)
|
||||
go example.RunLoopWithReConnect(context.Background(), "127.0.0.1:10001", parser.SolProgramPump, ch)
|
||||
// var tokenTxs = make(map[string]*types.Tx)
|
||||
// currentBlock := uint64(0)
|
||||
for msg := range ch {
|
||||
@@ -48,7 +46,7 @@ func main() {
|
||||
//}
|
||||
|
||||
// 处理交易
|
||||
txErr, ok := ptx.Err.(*geyser.TransactionError)
|
||||
txErr, ok := ptx.Err.(*parser.TransactionError)
|
||||
var customerErrCode uint32
|
||||
var instructorErrIndex uint8
|
||||
if ok {
|
||||
@@ -62,16 +60,16 @@ func main() {
|
||||
}
|
||||
printed := false
|
||||
for _, tx := range txs {
|
||||
if tx.Program != parser.SolProgramPump {
|
||||
continue
|
||||
}
|
||||
if tx.Token1Amount.GreaterThanOrEqual(decimal.NewFromFloat(0.1)) || tx.Event != "buy" {
|
||||
continue
|
||||
}
|
||||
//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",
|
||||
fmt.Printf("t: %s, block: %d, hash: %s, maker: %s, program: %s, event: %s, token0: %s, entryContract: %s, token balance: %s, \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)
|
||||
tx.Block, tx.GetTxHash(), tx.Maker, tx.Program, tx.Event, tx.Token0Amount, tx.EntryContract, tx.AfterSignerToken0Balance)
|
||||
//break
|
||||
}
|
||||
if !printed {
|
||||
|
||||
Reference in New Issue
Block a user