OHLC SOL

Returns the latest 10 DEX trades by token on Solana, where currency mint address is 6p6xgH…GiPN, block time before 2025-02-01 and side amount is above 0: program address, protocol family, protocol name, currency symbol, currency name, currency mint address, price in USD and 2 more fields.

By Data Admin · saved 13 February 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $time_before: DateTime) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Time"}
      where: {Block: {Time: {before: $time_before}}, Trade: {Side: {Amount: {gt: "0"}}, Currency: {MintAddress: {is: $token}}}}
      limit: {count: 10}
    ) {
      Trade {
        Dex {
          ProgramAddress
          ProtocolFamily
          ProtocolName
        }
        Currency {
          Symbol
          Name
          MintAddress
        }
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Slot)
        close: PriceInUSD(maximum: Block_Slot)
        price: PriceInUSD(maximum: Trade_PriceInUSD)
      }
      volume: sum(of: Trade_Side_AmountInUSD)
      Block {
        Time(interval: {count: 1, in: minutes})
      }
    }
  }
}

Variables

{
  "token": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
  "time_ago": "2024-08-04T00:00:00.000Z",
  "time_before": "2025-02-01T00:00:00.000Z",
  "space": 1,
  "resolution": "minutes"
}

Similar queries