ohlc

Returns DEX trades by token on Tron, where side currency smart contract is TNUC9Q…jWFR, currency smart contract is TJ9mxW…diAq and side amount is above 0, sorted by block time: block time, price in USD and sum of trade side amount.

By Akshat · saved 20 September 2024 · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($token: String, $base: String) {
  Tron {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}, Currency: {SmartContract: {is: $token}}}}
    ) {
      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

{
  "token": "TJ9mxWPmQSJswqMakEehFWcAntg73odiAq",
  "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"
}

Similar queries