total Buys and sells of multiple pools from a single query

Returns DEX trades by token, where side currency smart contract is 0xC02a…6Cc2, DEX smart contract is 0x58a9…99cb or 0xc4fc…6d23 and block time since 2024-08-02: count.

By Akshat · saved 2 August 2024 · run 8 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($poolAddresses: [String!]) {
  EVM {
    DEXTradeByTokens(
      where: {Trade: {Side: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}, Dex: {SmartContract: {in: $poolAddresses}}}, TransactionStatus: {Success: true}, Block: {Time: {since: "2024-08-02T13:20:00Z"}}}
    ) {
      totaltrades: count
      totalbuys: count(if: {Trade: {Side: {Type: {is: sell}}}})
      totalsells: count(if: {Trade: {Side: {Type: {is: buy}}}})
    }
  }
}

Variables

{"poolAddresses": ["0x58a99cf4982b9217460654272981ef7619a599cb","0xc4fc14ab3f9a0aebc5dc78b4fabc2eeb525d6d23"]}

Similar queries