chore: filter wsol for bonk
This commit is contained in:
@@ -229,7 +229,11 @@ func parseFlasBonkBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal,
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
mint, err := tx.GetAccount(int(instruction.Accounts[15]))
|
||||
base, err := tx.GetAccount(int(instruction.Accounts[15]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quote, err := tx.GetAccount(int(instruction.Accounts[16]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -237,6 +241,12 @@ func parseFlasBonkBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !quote.Equals(wrappedSOL) {
|
||||
// just ignore this
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if len(instruction.Data) > 20 {
|
||||
instruction.Data = instruction.Data[:20]
|
||||
}
|
||||
@@ -249,7 +259,7 @@ func parseFlasBonkBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal,
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "flas",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(args.Amount2),
|
||||
Token1Amount: formatSolAmount(args.Amount1),
|
||||
@@ -268,7 +278,11 @@ func parseFlasBonkSell(tx VersionedTransaction, instructionIndex int) (*TxSignal
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
mint, err := tx.GetAccount(int(instruction.Accounts[15]))
|
||||
base, err := tx.GetAccount(int(instruction.Accounts[15]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quote, err := tx.GetAccount(int(instruction.Accounts[16]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -277,6 +291,11 @@ func parseFlasBonkSell(tx VersionedTransaction, instructionIndex int) (*TxSignal
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !quote.Equals(wrappedSOL) {
|
||||
// just ignore this
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var args flasArgs
|
||||
if err := borsh.Deserialize(&args, instruction.Data[1:]); err != nil {
|
||||
return nil, fmt.Errorf("failed to parse buy tokens args: %w", err)
|
||||
@@ -286,7 +305,7 @@ func parseFlasBonkSell(tx VersionedTransaction, instructionIndex int) (*TxSignal
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "flas",
|
||||
Maker: user.String(),
|
||||
Token0Address: mint.String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(args.Amount1),
|
||||
Token1Amount: formatSolAmount(args.Amount2),
|
||||
|
||||
Reference in New Issue
Block a user