Compare commits
6 Commits
75c35f56f1
...
v2.0.16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fa6944a37 | ||
|
|
5d06d18aa8 | ||
| 9877794d1c | |||
| f6242f0193 | |||
| b06a1fa377 | |||
|
|
bd2dbe3c91 |
@@ -122,6 +122,10 @@ func parseDlmmInstruction(tx VersionedTransaction, instructionIndex int) (TxSign
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
lbPair, err := tx.GetAccount(int(instruction.Accounts[0]))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
userTokenOut, err := tx.GetAccount(int(instruction.Accounts[5]))
|
userTokenOut, err := tx.GetAccount(int(instruction.Accounts[5]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -220,6 +224,7 @@ func parseDlmmInstruction(tx VersionedTransaction, instructionIndex int) (TxSign
|
|||||||
ExactSOL: exactSol,
|
ExactSOL: exactSol,
|
||||||
ActiveBin: args.ActiveBin,
|
ActiveBin: args.ActiveBin,
|
||||||
MaxPriceImpactBps: args.MaxPriceImpactBps,
|
MaxPriceImpactBps: args.MaxPriceImpactBps,
|
||||||
|
LbPairAddress: lbPair.String(),
|
||||||
Block: tx.Block,
|
Block: tx.Block,
|
||||||
Token0AmountUint64: token0AmountUint64,
|
Token0AmountUint64: token0AmountUint64,
|
||||||
Token1AmountUint64: token1AmountUint64,
|
Token1AmountUint64: token1AmountUint64,
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
var flasProgramID = solana.MustPublicKeyFromBase58("FLASHX8DrLbgeR8FcfNV1F5krxYcYMUdBkrP1EPBtxB9")
|
var flasProgramID = solana.MustPublicKeyFromBase58("FLASHX8DrLbgeR8FcfNV1F5krxYcYMUdBkrP1EPBtxB9")
|
||||||
var (
|
var (
|
||||||
flasBuyTokensIX = []byte{0x00, 0x1, 0x4}
|
flasBuyTokensIX = []byte{0x00, 0x1, 0x1b}
|
||||||
flasSellTokensIX = []byte{0x01, 0x1, 0x3}
|
flasSellTokensIX = []byte{0x01, 0x1, 0x1a}
|
||||||
flasAmmBuyTokensIX = []byte{0x00, 0x2, 0x2}
|
flasAmmBuyTokensIX = []byte{0x00, 0x2, 0x2}
|
||||||
flasAmmSellTokensIX = []byte{0x01, 0x2, 0x2}
|
flasAmmSellTokensIX = []byte{0x01, 0x2, 0x2}
|
||||||
)
|
)
|
||||||
@@ -140,11 +140,11 @@ func parseFlasAmmBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal,
|
|||||||
|
|
||||||
func parseFlasSell(tx VersionedTransaction, instructionIndex int) (*TxSignal, error) {
|
func parseFlasSell(tx VersionedTransaction, instructionIndex int) (*TxSignal, error) {
|
||||||
instruction := tx.Instructions[instructionIndex]
|
instruction := tx.Instructions[instructionIndex]
|
||||||
if len(instruction.Accounts) < 9 {
|
if len(instruction.Accounts) < 11 {
|
||||||
return nil, fmt.Errorf("accounts too short")
|
return nil, fmt.Errorf("accounts too short")
|
||||||
}
|
}
|
||||||
|
|
||||||
mint, err := tx.GetAccount(int(instruction.Accounts[8]))
|
mint, err := tx.GetAccount(int(instruction.Accounts[10]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -178,15 +178,15 @@ func parseFlasSell(tx VersionedTransaction, instructionIndex int) (*TxSignal, er
|
|||||||
|
|
||||||
func parseFlasBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal, error) {
|
func parseFlasBuy(tx VersionedTransaction, instructionIndex int) (*TxSignal, error) {
|
||||||
instruction := tx.Instructions[instructionIndex]
|
instruction := tx.Instructions[instructionIndex]
|
||||||
if len(instruction.Accounts) < 9 {
|
if len(instruction.Accounts) < 11 {
|
||||||
return nil, fmt.Errorf("accounts too short")
|
return nil, fmt.Errorf("accounts too short")
|
||||||
}
|
}
|
||||||
|
|
||||||
mint, err := tx.GetAccount(int(instruction.Accounts[8]))
|
mint, err := tx.GetAccount(int(instruction.Accounts[10]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
user, err := tx.GetAccount(int(instruction.Accounts[0]))
|
user, err := tx.GetAccount(int(instruction.Accounts[1]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ type TxSignal struct {
|
|||||||
IsToken2022 bool `json:"is_token2022"`
|
IsToken2022 bool `json:"is_token2022"`
|
||||||
IsMayhemMode bool `json:"is_mayhem_mode"`
|
IsMayhemMode bool `json:"is_mayhem_mode"`
|
||||||
CUPrice decimal.Decimal `json:"cu_price"`
|
CUPrice decimal.Decimal `json:"cu_price"`
|
||||||
|
CULimit uint32 `json:"cu_limit"`
|
||||||
SWQoSAgent string `json:"swqos_agent"`
|
SWQoSAgent string `json:"swqos_agent"`
|
||||||
SWQoSTips decimal.Decimal `json:"swqos_tips"`
|
SWQoSTips decimal.Decimal `json:"swqos_tips"`
|
||||||
|
|
||||||
@@ -55,6 +56,8 @@ type TxSignal struct {
|
|||||||
ActiveBin int32 `json:"active_bin"`
|
ActiveBin int32 `json:"active_bin"`
|
||||||
// MaxPriceImpactBps is the price impact guard for swap_with_price_impact(2).
|
// MaxPriceImpactBps is the price impact guard for swap_with_price_impact(2).
|
||||||
MaxPriceImpactBps uint16 `json:"max_price_impact_bps"`
|
MaxPriceImpactBps uint16 `json:"max_price_impact_bps"`
|
||||||
|
//
|
||||||
|
LbPairAddress string `json:"lb_pair_address"`
|
||||||
|
|
||||||
// parsed values
|
// parsed values
|
||||||
Token0AmountUint64 uint64 `json:"-"`
|
Token0AmountUint64 uint64 `json:"-"`
|
||||||
|
|||||||
@@ -203,16 +203,19 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|||||||
cuPrice := decimal.Zero
|
cuPrice := decimal.Zero
|
||||||
swqosAgent := ""
|
swqosAgent := ""
|
||||||
swqosTips := decimal.Zero
|
swqosTips := decimal.Zero
|
||||||
|
cuLimit := uint32(0)
|
||||||
for _, instruction := range versioned.Instructions {
|
for _, instruction := range versioned.Instructions {
|
||||||
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if program.Equals(ComputeBudgetProgram) &&
|
if program.Equals(ComputeBudgetProgram) {
|
||||||
len(instruction.Data) == 9 &&
|
if len(instruction.Data) == 9 && instruction.Data[0] == 0x03 {
|
||||||
instruction.Data[0] == 0x03 {
|
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
||||||
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
cuPrice = formatCUPrice(cuPriceUint64)
|
||||||
cuPrice = formatCUPrice(cuPriceUint64)
|
} else if len(instruction.Data) == 5 && instruction.Data[0] == 0x02 {
|
||||||
|
cuLimit = binary.LittleEndian.Uint32(instruction.Data[1:4])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if program.Equals(solana.SystemProgramID) &&
|
if program.Equals(solana.SystemProgramID) &&
|
||||||
len(instruction.Data) == 12 &&
|
len(instruction.Data) == 12 &&
|
||||||
@@ -260,6 +263,7 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|||||||
one.Label = handler.Label
|
one.Label = handler.Label
|
||||||
one.Block = versioned.Block
|
one.Block = versioned.Block
|
||||||
one.CUPrice = cuPrice
|
one.CUPrice = cuPrice
|
||||||
|
one.CULimit = cuLimit
|
||||||
one.SWQoSAgent = swqosAgent
|
one.SWQoSAgent = swqosAgent
|
||||||
one.SWQoSTips = swqosTips
|
one.SWQoSTips = swqosTips
|
||||||
select {
|
select {
|
||||||
|
|||||||
Reference in New Issue
Block a user