Programmatically retrieve all Price Feed IDs + Solana addresses

Like it says on the tin: how can I retrieve a list of all price feed IDs that include the associated Solana Price Feed address?

e.g. on Price Feed IDs | Pyth Network

Crypto.SOL/USD has a price feed ID of 0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d and a Solana price feed ID of 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE

The “why” behind my question: I only have a (dynamic) list of Solana price feed IDs (e.g. 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE) that I want to monitor with Hermes, which requires the hex-formatted price ID.

It looks like the web app is making an RPC call to pythnet; getProgramAccounts for FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH. But I can’t find a canonical/official reference for decoding the returned data.

Any help would be appreciated. Thanks!

gm!

Price feed IDs and Solana price feed addresses are linked by a PDA derivation.
This function in the sdk maps feed IDs to price feed addresses. The shardId field is 0 for the accounts used for the Sponsored feeds.

@guibescos thank you! That’s very (very) helpful.

Is it safe to assume that all Solana price feed addresses listed at Price Feed IDs | Pyth Network were derived with a shardId of 0?

Yes, that’s right!
Other shards ids are available for developers that don’t want to avoid account contention with the shard 0 accounts.