From 40012b531cfe45f44cb2b8639466475e8d502e77 Mon Sep 17 00:00:00 2001 From: thloyi Date: Tue, 10 Feb 2026 10:32:46 +0800 Subject: [PATCH] fix meteora pool entrycontract --- internal/test2/test.go | 2 +- metaorapool.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/test2/test.go b/internal/test2/test.go index 81043c4..bbafadd 100644 --- a/internal/test2/test.go +++ b/internal/test2/test.go @@ -23,7 +23,7 @@ var () func main() { - var slot uint64 = 399060766 + var slot uint64 = 399230674 var data = NewBlockData(decimal.NewFromFloat(100.0)) client := rpc.New("https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d") var rewards = false diff --git a/metaorapool.go b/metaorapool.go index 8bde0bf..21f7554 100644 --- a/metaorapool.go +++ b/metaorapool.go @@ -371,6 +371,7 @@ func metaoraPoolAddLiquidity(tx *Tx, instruction Instruction, innerInstructions if len(instruction.Accounts) < 14 { return nil, increaseOffset(offset), fmt.Errorf("invalid instruction accounts length") } + var entryContract = tx.rawTx.accountList[tx.rawTx.Transaction.Message.Instructions[offset[0]].ProgramIDIndex] pool := tx.rawTx.accountList[instruction.Accounts[0]] lpMint := tx.rawTx.accountList[instruction.Accounts[1]] @@ -494,8 +495,6 @@ func metaoraPoolAddLiquidity(tx *Tx, instruction Instruction, innerInstructions return nil, increaseOffset(offset), fmt.Errorf("failed to find deposit instructions") } - var entryContract = tx.rawTx.accountList[tx.rawTx.Transaction.Message.Instructions[offset[0]].ProgramIDIndex] - var event = "add_liquidity_one_side" if baseFound && quoteFound { // both sides @@ -530,6 +529,7 @@ func metaoraPoolRemoveLiquidity(tx *Tx, instruction Instruction, innerInstructio if len(instruction.Accounts) < 14 { return nil, increaseOffset(offset), fmt.Errorf("invalid instruction accounts length") } + var entryContract = tx.rawTx.accountList[tx.rawTx.Transaction.Message.Instructions[offset[0]].ProgramIDIndex] pool := tx.rawTx.accountList[instruction.Accounts[0]] lpMint := tx.rawTx.accountList[instruction.Accounts[1]] @@ -700,8 +700,6 @@ func metaoraPoolRemoveLiquidity(tx *Tx, instruction Instruction, innerInstructio return nil, increaseOffset(offset), fmt.Errorf("failed to find withdraw instructions, baseFound: %v, quoteFound: %v", baseFound, quoteFound) } - var entryContract = tx.rawTx.accountList[tx.rawTx.Transaction.Message.Instructions[offset[0]].ProgramIDIndex] - var event = "remove_liquidity_one_side" if baseFound && quoteFound { event = "remove_liquidity"