solana token aggregates

Returns 50 DEX trades by token on Solana, where side currency mint address is So1111…1112, EPjFWd…Dt1v or 2 more, currency mint address is not So1111…1112, EPjFWd…Dt1v or 2 more and block time since 2025-02-07, sorted by total traded volume, highest first: currency name, currency mint address, currency symbol, price in USD, side currency symbol, side currency name, side currency mint address and 2 more fields.

By gaurav · saved 7 February 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query MyQuery($currencies: [String!], $sides: [String!]) {
  Solana {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, Trade: {Side: {Currency: {MintAddress: {in: $sides}}}, Currency: {MintAddress: {notIn: $currencies}}}, Block: {Time: {since: "2025-02-07T07:50:00Z"}}}
      orderBy: {descendingByField: "total_traded_volume"}
      limit: {count: 50}
    ) {
      Trade {
        Currency {
          Name
          MintAddress
          Symbol
        }
        start: PriceInUSD(minimum: Block_Time)
        min5: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: "2025-02-07T08:50:00Z"}}}
        )
        end: PriceInUSD(maximum: Block_Time)
        Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
      }
      makers: count(distinct: Transaction_Signer)
      total_trades: count
      total_traded_volume: sum(of: Trade_Side_AmountInUSD)
      total_buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      total_sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      total_buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      total_sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Variables

{
  "currencies": [
    "So11111111111111111111111111111111111111112",
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "11111111111111111111111111111111",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ],
  "sides": [
    "So11111111111111111111111111111111111111112",
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "11111111111111111111111111111111",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ]
}

Similar queries