OHLC

Returns DEX trades by token on Tron, where currency smart contract is TMaQT6…c6Ti and trade amount is above 0, sorted by block time: block time, buyer, seller, smart contract, protocol name, protocol family, currency symbol and 8 more fields.

By Akshat · saved 20 September 2024 · Bitquery API v2

What it returns

Filters

The query

query TokenOHLC($token: String) {
  Tron {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Transaction: {Result: {Success: true}}}
    ) {
      Block {
        Time(interval: {count: 5, in: minutes})
        allTime: Time
      }
      Trade {
        Buyer
        Seller
        Dex {
          SmartContract
          ProtocolName
          ProtocolFamily
        }
        Currency {
          Symbol
          Name
          SmartContract
        }
        Price
        Amount
        Side {
          AmountInUSD
          Amount
        }
        open: Price(minimum: Block_Number)
        close: Price(maximum: Block_Number)
        min: Price(maximum: Trade_Price)
        max: Price(minimum: Trade_Price)
        closeUsd: PriceInUSD(maximum: Trade_PriceInUSD)
      }
      volume: sum(of: Trade_Side_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "token": "TMaQT6QWTaTxuorH7Aa898Gmt7ibJKc6Ti"
}

Similar queries