Compare commits

...

3 Commits

Author SHA1 Message Date
thloyi
cd1d681621 record ProgramFailedToComplete failed tx 2026-03-02 15:47:11 +08:00
thloyi
920c5ba25b fix errTx do not updte sol transfer 2026-02-27 17:41:58 +08:00
thloyi
3d447ef2e8 fix errTx mev and cu 2026-02-27 17:07:49 +08:00
5 changed files with 13 additions and 11 deletions

View File

@@ -129,7 +129,7 @@ func (tx *Tx) Parser() error {
tx.Swaps = swaps tx.Swaps = swaps
} }
for i, instr := range tx.rawTx.Transaction.Message.Instructions { for i, instr := range tx.rawTx.Transaction.Message.Instructions {
if p, exists := actionPrograms[programAccount]; exists { if p, exists := actionPrograms[accountList[instr.ProgramIDIndex]]; exists {
_, err := p(tx, instr, InnerInstructions{}, [2]uint{uint(i), uint(0)}) _, err := p(tx, instr, InnerInstructions{}, [2]uint{uint(i), uint(0)})
if err != nil { if err != nil {
if errors.Is(err, InstructionIgnoredError) { if errors.Is(err, InstructionIgnoredError) {

View File

@@ -225,7 +225,7 @@ func failedTxBuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {

View File

@@ -268,7 +268,7 @@ func failedTxAmmBuyParser(tx *Tx, instruction Instruction, innerInstructions Inn
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {
@@ -392,7 +392,7 @@ func failedTxAmmSellParser(tx *Tx, instruction Instruction, innerInstructions In
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {

View File

@@ -354,7 +354,7 @@ func FromRpcTransactionWithMeta(tx rpc.TransactionWithMeta, blockTime *uint64, s
} }
errDetail, ok := oErr[1].(string) errDetail, ok := oErr[1].(string)
if ok { if ok {
if errDetail == "ComputationalBudgetExceeded" { if errDetail == "ComputationalBudgetExceeded" || errDetail == "ProgramFailedToComplete" {
sTx.Meta.Err.Enum = ComputationalBudgetExceeded sTx.Meta.Err.Enum = ComputationalBudgetExceeded
} else { } else {
sTx.Meta.Err.UnKnown = errDetail sTx.Meta.Err.UnKnown = errDetail

View File

@@ -34,6 +34,7 @@ func TransferParser(result *RawTx, instruction Instruction, offset [2]uint, tx *
from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]] from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
to := result.accountList[instruction.Accounts[1]] to := result.accountList[instruction.Accounts[1]]
if result.Meta.Err == nil {
if offset[1] == 0 { if offset[1] == 0 {
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{ tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
From: from, From: from,
@@ -41,6 +42,7 @@ func TransferParser(result *RawTx, instruction Instruction, offset [2]uint, tx *
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
}) })
} }
}
// load platform by to address // load platform by to address
platform, ok := platformFeeAddresses[to] platform, ok := platformFeeAddresses[to]
if ok { if ok {