0

I want to get Sol reserves and token reserves for a newly create pump.fun token. On Solscan, I can see these values in the inner instructions of the tokens creation signature. Heres an example:

https://solscan.io/tx/aGU881DDvgpeezs9mUFJWv3KYkwEggWEQtcxTCupovLhLfgZ3fpwLWyGmA8bbzaQ4JxW39uA29zxHvx5LSBG3Qu

Under instruction "#6.4 - Pump.Fun: Unknown" you can see "virtualSolReserves" and "virtualTokenReserves" in the Events section. My question is how do I get the value of these fields.

When I use getTransaction(), I can get the "Instruction Data Raw". For example, using the same solscan transaction above I can get the Raw Instruction Data in encoded form, which looks like: 2K7nL28PxCW8ejnyCeuMpbXf8Xj7ysXeidJ55TJtZ8PzmG6NLHutyvhym8DqCYcg92aNSXYc4zw6BTJH2matHQR2vqYABBozk3wQJnArhbuCarwm6a1rdvkWiQS8JzqX5citcf3Hf8VMppEpJHtxDQ7J6FJHdnvUG7tyfqG6iU2wpqKR9MZS8515ZAXq

(on the solscan link provided, you can see this by control-f "e445a52e51cb9a1dbddb7fd34ee661eec5c7cc3d63eb826f29ed1c13ed12b623b18dc813f9f0068ae959561c0ed153ef00a3e111000000002d269589a90900000102d9b0c8ef65efba9ce4f49d239deb27e0b90af8432c7f91726f4f185f2a7a971803656600000000004f050e07000000d3e942be39c6030000a3e11100000000d3513072a8c70200" and then hitting the little wheel next to it to the encoded form)

Ultimately, I am wondering how decode this raw instruction data to get its information and values. How would I create a program in PYTHON to decode this? Any guidance would be greatly appreciated :)

1 Answer 1

0

You can use the deserialize method from the Transaction class of solana.py to acheive this.

Refer to the documentation here: https://michaelhly.com/solana-py/core/transaction/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.