bsc token pair metrics

Returns DEX trades on BNB Chain, where buy currency smart contract is 0xbb4c…095c, sell currency smart contract is 0x55d3…7955 and sell currency smart contract is 0xbb4c…095c: count, sum of trade buy amount and sum of trade sell amount.

By Aparna Sridhar · saved 29 February 2024 · run 6 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $token: String!, $token2: String!) {
  EVM(network: $network, dataset: combined) {
    Unique_Buyers: DEXTrades(
      where: {Block: {Time: {since: "2024-02-15T01:00:00Z", till: "2024-02-22T02:00:00Z"}}, Trade: {Buy: {Currency: {SmartContract: {is: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      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: $token}}}, Buy:{Currency:{SmartContract:{is: $token2}}}}}
    ) {
      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: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      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: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      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: $token}}}, Sell: {Currency: {SmartContract: {is: $token2}}}}}
    ) {
      sum(of:Trade_Sell_Amount)
    }
  }
}

Variables

{
  "network":"bsc","token":"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "token2":"0x55d398326f99059ff775485246999027b3197955"
}

Similar queries