volume with intervals tron

Returns DEX trades by token on Tron, where currency smart contract is TR7NHq…Lj6t, block time since 2024-12-14 and block time till 2024-12-14, sorted by block OHLC interval: block time, sum of trade amount in USD, price in USD and count.

By kirill · saved 17 December 2024 · run 5 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $from_date_time: DateTime, $to_date_time: DateTime) {
  Tron(dataset: archive) {
    aggregatedVolume: DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {is: $token}}, PriceAsymmetry: {le: 0.2}, PriceInUSD: {ne: 0}}, Block: {Time: {since: $from_date_time, till: $to_date_time}}}
      orderBy: {ascendingByField: "Block_OHLC_interval"}
    ) {
      Block {
        OHLC_interval: Time(interval: {in: minutes, count: 10})
      }
      volume: sum(of: Trade_AmountInUSD)
      Trade {
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
      }
      count
    }
  }
}

Variables

{
  "token": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "from_date_time": "2024-12-14T12:42:35Z", "to_date_time": "2024-12-14T14:42:35Z"
}

Similar queries