Solana: Errors while updating a new price feed

Hey,

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?


These two are the transactions I used to update the launchcoin price through pyth:

Here, I’m able to retrieve the oracle account using SOL’s priceFeedId, but I’m unable to do so for LaunchCoin.


Also, from the examples I saw in the official documentation, the Solana contract uses priceFeedId to read the price instead of the price oracle account?
https://docs.pyth.network/price-feeds/use-real-time-data/solana

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.

1 Like



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?

gm!

Do mind sharing some explorer links so we can check this out more in-depth?

Here is the transaction link:

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.

gm!

That makes sense: transactionBuilder’s are designed to be dropped after building one batch of transactions. Reusing them can lead to strange behavior.