OHLCV

Solana OHLCV for given token by interval with limit

Returns the latest 10 DEX trades by token on Solana, where currency mint address is QRXmGh…pump, side currency mint address is So1111…1112 and block time since 2025-01-26: block time, sum of trade amount in USD, sum of trade amount, currency name, currency symbol, currency mint address, side currency name and 8 more fields.

By D S · saved 26 January 2025 · run 18 times · Bitquery API v2

What it returns

Filters

The query

query GetOHLCV(
  $mintAddress: String
  $interval: OLAP_DateTimeIntervalUnits
  $intervalCount: Int
  $limit: Int
) {
  Solana {
    DEXTradeByTokens(
      orderBy: { descendingByField: "Block_Time" }
      where: { Trade: { Currency: { MintAddress: { is: $mintAddress } }, Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }, PriceAsymmetry: { lt: 0.1 } }, Block: { Time: { since: "2025-01-26T11:03:00Z" } } }
      limit: { count: $limit }
    ) {
      Block {
        Time(interval: { in: $interval, count: $intervalCount })
        lastTradeTime: Time(maximum: Block_Time)
        firstTradeTime: Time(minimum: Block_Time)
      }
      volumeUSD: sum(of: Trade_AmountInUSD)
      volume: sum(of: Trade_Amount)
      Trade {
        Currency {
          Name
          Symbol
          MintAddress
        }
        Side {
          Currency {
            Name
            Symbol
            MintAddress
          }
        }
        Dex {
          ProgramAddress
          ProtocolFamily
          ProtocolName
        }
        highUSD: PriceInUSD(maximum: Trade_Price)
        lowUSD: PriceInUSD(minimum: Trade_Price)
        openUSD: PriceInUSD(minimum: Block_Slot)
        closeUSD: PriceInUSD(maximum: Block_Slot)
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Slot)
        close: Price(maximum: Block_Slot)
      }
      count
    }
  }
}

Variables

{
  "mintAddress": "QRXmGhRB6UxMxTqSW5m5MBCqmxmnmmbTPq7cTk6pump",
  "interval": "minutes",
  "intervalCount": 1,
  "limit": 10
}

Similar queries