dailytransactions of a pool

the daily transactions of a pool, including swaps...

Returns the latest DEX trades and balance updates on Ethereum, where pair smart contract is 0x0d4a…1852, balance update address is 0x0d4a…1852 and block time since 2024-07-19: smart contract, pair name, protocol family, protocol name, protocol version, buy currency name, buy smart contract and 11 more fields.

By yeyuantest · saved 22 July 2024 · Bitquery API v2

What it returns

Filters

The query

{
  EVM(dataset: combined, network: eth) {
    volume: DEXTrades(
      where: {Block: {Time: {since: "2024-07-19T10:01:55.000Z"}}, Trade: {Dex: {Pair: {SmartContract: {in: ["0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"]}}}}}
      orderBy: {ascending: Trade_Dex_Pair_SmartContract}
    ) {
      Trade {
        Dex {
          Pair {
            SmartContract
            Name
          }
          ProtocolFamily
          ProtocolName
          ProtocolVersion
          SmartContract
        }
        Buy {
          Currency {
            Name
            SmartContract
          }
        }
      }
      Block {
        Date
      }
      buytoken_vol: sum(of: Trade_Buy_Amount)
      selltoken_vol: sum(of: Trade_Sell_Amount)
      avgbuyprice: average(of: Trade_Buy_Price)
      avgsellprice: average(of: Trade_Sell_Price)
      avgbuypriceinusd: average(of: Trade_Buy_PriceInUSD)
      avgsellpriceinsud: average(of: Trade_Buy_PriceInUSD)
      numberofswap: count(selectWhere: {}, if: {Trade: {Success: true}})
      tradebuybuyer: count(distinct: Trade_Buy_Buyer)
      tradebuyseller: count(distinct: Trade_Buy_Seller)
      tradesellbuyer: count(distinct: Trade_Sell_Buyer)
      tradesellseller: count(distinct: Trade_Sell_Seller)
      avgfeeburnt: average(of: Fee_Burnt)
      avgfeeburntusd: average(of: Fee_BurntInUSD)
      
    }
    
    
    BalanceUpdates(
      where: {BalanceUpdate: {Address: {in: ["0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"]}}, Block: {Time: {since: "2024-07-19T08:32:47Z"}}}
      orderBy: {descending: Block_Date}
    ) {
      Currency {
        Name
      }
      balance: sum(of: BalanceUpdate_Amount)
      Block {
        Date
      }
      swaps: count
    }
  }
  
}

Similar queries