Subscriptions (WebSockets) require a Growth or Enterprise plan. Learn more.
This endpoint requires a Enterprise plan. Learn more.
Returns
AddTokenEventsOutput!
required
Arguments
OnTokenEventsCreatedInput!
required
Example Response
Usage Guidelines
- Pass
tokenAddressandnetworkIdto stream events for a token across all its liquidity pools - Unlike
onEventsCreated(which subscribes to a single pair), this aggregates swaps from every pool the token trades in - Each event includes
address— the pair contract where the swap occurred — so you can identify which pool it came from - The
eventsarray may contain multiple events per message - Use
eventDisplayTypefor human-readable buy/sell labels andtoken0SwapValueUsd/token1SwapValueUsdfor USD values
Troubleshooting Tips
When should I use onTokenEventsCreated vs onEventsCreated?
When should I use onTokenEventsCreated vs onEventsCreated?
Use
onTokenEventsCreated when you want to monitor all trading activity for a token regardless of which pool it happens in. Use onEventsCreated when you only care about a specific pair (e.g., SOL/USDC on a particular DEX).How do I tell which pool an event came from?
How do I tell which pool an event came from?
Each event includes an
address field — this is the pair contract address where the swap occurred. You can use this to group or filter events by pool.Can I stream events for all tokens on a network?
Can I stream events for all tokens on a network?
Yes. Omit
tokenAddress and pass only networkId to receive all events across the entire network. This requires an enterprise plan with EventFeed features and is extremely high-volume.What event types are included?
What event types are included?
Events include
Swap, Mint, and Burn types. eventDisplayType translates these into user-friendly labels like Buy, Sell, Add Liquidity, and Remove Liquidity.