EVM test query

Returns the latest DEX trades by token, where DEX smart contract is FwpEDH…T4uD and side amount is above 0: block time, sum of trade side amount in USD, price in USD, trade price and count.

By Tomas Krason · saved 14 February 2025 · Bitquery API v1

What it returns

Filters

The query

query EVMTokenPrice(
  $network: evm_network!,
  $currencyAddress: String!,
  $pairAddress: String!
  $timeInterval: OLAP_DateTimeIntervalUnits!
  $intervalCount: Int!
  $limit: Int!
  $after: DateTime
  $before: DateTime
) {
  EVM(network: $network, dataset: combined) {
    DEXTradeByTokens(
      orderBy: { descendingByField: "Block_timestamp" }
      where: {
        Trade: {
          Side: {
            Amount: { gt: "0" },
            Currency: {
              SmartContract: {
                is: $currencyAddress
              }
            }
          }
          Dex: { SmartContract: { is: $pairAddress } }
        }
        Block: { Time: { after: $after, before: $before } }
      }
      limit: { count: $limit }
    ) {
      Block {
        timestamp: Time(interval: { in: $timeInterval, count: $intervalCount })
      }
      volume: sum(of: Trade_Side_AmountInUSD)
      Trade {
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
        closeEth: Price(maximum: Block_Number)
      }
      count
    }
  }
}

Variables

{
  "pairAddress": "FwpEDH5siu9aWFwW3ZVDLvBcyPbn1stiPHpfFmo5T4uD"
}

Similar queries