ohlc for a token pair on bsc

Returns DEX trades by token on BNB Chain, where side currency smart contract is 0x55d3…7955, currency smart contract is 0x711b…f308 and side amount is above 0, sorted by block time: block time, price in USD and sum of trade side amount.

By Akshat · saved 5 December 2024 · run 6 times · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($network: evm_network, $token: String, $base: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}, Currency: {SmartContract: {is: $token}}, PriceAsymmetry: {lt: 0.1}}}
    ) {
      Block {
        Time(interval: {count: 5, in: minutes})
      }
      Trade {
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
        max: PriceInUSD(maximum: Trade_PriceInUSD)
        min: PriceInUSD(minimum: Trade_PriceInUSD)
      }
      volume: sum(of: Trade_Side_Amount)
    }
  }
}

Variables

{
  "network": "bsc",
  "token": "0x711bfe972465a1e9182766ad67aff3c80a0cf308",
  "base": "0x55d398326f99059ff775485246999027b3197955"
}

Similar queries