chore: filter wsol for bonk
This commit is contained in:
@@ -59,7 +59,11 @@ func parseRaydiumLaunchLabCreate(tx VersionedTransaction, instruction Instructio
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
mint, err := tx.GetAccount(int(instruction.Accounts[6]))
|
||||
base, err := tx.GetAccount(int(instruction.Accounts[6]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quote, err := tx.GetAccount(int(instruction.Accounts[7]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -68,11 +72,16 @@ func parseRaydiumLaunchLabCreate(tx VersionedTransaction, instruction Instructio
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !quote.Equals(wrappedSOL) {
|
||||
// just ignore this
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return &TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "raydiumlaunchlab",
|
||||
Maker: creator.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: decimal.Zero,
|
||||
@@ -94,7 +103,11 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
return nil, fmt.Errorf("data too short for raydium launch lab swap args, len=%d", len(instruction.Data))
|
||||
}
|
||||
|
||||
mint, err := tx.GetAccount(int(instruction.Accounts[9]))
|
||||
base, err := tx.GetAccount(int(instruction.Accounts[9]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quote, err := tx.GetAccount(int(instruction.Accounts[10]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -103,6 +116,11 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !quote.Equals(wrappedSOL) {
|
||||
// just ignore this
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
amountA := binary.LittleEndian.Uint64(instruction.Data[8:16])
|
||||
amountB := binary.LittleEndian.Uint64(instruction.Data[16:24])
|
||||
|
||||
@@ -112,7 +130,7 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "raydiumlaunchlab",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(amountB),
|
||||
Token1Amount: formatSolAmount(amountA),
|
||||
@@ -130,7 +148,7 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "raydiumlaunchlab",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(amountA),
|
||||
Token1Amount: formatSolAmount(amountB),
|
||||
@@ -150,7 +168,7 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "raydiumlaunchlab",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(amountA),
|
||||
Token1Amount: formatSolAmount(amountB),
|
||||
@@ -168,7 +186,7 @@ func parseRaydiumLaunchLabSwap(tx VersionedTransaction, instruction Instructions
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "raydiumlaunchlab",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(amountB),
|
||||
Token1Amount: formatSolAmount(amountA),
|
||||
|
||||
Reference in New Issue
Block a user