Documentation Index
Fetch the complete documentation index at: https://docs.codex.io/llms.txt
Use this file to discover all available pages before exploring further.
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?
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?
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.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