Dex Overview query

Returns DEX trades on Ethereum, where buy currency smart contract is 0x1f98…f984, sell currency smart contract is 0x1f98…f984 and block time since 2025-02-06: sum of trade buy amount in USD, sum of trade sell amount in USD and count.

By super · saved 7 February 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(dataset: realtime, network: eth) {
    all: DEXTrades(
      where: {Trade: {Buy: {Currency: {SmartContract: {is: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"}}}}, Block: {Time: {since: "2025-02-06T10:30:00Z"}}}
    ) {
      buy_vol: sum(of: Trade_Buy_AmountInUSD)
      sell_vol: sum(of: Trade_Sell_AmountInUSD)
      buy_count: count(if: {Trade: {Buy: {Currency: {SmartContract: {is: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"}}}}})
    }

    only_sellcount: DEXTrades(
      where: {Trade: {Sell: {Currency: {SmartContract: {is: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"}}}}, Block: {Time: {since: "2025-02-05T14:25:00Z"}}}
    ) {
  
      sell_count: count(if: {Trade: {Sell: {Currency: {SmartContract: {is: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"}}}}})
    }
  }
}

Similar queries