Trade metrics just like dexscreener

Returns one DEX trade on Ethereum, where pair smart contract is 0xc2ea…539d, block time since 2024-05-28 and block time till 2024-05-29: count, sum of trade buy amount in USD and sum of trade sell amount in USD.

By Akshat · saved 29 May 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(network: eth, dataset: combined) {
    DEXTrades(
      limit: {count: 1}
      where: {Block: {Time: {since: "2024-05-28T08:05:00Z", till: "2024-05-29T08:05:00Z"}}, TransactionStatus: {Success: true}, Trade: {Dex: {Pair: {SmartContract: {is: "0xc2eaB7d33d3cB97692eCB231A5D0e4A649Cb539d"}}}}}
    ) {
      Makers: count(distinct: Transaction_From)
      Trade_Buy_Seller: count(distinct: Trade_Buy_Seller)
      buys: count(
        if: {Trade: {Buy: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
      )
      buy_vol: sum(
        of: Trade_Buy_AmountInUSD
        if: {Trade: {Buy: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
      )
      sells: count(
        if: {Trade: {Sell: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
      )
      sell_vol: sum(
        of: Trade_Sell_AmountInUSD
        if: {Trade: {Sell: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
      )
    }
  }
}

Similar queries