Subscriptions (WebSockets) require a Growth or Enterprise plan. Learn more.
Example Subscription
Example Response
Usage Guidelines
- Subscribe using the pair ID in format
pairAddress:networkId(e.g.,0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1) - Use
quoteTokenparameter (token0ortoken1) to specify which token’s perspective to use for price data - Use
useNonLiquidityTokenAsQuoteToken: trueto automatically select the non-liquidity token as the quote token - Updates are pushed in real-time as trades occur on the pair
- Price change fields (
priceChange5m,priceChange1, etc.) are in decimal format (0.01 = 1%) - Volume fields represent USD value traded in the specified time window
- Use
statsTypeto see if stats areFILTERED(bot-filtered) orUNFILTERED
Troubleshooting Tips
How do I get the pair ID for a token?
How do I get the pair ID for a token?
Use the
filterPairs or listPairsForToken query to find the pair address and network ID for your token. The subscription ID format is pairAddress:networkId.Why am I not receiving updates?
Why am I not receiving updates?
Updates are only pushed when trades occur on the pair. Low-activity pairs may have infrequent updates. Ensure your WebSocket connection is properly established and you’re subscribed to an active pair.
What's the difference between token0 and token1?
What's the difference between token0 and token1?
Token ordering is determined by the pair contract. Use the
quoteToken parameter to specify which token you want as the base for price calculations, or use useNonLiquidityTokenAsQuoteToken: true to automatically select the non-stable/non-major token.How do I handle WebSocket reconnections?
How do I handle WebSocket reconnections?
Implement reconnection logic in your client. When reconnecting, you’ll need to re-subscribe to the pairs you were monitoring. Consider using a library like
graphql-ws that handles reconnections automatically.Can I subscribe to multiple pairs at once?
Can I subscribe to multiple pairs at once?
Yes, you can open multiple subscriptions for different pairs over the same WebSocket connection. Each subscription operates independently and will receive updates for its specific pair.