BSC OHLC API

Returns DEX trades by token on BNB Chain, where side currency smart contract is 0x55d3…7955, currency smart contract is 0xbb4c…095c and block time since 2025-10-12, sorted by block time: block time, quantile of trade price in USD, average of trade price in USD and sum of trade side amount in USD.

By Divyasshree · saved 15 October 2025 · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($network: evm_network, $dataset: dataset_arg_enum, $interval: Int, $token: String, $base: String, $from: DateTime, $to: DateTime) {
  EVM(network: $network, dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {TransactionStatus: {Success: true}, Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Currency: {SmartContract: {is: $base}}, Success: true}, Block: {Time: {since: $from, till: $to}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: seconds})
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.1)
      max: quantile(of: Trade_PriceInUSD, level: 0.9)
      close: average(of: Trade_PriceInUSD)
      open: average(of: Trade_PriceInUSD)
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "network": "bsc",
  "base": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "token": "0x55d398326f99059ff775485246999027b3197955",
  "time_ago": "2025-10-12T05:50:36Z",
  "dataset": "realtime",
  "local": "EVM",
  "interval": 60,
  "from": "2025-10-12T05:51:53Z",
  "to": "2025-10-15T05:51:53Z"
}

Similar queries