Latest Trades of a Token on Solana

Returns 10 DEX trades by token on Solana, sorted by trades count with unique traders, highest first: currency name, currency symbol, currency mint address, URI, count and sum of trade side amount in USD.

By Stephanie · saved 14 December 2024 · run 14 times · Bitquery API v2

What it returns

The query

query TrendingTokens($time_5min_ago: DateTime!) {
  Solana {
    DEXTradeByTokens(
      limit: {count: 10}
      orderBy: {descendingByField: "tradesCountWithUniqueTraders"}
    ) {
      Trade {
        Currency {
          Name
          Symbol
          MintAddress
          Uri
        }
      }
      makers: count(distinct: Transaction_Signer)
      tradesCountWithUniqueTraders: count(distinct: Transaction_Signer)
      trades: count
      trades_5min: count(if: {Block: {Time: {after: $time_5min_ago}}})
      traded_volume: sum(of: Trade_Side_AmountInUSD)
      traded_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_5min_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}}}
      )
      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}}}
      )
      buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      buys_5min: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
      sells_5min: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
    }
  }
}

Variables

{
  "token":"2qEHjDLDLbuBgRYvsxhc5D6uDWAivNFZGan56P1tpump",
  "side_token": "So11111111111111111111111111111111111111112",
  "pair_address": "4AZRPNEfCJ7iw28rJu5aUyeQhYcvdcNm8cswyL51AY9i",  
  "time_5min_ago": "2024-11-06T15:13:00Z",
  "time_1h_ago": "2024-11-06T14:18:00Z"
}

Similar queries