Multiple Tickers per market (wout)

Returns DEX trades by token on Base, where pair smart contract is 0x8b7c…2363, DEX protocol name is uniswap_v2 and transaction time after 2023-07-18, sorted by block time: block time, block number, sum of trade amount, sum of trade side amount, trade price, pair name, smart contract and 7 more fields.

By Coinranking · saved 3 June 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query fetchBulkTickers(
  $network: evm_network!,
  $protocol: String!,
  $twentyFourHoursAgo: DateTime,
  $smartContracts: [String!]!
) {
  EVM(
    dataset: realtime,
    network: $network
  ) {
    DEXTradeByTokens(
      orderBy: { ascendingByField: "Block_Time" }
      where: {
        Trade: {
          Dex: {
            Pair: {
              SmartContract: {
                in: $smartContracts
              }
            }
            ProtocolName: { is: $protocol }
          }
        }
        Transaction: { Time: { after: $twentyFourHoursAgo } }
      }
    ) {
      Block {
        Time(interval: { in: hours, count: 24 })
        lastTradeTime: Time(maximum: Block_Time)
        FirstTradeTime: Time(minimum: Block_Time)
        LastTradeBlock: Number(maximum: Block_Number)
        FirstTradeBlock: Number(minimum: Block_Number)
      }
      movingBaseVolume: sum(
        of: Trade_Amount
        if: { Block: { Time: { after: $twentyFourHoursAgo } } }
      )
      movingQuoteVolume: sum(
        of: Trade_Side_Amount
        if: { Block: { Time: { after: $twentyFourHoursAgo } } }
      )
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Number)
        close: Price(maximum: Block_Number)
        Dex {
          Pair {
            Name
            SmartContract
          }
          ProtocolName
        }
        Base: Currency {
          Name
          Symbol
          SmartContract
        }
        Quote: Side {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
      }
      count
    }
  }
}

Variables

{
  "twentyFourHoursAgo": "2023-07-18T08:54:31.046Z",
  "minimumVolumeInUsd": 10000,
  "network": "base",
  "protocol": "uniswap_v2",
  "smartContracts": [
    "0x8b7cc11ff640a494e5a31a82415bb0d831e62363"
  ]
}

Similar queries