How to Track Wallet Interactions with Multiple DEXes Over Time Using a Single Query?

Hello

I am trying to build a dashboard that shows how a particular wallet interacts with multiple decentralized exchanges (DEXes) such as Uniswap, PancakeSwap & SushiSwap over time. The goal is to track which DEX the wallet used, how frequently & the volume transacted ideally grouped by week or month. :slightly_smiling_face:

While I can write separate queries for each DEX & then merge results manually, I’m wondering if there’s a way to streamline this using a single GraphQL query by filtering on a list of DEX protocols and grouping the results.

I have explored the dexTrades endpoint and can get individual trades, but I’m unsure how to dynamically group across protocols in one shot and aggregate them by time intervals. :slightly_smiling_face: Checked DEX Trades API | Blockchain Data API (V2) UiPath Course guide related to this and found it quite informative.

Is there a best practice or pattern to follow for this kind of use case? Maybe using fragments, nested filtering, or subqueries within Bitquery’s syntax? :thinking: Any help or query samples would be greatly appreciated!

Thank you !! :slightly_smiling_face:

Check Address Trades API | Blockchain Data API (V2)

@sienna check above. Use the Agent in docs to get queries, it is trained on IDE queries and docs