24 hour volume

Returns DEX trades on Ethereum, where buy currency smart contract is 0xc02a…6cc2, sell currency smart contract is 0x2056…36e1 and block time since 2023-09-27: sum of trade buy amount and sum of trade sell amount.

By Nitin Jakhar · saved 13 December 2023 · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $token: String!, $token2: String!) {
  EVM(network: $network, dataset: combined) {
    
    Total_Buy_Amount: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T00:00:01Z", till: "2023-09-27T23:59:59Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      sum(of:Trade_Buy_Amount)
    }
    Total_Sell_Amount: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T00:00:01Z", till: "2023-09-27T23:59:59Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      sum(of:Trade_Sell_Amount)
    }
  }
}

Variables

{
  "network":"eth","token":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "token2":"0x20561172f791f915323241e885b4f7d5187c36e1"
}

Similar queries