at HermesClient.httpRequest (/app/node_modules/@pythnetwork/hermes-client/lib/HermesClient.js:39:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
It seems like the Hermes client is being rate-limited or blocked by Cloudflare, returning a 429 status code and an HTML response instead of the expected data. The error appears to originate from this part of the stack:
Could someone please help investigate and resolve this issue ?
The public hermes instances have rate limits (similar to this) but it is very generous and you shouldn’t normally hit it. I’m wondering how often you are hitting the endpoint that is resulting in ratelimit. If you want to get the data frequently I recommend using the streaming endpoint.
We’re using three price feed IDs: APT, BTC, and ETH. Every 20 seconds, we fetch the payloads for all three feeds and submit the corresponding transactions.
We use the following function to update the prices:
We also have a function to update the funding rate. For this, we fetch data from https://hermes-beta.pyth.network for the same three price feed IDs and submit the transaction every 1 minute.
I double checked the ratelimit and it’s 29 requests every 10 seconds and if you make 1 every 20 seconds it shouldn’t hit it. Can you double check your code? The part that you shared doesn’t seem to have any problem.