Solana Custom TWAPs - Max Number of Price Updates Possible

Hi Pyth team — looking for guidance on best practices for posting multiple TWAP updates atomically on Solana.

We’re using getLatestTwaps with the Hermes client for up to ~10 price feeds, then posting them via the transaction builder (per the docs).

Two questions:

  1. Feasibility: Is it possible to post updates for ~10 TWAP feeds in a single transaction, or is there a known upper limit (we’ve heard “2 max” informally)?
  2. Best practice: For use cases that require atomic updates of multiple prices, is postPartiallyVerifiedPriceUpdate the recommended approach (lowering guardian sig checks from 13/19 to, say, 5–8)? If so, do you have guidance on the trade-off between signature threshold and data integrity, and whether this is widely used in production?

Any recommended patterns or examples for handling many simultaneous TWAP updates would be appreciated!

Hey,

Due to the size of the individual Merkle proofs and the fact that you require 2 proofs to post a single TWAP update, it will not be possible to post more than 1 TWAP update in one transaction with the current receiver contract. Additionally, before the posting any of the TWAP updates you will need to post two VAAs containing the Merkle roots, which will add a base cost of 3 transactions.

The partially verified mode is only available (in the official contract) for simple price updates and not TWAP updates. In the context of price updates, it has been used in production by some protocols, the only thing that changes is the number of Wormhole guardians that need to be compromised for someone to be able to forge arbitrary prices (13 our of 19 by default and 3 out of 19 if you lower to 3 signatures checks).

I invite you to play with pyth-crosschain/target_chains/solana/sdk/js/pyth_solana_receiver/examples/post_twap_update.ts at main · pyth-network/pyth-crosschain · GitHub on devnet and check the output on explorer to get a better idea of the transactions footprint.