I have been facing some issues on Solana and would love to get help.
I followed the instructions in the Pyth documentation and tried to update the price of Launchcoin using TypeScript. However, after executing the function below, I found that the Launchcoin oracle account was not initialized. Could it be that I missed some steps?
I think I’ve found how the examples are intended to be used. Based on what you shared:
Example 1: Allows users to send transactions to update the price, and the on-chain program can use a fixed oracle account address to fetch the price.
Example 2: Also allows users to send transactions to update the price, but the oracle account used to fetch the price is dynamically generated each time, so it’s different on every update.
I’m using Case 1 with a fixed oracle address to update the price. It sometimes works successfully, but quite often it fails at the CloseAccount step, like in this case. Could it be that there’s something wrong with the way I’ve implemented the code?
Previously, I only initialized a single object using the newTransactionBuilder function and reused it each time I updated the price. That led to errors like the one above.
However, after I started creating a new object with newTransactionBuilder every time I updated the price, the error stopped occurring. I’m not sure if that was just a coincidence.