Returns
Arguments
EventsQueryInput!
required
The query filters to apply to the results.
The order to receive the token events. Can be
DESC (default) or ASC.Usage Guidelines
- Pass a token address or pair address to the
addressfield; if you pass a token address, it will automatically find the top pair for that token - Use
eventDisplayTypefilter to get onlyBuyorSellevents (splits swaps into directional trades) - Use
eventType: Swapto filter for only swap transactions, excluding liquidity events - Use
makerfilter to get transactions for a specific wallet address - Use
timestampfilter withfromandtofor historical event lookups - Use
priceUsdTotalfilter to find large trades (e.g.,priceUsdTotal: {gte: 10000}) - Results are ordered by most recent first by default; use
direction: ASCfor oldest first
Troubleshooting Tips
How do I determine if a swap was a buy or sell?
How do I determine if a swap was a buy or sell?
Use
eventDisplayType instead of eventType. While eventType returns Swap for all swaps, eventDisplayType splits them into Buy or Sell based on the direction of the trade relative to the quote token.Why am I getting Mint/Burn events when I only want swaps?
Why am I getting Mint/Burn events when I only want swaps?
Add
eventType: Swap to your query filters to exclude liquidity add/remove events. Alternatively, use eventDisplayType: [Buy, Sell] to get only buy and sell events.How do I get events for a specific time range?
How do I get events for a specific time range?
Use the
timestamp filter with from and to unix timestamps. For example: timestamp: {from: 1704067200, to: 1704153600} for a 24-hour window.What's the difference between priceUsd and priceUsdTotal?
What's the difference between priceUsd and priceUsdTotal?
priceUsd is the price per token at the time of the swap. priceUsdTotal is the total USD value of the swap (amountNonLiquidityToken x priceUsd). Use priceUsdTotal for filtering by trade size.How can I identify sandwich attacks or wash trades?
How can I identify sandwich attacks or wash trades?
Check the
labels field on events. It contains sandwich labels (with types sandwiched, frontrun, backrun) and washtrade labels when detected.