OHLC historical solana - MCI v2

needed to correct the pump fun ohcl

Returns 10 DEX trades by token on Solana, where currency mint address is CzLSuj…pump and block time after 2024-11-01, sorted by block timefield: trade price, block time, sum of trade amount and count.

By masten · saved 2 December 2024 · run 8 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $time_ago: DateTime, $time_since: DateTime, $time_before: DateTime, $resolution: OLAP_DateTimeIntervalUnits, $space: Int) {
  Solana(dataset: archive) {
    DEXTradeByTokens(
      limit: {count: 10}  # Return up to 10 results based on the given time range
      orderBy: {ascendingByField: "Block_Timefield"}  # Order by Block_Timefield (you can choose another field if needed)
      where: {
        Block: {
          Time: {after: $time_ago, before: $time_before, since: $time_since},  # Time filter for the block
          Date: {}
        },
        Trade: {
          Currency: {MintAddress: {is: $token}}  # Specify the token contract address
        }
      }
    ) {
      Trade {
        high: Price(maximum: Trade_Price)  # Get the maximum price during this time interval
        low: Price(minimum: Trade_Price)   # Get the minimum price during this time interval
        open: Price(minimum: Block_Slot)   # Get the open price for the given time block
        close: Price(maximum: Block_Slot)  # Get the close price for the given time block
      }
      Block {
        Timefield: Time(interval: {count: $space, in: $resolution})  # Block time intervals with resolution
      }
      volume: sum(of: Trade_Amount)  # Total volume for the given time range
      count  # Count of trades during the given time range
    }
  }
}

Variables

{
  "token": "CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump",  
  "time_ago": "2024-11-01T00:00:00Z",  
  "end_time": "2024-01-01T01:00:00Z",  
  "space": 1,  
  "resolution": "minutes"  
}

Similar queries