If you’re using the pull model (fetching & updating the price on-demand and inlining your app’s instructions,) I would suggest using postPriceUpdate instead of updatePriceFeed. This posts an ephemeral price update to the chain for your app to consume, instead of updating a feed (push model). It’s cheaper as well.
With postPriceUpdate from the sendusd example, I’m able to run the example with skipPreflight=false and I get a wallet popup without a “no simulation” warning:
with shardId 0 or 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE
because I have noticed some programs don’t check for the owner for price_update_account.owner and in the heat of the moment when I wrote the program 11 months ago, I made sure to include the price update account but with a hardcode check. it did take me 30 minutes to integrate the onchain account price checker. so big ups there.
anywho, I believe I found my answer. I will have to rewrite some logic and make sure that the postPriceUpdate account is verified on our side.
the reason being is we add the price_update_account in the remaining_accounts rather than have it in the list of anchor accounts.
and FYI, everything works nicely in solana. the above is on sonic svm chain.
hey @cryptomiester, sorry but I saw that you said you’ve integrated pyth on sonic svm and everything is working, just wonder if you can share the snippet where you fetch the price? A couple tokens should be fine e.g. USDT, USDC, SONIC and maybe a meme token