Top Sold Tokens on Eth

Why these multiple combined queries results in alternating, but never both at the same query

By SCheung · saved 7 February 2025 · run 6 times · 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: 100}
      orderBy: {descendingByField: "total_bought"}
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
      }
      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: 100}
      orderBy: {descendingByField: "total_sold"}
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
      }
      total_sold: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:sell}}}})
    }    
  }
}

Similar queries