Filter Pairs

Returns a list of pairs based on a variety of filters.

Endpoint: filterPairs

Method: POST

Arguments

NameTypeDescription
filtersPairFilters

A set of filters to apply.

limitInt

The maximum number of pairs to return.

matchTokensPairFilterMatchTokens

A set of token contract addresses that make up a pair. Can be used in place of a pair contract address.

offsetInt

Where in the list the server should start when returning items. Use count+offset from the previous query to request the next page of results.

pairs[String]

A list of pair or token contract addresses or IDs (address:networkId) to filter by.

phraseString

A phrase to search for. Can match a token or pair contract address or ID (address:networkId), or partially match a token name or symbol.

rankings[PairRanking]

A list of ranking attributes to apply.

statsTypeTokenPairStatisticsType

The type of statistics returned. Can be FILTERED or UNFILTERED

Response

NameTypeDescription
countIntThe number of pairs returned.
offsetIntWhere in the list the server started when returning items.
results[PairFilterResult]The list of pairs matching the filter parameters.

NameTypeDescription
buyCount1IntThe number of buys in the past hour.
buyCount4IntThe number of buys in the past 4 hours.
buyCount12IntThe number of buys in the past 12 hours.
buyCount24IntThe number of buys in the past 24 hours.
createdAtIntThe unix timestamp for the creation of the pair.
exchangeFilterExchangeExchange metadata for the pair.
highPrice1StringThe highest price in USD in the past hour.
highPrice4StringThe highest price in USD in the past 4 hours.
highPrice12StringThe highest price in USD in the past 12 hours.
highPrice24StringThe highest price in USD in the past 24 hours.
lastTransactionIntThe unix timestamp for the last transaction to happen on the pair.
liquidityStringAmount of liquidity in the pair.
liquidityTokenStringThe token with higher liquidity in the pair. Can be token0 or token1.
lowPrice1StringThe lowest price in USD in the past hour.
lowPrice4StringThe lowest price in USD in the past 4 hours.
lowPrice12StringThe lowest price in USD in the past 12 hours.
lowPrice24StringThe lowest price in USD in the past 24 hours.
marketCapStringThe fully diluted market cap.
pairPairMetadata for the pair.
priceStringThe token price in USD.
priceChange1StringThe percent price change in the past hour. Decimal format.
priceChange4StringThe percent price change in the past 4 hours. Decimal format.
priceChange12StringThe percent price change in the past 12 hours. Decimal format.
priceChange24StringThe percent price change in the past 24 hours. Decimal format.
priceScaleString10^n, where n is the number of decimal places the price has. Max 16. Used for TradingView settings.
quoteTokenStringThe token of interest. Can be token0 or token1.
sellCount1IntThe number of sells in the past hour.
sellCount4IntThe number of sells in the past 4 hours.
sellCount12IntThe number of sells in the past 12 hours.
sellCount24IntThe number of sells in the past 24 hours.
token0EnhancedTokenMetadata for the first token in the pair.
token1EnhancedTokenMetadata for the second token in the pair.
txnCount1IntThe number of transactions in the past hour.
txnCount4IntThe number of transactions in the past 4 hours.
txnCount12IntThe number of transactions in the past 12 hours.
txnCount24IntThe number of transactions in the past 24 hours.
uniqueBuys1IntThe unique number of buys in the past hour.
uniqueBuys4IntThe unique number of buys in the past 4 hours.
uniqueBuys12IntThe unique number of buys in the past 12 hours.
uniqueBuys24IntThe unique number of buys in the past 24 hours.
uniqueSells1IntThe unique number of sells in the past hour.
uniqueSells4IntThe unique number of sells in the past 4 hours.
uniqueSells12IntThe unique number of sells in the past 12 hours.
uniqueSells24IntThe unique number of sells in the past 24 hours.
uniqueTransactions1IntThe unique number of transactions in the past hour.
uniqueTransactions4IntThe unique number of transactions in the past 4 hours.
uniqueTransactions12IntThe unique number of transactions in the past 12 hours.
uniqueTransactions24IntThe unique number of transactions in the past 24 hours.
volumeUSD1StringThe trade volume in USD in the past hour.
volumeUSD4StringThe trade volume in USD in the past 4 hours.
volumeUSD12StringThe trade volume in USD in the past 12 hours.
volumeUSD24StringThe trade volume in USD in the past 24 hours.

Example

Filter for Most Recently Listed Pairs

Use this query to filter pairs by createdAt

query {
  filterPairs(rankings: {attribute: createdAt, direction: DESC}) {
    results {
    	createdAt
      pair {
      	address
      }
      token0  {
        name
      }
      token1 {
        name
      }
    }
  }  
}

Explore

πŸ‘‹

Join our Discord

Ask questions, share what you're working on and request new features :two-men-holding-hands::two-women-holding-hands: