Custom Query

Returns 10 DEX trades by token on Solana, where side currency mint address is So1111…1112, block time after 2025-02-04 and block time before 2025-02-05, sorted by total trades, highest first: currency name, currency mint address, currency symbol, URI, count and sum of trade side amount in USD.

By Mahmoud Yousif · saved 5 February 2025 · run 15 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($start: DateTime, $end: DateTime) {
  Solana(dataset: combined, network: solana) {
    DEXTradeByTokens(
      where: {Trade: {Side: {Type: {}, Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {after: $start, before: $end}}, Transaction: {Result: {Success: true}}}
      limit: {count: 10}
      orderBy: {descendingByField: "total_trades"}
    ) {
      Trade {
        Currency {
          Name
          MintAddress
          Symbol
          Uri
        }
      }
      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

{
  "start": "2025-02-04T20:33:34.700Z",
  "end": "2025-02-05T20:33:34.700Z"
}

Similar queries