Top Bought/Sold/Trending/Volatility Tokens on Eth

Why these multiple combined subscription results in alternating, but never both at the same query, or even allows more than 2 combined queries

By SCheung · saved 7 February 2025 · Bitquery API v2

What it returns

Filters

The subscription

subscription MyQuery {
  EVM(network: eth) {
    topBought: DEXTradeByTokens(
      where: {Block: {Time: {since: "2024-12-24T08:20:00Z"}}}
      limit: {count: 3}
      orderBy: {descendingByField: "total_bought"}
    ) {
      Trade {
        Currency {
          Name
          Symbol           
        }
      }
      total_bought: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:buy}}}})
    }
    
    topSold: DEXTradeByTokens(
      where: {Block: {Time: {since: "2024-12-24T08:20:00Z"}}}
      limit: {count: 3}
      orderBy: {descendingByField: "total_sold"}
    ) {
      Trade {
        Currency {
          Name
          Symbol           
        }
      }
      total_sold: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:sell}}}})
    }    
    
     
    topVolatility: DEXTradeByTokens(
      where: {Block: {Time: {since: "2024-12-24T08:20:00Z"}}}
      limit: {count: 3}
      orderBy: {descendingByField: "total_volatility"}
    ) {
      Trade {
        Currency {
          Name
          Symbol           
        }
      }
      total_volatility: standard_deviation(of:Trade_PriceInUSD)
    } 
    
    
    topTrending: DEXTradeByTokens(
      where: {Block: {Time: {since: "2025-02-06T20:00:00Z"}}}      
      limit: {count: 3}
      orderBy: {descendingByField: "volume"}
      
    ) {
      Trade {
        Currency {
          Symbol
          Name
        }
      }
      volume: sum(of: Trade_AmountInUSD)
      traders: count(distinct: Trade_Buyer)
      tradeCount: count
    }
    
  }
}

Similar queries