Price change 5min 1hr, 6hr precentage of a specific token

Returns DEX trades by token on Solana, where currency mint address is vLieQF…bonk and market market address is 9qppy1…p7EX: price in USD, sum of trade side amount in USD and calculate.

By gaurav · saved 30 July 2025 · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  Solana {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "vLieQF5eDqUuuk8RzRaqgAHkXr7bSEBZaWk9Zfibonk"}}, Market: {MarketAddress: {is: "9qppy1KXRTFEeWkFaysYHD7eu9GLg5pGXdLkdL51p7EX"}}}, Block: {Time: {since_relative: {hours_ago: 6}}}}
    ) {
      Trade {
        Price_5min_ago: PriceInUSD(minimum:Block_Time if:{Block:{Time:{since_relative:{minutes_ago:5}}}})
				Price_1h_ago: PriceInUSD(minimum:Block_Time if:{Block:{Time:{since_relative:{hours_ago:1}}}})
        Price_6h_ago: PriceInUSD(minimum: Block_Time)
        CurrentPrice: PriceInUSD(maximum: Block_Time)
      }
      volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
      )
      volume_1h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
      )
      volume_6h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {hours_ago: 6}}}}
      )
      Price_Change_5min: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_6h_ago) * 100")
      Price_Change_1h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_6h_ago) * 100")
      Price_Change_6h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100")
    }
  }
}

Similar queries