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

PairMetadata
PairMetadata!
See PairMetadata

Arguments

pairId
String!
required
The ID of the pair (address:networkId).
quoteToken
QuoteToken
The token of interest within the pair. Can be token0 or token1. See QuoteToken
statsType
TokenPairStatisticsType
The type of statistics returned. Can be FILTERED or UNFILTERED. Default is UNFILTERED. See TokenPairStatisticsType

Example

Test this query in the Explorer →
{
  pairMetadata(
    pairId: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1"
  ) {
    id
    pairAddress
    networkId
    exchangeId
    fee
    liquidity
    liquidityToken
    nonLiquidityToken
    statsType
    price
    priceNonQuoteToken
    priceChange5m
    priceChange1
    priceChange4
    priceChange12
    priceChange24
    volume5m
    volume1
    volume4
    volume12
    volume24
    highPrice24
    lowPrice24
    token0 {
      address
      name
      symbol
      networkId
      decimals
      price
      pooled
    }
    token1 {
      address
      name
      symbol
      networkId
      decimals
      price
      pooled
    }
  }
}

Usage Guidelines

  • Query using the pair ID in format pairAddress:networkId (e.g., 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1)
  • Use quoteToken parameter (token0 or token1) to specify which token’s perspective to use for price data
  • Use useNonLiquidityTokenAsQuoteToken: true to automatically select the non-liquidity token as the quote token
  • Price change fields (priceChange5m, priceChange1, etc.) are in decimal format (0.01 = 1%)
  • Volume fields represent USD value traded in the specified time window
  • Use statsType to see if stats are FILTERED (bot-filtered) or UNFILTERED
  • Use enhancedToken0 and enhancedToken1 for additional token metadata like social links, images, and launchpad data

Troubleshooting Tips

Use the filterPairs or listPairsForToken query to find the pair address and network ID for your token. The pair ID format is pairAddress:networkId.
Token ordering is determined by the pair contract. Use the quoteToken parameter to specify which token you want as the base for price calculations, or use useNonLiquidityTokenAsQuoteToken: true to automatically select the non-stable/non-major token.
pairMetadata is a one-time query that returns current data. onPairMetadataUpdated is a WebSocket subscription that streams real-time updates as trades occur. Use the query for initial data and the subscription for live updates.
Price change and volume fields may be null for very new pairs that don’t have enough historical data for the specified time window (e.g., priceChange24 requires 24 hours of data).
Use the enhancedToken0 and enhancedToken1 fields to access additional token information like social links, images, creator address, and launchpad data. These fields provide more comprehensive token details than the basic token0 and token1 fields.
Codex does not have a separate isVerified field. Instead, use isScam: false as the equivalent of a token being “verified.” Access it via enhancedToken0 { isScam } or enhancedToken1 { isScam } on the pairMetadata query, or through the token / tokens queries directly.
  • Detailed Token Page: Build a comprehensive token detail page with price, holders, trades, and real-time updates