0xpapercut / solana-substreams

Solana substreams monorepo.
11 stars 3 forks source link

fix: fix wrong user address in swap instruction #7

Closed graykode closed 2 months ago

graykode commented 2 months ago

Heyy guy I appreciate your great work! However, there might be an issue with how the swap event is parsed.

The user from the accounts of the instruction (means last index in context.accounts) does not guarantee a signature signer.

Let's check signituare: https://solscan.io/tx/48YXVugJKtSzsEQjUrhyiCgqRWT7c8qqNHSjZg1wFFSo2pwuLKV7GsnictiRZ2RxMY83zdmzkEubTydELNUBPY9o

graykode commented 2 months ago

Above signituare, context.accounts says [11, 3, 14, 7, 1, 2, 13, 18, 22, 12, 21, 19, 25, 17, 4, 6, 15] but last index is not signer. It seems the varying lengths of the accounts array make it difficult for us to parse.

0xpapercut commented 2 months ago

hello,

i think maybe what's happening on that the signer (6JtHTee2Fmwjt87sc7XPDRyv3Hmcx3t11f3h8259XPhN) calls a program (F4RrGXd9R6yusCuUaEPCLF8t47Z57JiHCHPZcz3mJhoy) which owns the user account that interacts with raydium (5sQRtdhipmnsBsWhQ5Awt8VrSVqhYy6ynNBn4Uq5goBv).

0xpapercut commented 2 months ago

so the signer and the user are indeed not the same in this case.