Returns
Arguments
DESC (default) or ASC.
See RankingDirectionExample
Test this query in the Explorer →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.timestamp.fromandtoare compared to a sub-second event time, but the returnedtimestampis rounded to the second, so events in the same second as a bound can be left out. Pad both bounds by 1 to 2 seconds and dedupe ontransactionHash+logIndex. - 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 - Response limit: 200 events per request (default 10).
- Each event can include a
tradeSourceidentifying the app the trade was placed through (swaps on Solana and EVM networks; null for most events, since most trades carry no identifying signal) — see Trade source
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?
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 do Buy and Sell look reversed for my token?
Why do Buy and Sell look reversed for my token?
eventDisplayType, amountNonLiquidityToken, and the price fields all describe the quoteToken side of the pair (token0 or token1). Buy means that token left the pool to the trader. The same swap reads Sell from the other side.Passing a token address picks that token’s top pair, but it does not set quoteToken to your token. The pair’s default side is used instead. For example, passing USDC on Ethereum returns its top USDC/WETH pair from WETH’s side, so USDC sells show as Buy.To be sure, pass quoteToken: token0 or quoteToken: token1 explicitly, and check the pair’s token0 and token1 addresses (from pairMetadata or filterPairs) to pick the right one. Every event also returns the quoteToken that was used.Why am I getting Mint/Burn events when I only want swaps?
Why am I getting Mint/Burn events when I only want swaps?
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?
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.What are token0SwapValueUsd and token1SwapValueUsd?
What are token0SwapValueUsd and token1SwapValueUsd?
token0 and token1 at the time of the swap, not the USD value of each side of the trade. On a USDC/WETH swap, token0SwapValueUsd reads about 1 and token1SwapValueUsd reads the price of one WETH, whatever the trade size. For the trade’s size in USD, use priceUsdTotal.What are priceBaseToken and priceBaseTokenTotal?
What are priceBaseToken and priceBaseTokenTotal?
priceBaseToken: the price perquoteTokenat the time of the swap, in the network’s base token.priceBaseTokenTotal: the total size of the swap in the network’s base token (amountNonLiquidityTokenxpriceBaseToken).
gt/gte/lt/lte) and as response fields on SwapEventData. Use the base-token variants when you want values that are stable relative to the chain’s native asset (e.g. “swaps over 10 SOL”); use priceUsd/priceUsdTotal when you want dollar terms.The base token is always the network’s native token, not the pair’s quote token. A Pump.fun token can trade against a quote token other than SOL, but priceBaseToken is still in SOL. Don’t multiply it by the quote token’s USD price; use priceUsd, or marketCap from the token, instead.How can I identify sandwich attacks or wash trades?
How can I identify sandwich attacks or wash trades?
labels field on events. It contains sandwich labels (with types sandwiched, frontrun, backrun) and washtrade labels when detected.I'm missing transaction data for a specific block — how can I find it?
I'm missing transaction data for a specific block — how can I find it?
getTokenEvents looks at the top pair when filtering for events, not all pairs. If the missing transactions occurred on a different pair, use listPairsWithMetadataForToken to find the correct pool (filter by volume) and pass that pair address to getTokenEvents.Related Recipes
- Detailed Token Page: Build a comprehensive token detail page with price, holders, trades, and real-time updates
- Events: Build a token swap list with filtering, pagination, and real-time updates