price and pair of a token evm

Returns the latest DEX trades by token on Ethereum, where currency smart contract is 0xc02a…6cc2: price in USD, pair name, smart contract and pair symbol.

By Kshitij Mahajan · saved 24 February 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($network: evm_network = eth, $is: String = "") {
  EVM(network: $network) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {is: $is}}}}
      orderBy: {descending: Block_Time}
      limitBy: {by: Trade_Dex_Pair_SmartContract, count: 1}
    ) {
      Trade {
        PriceInUSD
        Dex {
          Pair {
            Name
            SmartContract
            Symbol
          }
        }
      }
    }
  }
}

Variables

{
  "network": "eth",
  "is": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}

Similar queries