OHLC Prices Api V2

Returns the latest 5 DEX trades by token, where currency smart contract is 0x1f98…f984, side currency smart contract is 0xdAC1…1ec7 and block date since 2025-02-08: block time, sum of trade amount, trade price, protocol name, currency name, smart contract, currency symbol and 5 more fields.

By Aman · saved 8 February 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

{
  EVM(dataset: archive) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time, descendingByField: "volume"}
      where: {Block: {Date: {since: "2025-02-08"}}, Trade: {Currency: {SmartContract: {is: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"}}, Side: {Currency: {SmartContract: {is: "0xdAC17F958D2ee523a2206206994597C13D831ec7"}}}}}
      limit: {count: 5}
    ) {
      Block {
        Time(interval: {in: days, count: 10})
      }
      volume: sum(of: Trade_Amount)
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Number)
        close: Price(maximum: Block_Number)
        Currency {
          ProtocolName
          Name
          SmartContract
          Symbol
        }
        Side {
          Currency {
            Symbol
            SmartContract
            ProtocolName
            Name
          }
        }
      }
      count(distinct: Transaction_Hash)
    }
  }
}

Similar queries