DEX prices for multiple contracts - can it be batched?

I’m trying to get the last few DEX transaction for ~40 different contracts. from what I can tell that’s 40 API calls.

is there some way to batch them together?

right now I’m using 40 calls to this node:
ethereum(network: $network){
dexTrades(options: { desc: [“block.height”, “tradeIndex”], limit: $limit, offset: $offset },
date: { since: $from till: $till }
baseCurrency: { is: $token }

and getting throttled

Add more base currencies like below

baseCurrency: { in: [“token1”, “token2”]}

less popular tokens are not showing up in the results at all. is there a way to return an equal number of results for each token?

found the answer :slight_smile:

limitBy: {each: “baseCurrency.address”, limit: 1}

bitquery is awesome!!!

2 Likes