Hello!
I’m working on a Solana program that fetches token prices on-chain using the pyth_sdk_solana crate. These tokens (like BTC/USD and ETH/USD) are already supported by Pyth, so I’m not pushing any price updates from the client — just reading the latest prices directly from the price feed accounts.
The issue arises during testing: when I pass a known valid Pyth price feed account (from devnet) into the program, my call to SolanaPriceAccount::account_info_to_feed or load_price_feed_from_account_info fails and returns an error.
I’ve confirmed the following:
-
I’m using verified price feed public keys from pyth.network
-
The account is correctly passed in via the test client
-
The account has data (checked with
solana account <address> --output json --url devnet)Yet the SDK returns an error likeInvalidAccountOwneror similar when parsing the account.
Has anyone encountered this behavior or have tips on how to debug it more effectively?
Any insight or working examples of on-chain-only price feed reading (without pushing updates) would be greatly appreciated!
Thanks in advance!