Using Supported price feed on Devnet

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 like InvalidAccountOwner or 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!

Hi @Baseddev thanks for your question, it seems that the account data is present on-chain but you’re not able to parse it via the pyth_sdk_solana crate. I’m reaching out to developers to get you help resolving with this. Thanks for your patience!

Hi @Baseddev

Sorry for the confusion, the SDK you are using is actually the wrong SDK and has the implementation details of account on Pythnet. We’ll update it shortly to add a notice there.

When you want to consume a price on Solana (that is either pushed by yourself, or sponsored). you should use pyth-solana-receiver-sdk . Please follow the guide here for more information.

1 Like