sd

Returns DEX trades by token on Ethereum, where DEX smart contract is 0xc32C…1bE8 and currency smart contract is not 0xC02a…6Cc2: currency symbol, currency name, count and sum of trade side amount.

By Omkar_BQ · saved 17 December 2023 · run 9 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(dataset: combined, network: eth) {
    DEXTradeByTokens(
      limitBy: {by: Trade_Dex_Pair_SmartContract}
      where: {Trade: {Dex: {SmartContract: {is: "0xc32C2d9768919DEaEE60F7eB163A293c6eb81bE8"}}, Currency: {SmartContract: {not: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}
    ) {
      Trade {
        Currency {
          Symbol
          Name
        }
      }
      tb: count(distinct: Trade_Buyer)
      ts: count(distinct: Trade_Seller)
      txncount: count(distinct: Transaction_Hash)
      NoofSell: count(if: {Trade: {Side: {Type: {is: buy}}}})
      NoofBuy: count(if: {Trade: {Side: {Type: {is: sell}}}})
      Total_Weth: sum(
        of: Trade_Side_Amount
        if: {Trade: {Currency: {SmartContract: {not: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}
      )
    }
  }
}

Similar queries