> ## 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.

# pairMetadata

> Returns metadata for a pair of tokens.

<div data-generated>
  ## GraphQL

  ```
  type Query {
    pairMetadata(
      pairId: String!
      quoteToken: QuoteToken
      statsType: TokenPairStatisticsType
    ): PairMetadata!
  }

  enum QuoteToken {
    token0
    token1
  }

  enum TokenPairStatisticsType {
    FILTERED
    UNFILTERED
  }

  enum ContractLabelSubType {
    Generic
    HighTax
    HoneyPot
    Imitator
  }

  enum ContractLabelType {
    Scam
    Verified
  }

  type ContractLabel {
    createdAt: Int!
    subType: ContractLabelSubType!
    type: ContractLabelType!
  }

  type PairMetadataToken {
    address: String!
    decimals: Int
    name: String!
    networkId: Int!
    pooled: String!
    price: String!
    symbol: String!
    labels: [ContractLabel]
  }

  type SocialLinks {
    bitcointalk: String
    blog: String
    coingecko: String
    coinmarketcap: String
    discord: String
    email: String
    facebook: String
    github: String
    instagram: String
    linkedin: String
    reddit: String
    slack: String
    telegram: String
    twitch: String
    twitter: String
    website: String
    wechat: String
    whitepaper: String
    youtube: String
  }

  type TokenInfo {
    id: String!
    address: String!
    circulatingSupply: String
    cmcId: Int
    gridAssetId: String
    bluechipRating: String
    isScam: Boolean
    name: String
    networkId: Int!
    symbol: String!
    totalSupply: String
    imageThumbHash: String
    imageThumbUrl: String
    imageSmallUrl: String
    imageLargeUrl: String
    imageBannerUrl: String
    videoExternalUrl: String
    description: String
  }

  type OrganizationUrl {
    url: String!
    type: String
  }

  type OrganizationSocial {
    url: String!
    type: String
  }

  type AssetDeployment {
    id: String!
    networkId: Int!
    address: String!
    standard: String
    assetId: String!
    rootId: String!
    token: EnhancedToken
  }

  type Asset {
    id: String!
    name: String
    description: String
    ticker: String
    type: String
    status: String
    icon: String
    rootId: String!
    assetDeployments: [AssetDeployment!]!
  }

  type Organization {
    name: String!
    foundingDate: String
    descriptionShort: String
    descriptionLong: String
    tagLine: String
    type: String
    sector: String
    urls: [OrganizationUrl!]!
    socials: [OrganizationSocial!]!
    logo: String
    icon: String
    header: String
    rootId: String!
    assets: [Asset!]!
  }

  type ExplorerTokenData {
    id: String!
    blueCheckmark: Boolean
    description: String
    divisor: String
    tokenPriceUSD: String
    tokenType: String
  }

  type Exchange {
    id: String!
    address: String!
    color: String
    name: String
    exchangeVersion: String
    iconUrl: String
    networkId: Int!
    tradeUrl: String
  }

  enum WalletCategory {
    NORMIE
    TOKEN_CREATOR
    EXCHANGE
    DEFI_EXCHANGE
    PAIR
    PAIR_TOKEN_HOLDER
    POOL_AUTHORITY
    STAKING_VAULT
    NOTORIOUS
  }

  type WalletFunding {
    fundedByAddress: String!
    fundedByLabel: String
    fundedAt: Int!
    tokenAddress: String!
    networkId: Int!
    amount: String!
    transactionHash: String!
  }

  type WalletPolymarketProfile {
    proxyWallet: String!
    xUsername: String
    displayName: String
    pseudonym: String
    profileImageUrl: String
    verifiedBadge: Boolean
    displayUsernamePublic: Boolean
    fetchedAt: Int!
  }

  type Wallet {
    address: String!
    category: WalletCategory
    firstSeenTimestamp: Int
    firstFunding: WalletFunding
    identityLabels: [String!]
    avatarUrl: String
    displayName: String
    twitterId: String
    twitterUsername: String
    telegramId: String
    telegramUsername: String
    website: String
    discordId: String
    discordUsername: String
    githubId: String
    githubUsername: String
    farcasterId: String
    farcasterUsername: String
    description: String
    ethosScore: Int
    ethosLevel: String
    ethosVerified: Boolean
    identitySource: String
    identityUpdatedAt: Int
    polymarket: WalletPolymarketProfile
    tokensCreatedCount: Int
    tokensMigratedCount: Int
  }

  type LaunchpadData {
    launchpadName: String
    graduationPercent: Float
    poolAddress: String
    completedAt: Int
    completed: Boolean
    completedSlot: Int
    migratedSlot: Int
    migratedAt: Int
    migrated: Boolean
    migratedPoolAddress: String
    launchpadProtocol: String
    launchpadIconUrl: String
    isCashbackEnabled: Boolean
    category: String
  }

  type TokenExtrema {
    id: String!
    address: String!
    networkId: Int!
    athPrice: String!
    athPriceTimestamp: Int!
    atlPrice: String!
    atlPriceTimestamp: Int!
    athFdv: String!
    athFdvTimestamp: Int!
    atlFdv: String!
    atlFdvTimestamp: Int!
    athCircMc: String!
    athCircMcTimestamp: Int!
    atlCircMc: String!
    atlCircMcTimestamp: Int!
  }

  type CoinCommunity {
    id: String!
    createdAt: Int!
    postCount: Int!
    memberCount: Int!
    likeCount: Int!
    lastPostAt: Int
  }

  type Token2022ScaledUiAmountConfig {
    authority: String
    multiplier: Float!
    newMultiplierEffectiveTimestamp: String
    newMultiplier: Float
  }

  type Token2022Extensions {
    scaledUiAmountConfig: Token2022ScaledUiAmountConfig
  }

  type B20Extensions {
    multiplier: String
    multiplierObservedAt: String
    pausedTransfer: Boolean
    pausedMint: Boolean
    pausedBurn: Boolean
    supplyCap: String
  }

  type TokenExtensions {
    token2022: Token2022Extensions
    b20: B20Extensions
  }

  type Erc7572CustomInfo {
    type: String!
    featuredImage: String
    collaborators: [String!]
  }

  enum CategoryType {
    CANONICAL
    NARRATIVE
  }

  enum CategoryStatus {
    DRAFT
    ACTIVE
    ARCHIVED
  }

  type Category {
    id: String!
    name: String!
    shortName: String
    slug: String!
    description: String
    type: CategoryType!
    status: CategoryStatus!
    parentId: String
    memberCount: Int
  }

  type EnhancedToken {
    id: String!
    address: String!
    cmcId: Int
    decimals: Int!
    isScam: Boolean
    name: String
    networkId: Int!
    symbol: String
    socialLinks: SocialLinks
    info: TokenInfo
    gridAssetId: String
    bluechipRating: String
    organization: Organization
    asset: Asset
    exchanges: [Exchange!]
    creatorAddress: String
    creator: Wallet
    createBlockNumber: Int
    createTransactionHash: String
    createdAt: Int
    mintable: String
    freezable: String
    isFreezableValid: Boolean
    isMintableValid: Boolean
    launchpad: LaunchpadData
    top10HoldersPercent: Float
    profanity: Boolean
    extrema: TokenExtrema
    coinCommunity: CoinCommunity
    extensions: TokenExtensions
    tokenStandardCustomData: Erc7572CustomInfo
    categories: [Category!]
  }

  type TokenWalletActivity {
    bundlerCount: Int!
    bundlerHeldPercentage: Float!
    devHeldPercentage: Float!
    insiderCount: Int!
    insiderHeldPercentage: Float!
    sniperCount: Int!
    sniperHeldPercentage: Float!
    suspiciousCount: Int!
    suspiciousHeldPercentage: Float!
  }

  type PairMetadata {
    exchangeId: String
    fee: Int
    id: String!
    quoteToken: QuoteToken
    networkId: Int
    liquidity: String!
    liquidityToken: String
    nonLiquidityToken: String
    pairAddress: String!
    statsType: TokenPairStatisticsType!
    price: String!
    priceNonQuoteToken: String!
    priceChange5m: Float
    priceChange1: Float
    priceChange4: Float
    priceChange12: Float
    priceChange24: Float
    tickSpacing: Int
    token0: PairMetadataToken!
    token1: PairMetadataToken!
    volume1: String
    volume4: String
    volume12: String
    volume24: String
    volume5m: String
    highPrice5m: String
    highPrice1: String
    highPrice4: String
    highPrice12: String
    highPrice24: String
    lowPrice5m: String
    lowPrice1: String
    lowPrice12: String
    lowPrice24: String
    lowPrice4: String
    enhancedToken0: EnhancedToken
    enhancedToken1: EnhancedToken
    walletActivity: TokenWalletActivity
    createdAt: Int
    top10HoldersPercent: Float
  }
  ```
</div>

### Example

<a href="/explore" target="_blank" rel="noopener noreferrer">Test this query in the Explorer →</a>

```graphql theme={null}
{
  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

<AccordionGroup>
  <Accordion title="How do I get the pair ID for a token?">
    Use the `filterPairs` or `listPairsForToken` query to find the pair address and network ID for your token. The pair ID format is `pairAddress:networkId`.
  </Accordion>

  <Accordion title="What's the difference between token0 and token1?">
    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.
  </Accordion>

  <Accordion title="What's the difference between pairMetadata and onPairMetadataUpdated?">
    `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.
  </Accordion>

  <Accordion title="Why are some price/volume fields null?">
    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).
  </Accordion>

  <Accordion title="How do I get enhanced token metadata?">
    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.
  </Accordion>

  <Accordion title="How do I check if a token in a pair is verified?">
    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.
  </Accordion>
</AccordionGroup>

### Related Recipes

* [Detailed Token Page](/recipes/detailed-token-page): Build a comprehensive token detail page with price, holders, trades, and real-time updates
