Buys, Sells, BuyVolume, SellVolume, Makers, TotalTradedVolume, PriceinUSD for solana token pair

new pumpfun tokens

Returns DEX trades by token on Solana, where currency mint address is FjowVf…pump, side currency mint address is So1111…1112 and market market address is HLP5ZQ…Aos3: currency name, currency mint address, currency symbol, price in USD, protocol name, protocol family, program address and 6 more fields.

By Sparks · saved 27 January 2025 · run 12 times · Bitquery API v2

What it returns

Filters

The query

query getTokenVolumeDetails(
$token: String!, 
$pair_address: String!,
$side_token: String!,
$time_5min_ago: DateTime!,  
$time_1h_ago: DateTime!, 
$time_6h_ago: DateTime!, 
$time_24h_ago: DateTime!
) {
  Solana(dataset: realtime) {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, 
      Trade: {
        Currency: {MintAddress: {is: $token}}, 
        Side: {Currency: {MintAddress: {is: $side_token}}}, 
        Market: {MarketAddress: {is: $pair_address}}
      }, 
      Block: {Time: {since: $time_24h_ago}}}
    ) {
      Trade {
        Currency {
          Name
          MintAddress
          Symbol
        }
        start: PriceInUSD(minimum: Block_Time)
        min5: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: $time_5min_ago}}}
        )
        h1: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: $time_1h_ago}}}
        )
        h6: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: $time_6h_ago}}}
        )
        h24: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: $time_24h_ago}}}
        )
        end: PriceInUSD(maximum: Block_Time)
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Market {
          MarketAddress
        }
        Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
      }
      makers: count(distinct: Transaction_Signer)
      makers_5min: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_5min_ago}}}
      )
      makers_1hr: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_1h_ago}}}
      )
      makers_6hr: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_6h_ago}}}
      )
      makers_24hr: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_24h_ago}}}
      )
      buyers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      buyers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      buyers_1hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      ) 
      buyers_6hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      ) 
      buyers_24hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}}
      )
      sellers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sellers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sellers_1hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sellers_6hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      sellers_24hr: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}}
      )

      trades: count
      trades_5min: count(if: {Block: {Time: {after: $time_5min_ago}}})
      trades_1hr: count(if: {Block: {Time: {after: $time_1h_ago}}})
      trades_6hr: count(if: {Block: {Time: {after: $time_6h_ago}}})
      trades_24hr: count(if: {Block: {Time: {after: $time_24h_ago}}})

      traded_volume: sum(of: Trade_Side_AmountInUSD)
      traded_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_5min_ago}}}
      )
      traded_volume_1hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_1h_ago}}}
      )
      traded_volume_6hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_6h_ago}}}
      )
      traded_volume_24hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_24h_ago}}}
      )

      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      buy_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      buy_volume_1hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      )   
      buy_volume_6hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      )   
      buy_volume_24hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}}
      )

      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sell_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sell_volume_1hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sell_volume_6hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      ) 
      sell_volume_24hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}}
      )

      buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      buys_5min: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      buys_1hr: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      ) 
      buys_6hr: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      ) 
      buys_24hr: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}}
      )

      sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
      sells_5min: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sells_1hr: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sells_6hr: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      sells_24hr: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}}
      )
    }
  }
}

Variables

{
  "token":"FjowVf4Q3grrB9ZCSuV3iXfamCT9D9J7cBEBFDLzpump",
  "side_token": "So11111111111111111111111111111111111111112",
  "pair_address": "HLP5ZQ26Yb3TeYBAzTnKfq4FyjYo7XkGv1JB6Vq7Aos3",
	 "time_5min_ago": "2025-01-27T17:23:42.761Z",
  "time_1h_ago": "2025-01-27T16:28:42.761Z",
  "time_6h_ago": "2025-01-27T11:28:42.761Z",
  "time_24h_ago": "2025-01-26T17:28:42.761Z"
}

Similar queries