Skip to main content

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.

Returns

Arguments

Usage Guidelines

  • Query using pairAddress and networkId (not the combined pair ID format)
  • Use tokenOfInterest (token0 or token1) to specify which token’s perspective to use for buy/sell calculations
  • Use durations array to request specific time windows: min5, min15, hour1, hour4, hour12, day1, week1, day30
  • Stats are returned in separate fields like stats_hour1, stats_day1, etc. based on requested durations
  • statsUsd contains USD-denominated metrics (volume, buyVolume, sellVolume)
  • statsNonCurrency contains count metrics (transactions, buyers, sellers, buys, sells)
  • Each metric includes currentValue, previousValue, and change (percent change in decimal format)
  • Use buckets array within each metric for granular time-series data

Troubleshooting Tips

tokenOfInterest determines the perspective for buy/sell classification. If set to token1, a “buy” means buying token1 (selling token0), and vice versa. This affects buyVolume, sellVolume, buyers, and sellers metrics.
FILTERED stats exclude suspected bot/MEV activity to show organic trading. UNFILTERED includes all transactions. Use statsType in the response to see which type was returned.
Each metric includes a buckets array with values for sub-intervals within the duration. For example, stats_hour1 might have 12 buckets of 5 minutes each. Use the timestamps array to map bucket indices to time ranges.
The change field requires both currentValue and previousValue to calculate. For very new pairs or time windows with no previous data, change may be null.
Use the timestamp parameter to query stats as of a specific point in time. By default, stats are returned for the current time.
getDetailedPairStats is the most accurate source of historical pool stats — pass the pairAddress, networkId, and the durations you need (min5, hour1, day1, etc.). getBars is also useful for OHLCV-style time series. Note that getTokenPrices returns a weighted price across all of a token’s pools — individual pool prices can differ.
  • Discover Tokens: Build token discovery pages with trending data, filters, and search