Hermes Client - Invalid response

Hey,

We are currently using @pythnetwork/hermes-client and getLatestPriceUpdates function to retrieve Pyth price feeds in batch mode.

However, the current implementation causes an issue: if even a single feedId is invalid or fails to resolve, the entire batch request fails.

  1. Is there a reliable way to pre-validate whether a given feedId is valid/exists before including it in a batch request?
  2. If possible, could you provide (or point us to) an alternative batch retrieval method that supports partial success — i.e., returns prices for all valid feedIds while gracefully handling errors for invalid or unavailable ones without rejecting the whole batch?

We have an ignoreInvalidPriceIds option in the requests that lets you get the feeds partially. See here for more info.

1 Like

Thanks!

Every 15 seconds, we call your SDK to fetch the latest prices; we batch 20 tokens in each call.
As of now, we see that more than 40% of the API calls take more than 2 seconds, and occasionally it will reach a 5-second timeout. Is it expected?

From which location are you hitting Hermes endpoints? We generally recommend using a private Hermes RPC for production usecases.

We call it from Singapore