- Polling Sync events for all pools
- Polling Sync events for a pool
- Subscription using eth_subscribe (coming later - HIP-694)
Polling Sync events for all pools
No gas cost — read-only call. Whenever 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.- JSON RPC
- REST API
Polling Sync events for a pool
No gas cost — read-only call. Whenever 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.- JSON RPC
- REST API
Next steps
Get pool reserves (V1)
Read a reserve snapshot for one pool.
Track swap events (V1)
Monitor executed swaps the same way.