Trade Metrics for a Token Pair

Returns DEX trades on Arbitrum, where buy currency smart contract is 0x912c…6548, sell currency smart contract is 0xfd08…cbb9 and sell currency smart contract is 0x912c…6548: count, sum of trade buy amount and sum of trade sell amount.

By Maroti Patre · saved 19 February 2024 · run 5 times · Bitquery API v2

What it returns

Filters

The query

query {
  EVM(network:arbitrum, dataset: combined) {
    Unique_Buyers: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T01:00:00Z", till: "2023-09-27T02:00:00Z"}}, Trade: {Buy: {Currency: {SmartContract: {is:"0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Sell: {Currency: {SmartContract: {is: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"}}}}}
    ) {
      count(distinct: Trade_Buy_Buyer)
    }
    Unique_Sellers: DEXTrades(
      where: {Block: {Time: {since: "2023-08-26T01:00:00Z", till: "2023-08-26T02:00:00Z"}}, Trade: {Sell: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Buy:{Currency:{SmartContract:{is: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"}}}}}
    ) {
      count(distinct: Trade_Sell_Seller)
    }
    Total_Transactions: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T01:00:00Z", till: "2023-09-27T02:00:00Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Sell: {Currency: {SmartContract: {is:"0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"}}}}}
    ) {
      count(distinct: Transaction_Hash)
    }
    Total_Buy_Amount: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T01:00:00Z", till: "2023-09-27T02:00:00Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Sell: {Currency: {SmartContract: {is:"0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"}}}}}
    ) {
      sum(of:Trade_Buy_Amount)
    }
    Total_Sell_Amount: DEXTrades(
      where: {Block: {Time: {since: "2023-09-27T01:00:00Z", till: "2023-09-27T02:00:00Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Sell: {Currency: {SmartContract: {is: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"}}}}}
    ) {
      sum(of:Trade_Sell_Amount)
    }
  }
}

Similar queries