Subscription using eth_subscribe (coming later - HIP-694)
For production environments, itโs highly recommended to use a paid Mirror Node provider for commercial and high-traffic purposes. While Hederaโs public mirror node offers free REST API and JSON API endpoints, they have global rate limits. These are best suited for development or low rate usage scenarios.
โฝ No gas costWhenever the reserve values for a pool contract are updated, either due to liquidity changes or a swap, a Sync event is emitted from the contract, containing the updated reserve values for the token pair. The following code demonstrates how to listen for Sync events for all pools using REST API or JSON RPC.
Listening to โSyncโ events without specifying an address in the filter data will return logs for all pools on SaucerSwap, as well as other DEXs on Hedera that share the same โtopic0โ hash signature for the โSyncโ event. To identify and filter specific pools, extract the poolโs EVM address from the log.
โฝ No gas costWhenever the reserve values for a pool contract are updated, either due to liquidity changes or a swap, a Sync event is emitted from the contract, containing the updated reserve values for the token pair. The following code demonstrates how to listen for Sync events for a specific pool using REST API or JSON RPC.