Query editor
with watched(address, role) as (values(0x3dcc7c30cc73aa175e14c83cb70ef66186eac327, 'source'),(0xa0c4725a8dff325dcaed0247b284d32fa33f53ad, 'source'),(0xe6a5f7f6de90d5693fac766fca4d0d3214f95083, 'upstream source'),(0x328b7a5b2e4ce5bbf40a77e7978bfc5223d5ad42, 'upstream source'),(0x4f091dcce505b438c61bc7a2b49dc8fe2637c3ff, 'holder'),(0x4c6d54a57831f173d5289c7e6ec86516ce6c909c, 'holder'),(0x0af4278a241004213e36480ad83081c812caf469, 'holder')), transfers as (selectevt_tx_hash as tx_hash, evt_block_time as block_time, "from" as sender, "to" as receiver, cast(value as double) / 1e18 as amountfrom erc20_base.evt_Transferwhere contract_address = 0xc52aedec3374422d7510e294cfaa90799595cba3and evt_block_date >= date '2026-05-16'), dex_txs as (select distinct tx_hashfrom dex.tradeswhere blockchain = 'base'and block_date >= date '2026-05-16'and (token_bought_address = 0xc52aedec3374422d7510e294cfaa90799595cba3or token_sold_address = 0xc52aedec3374422d7510e294cfaa90799595cba3))selectwatched.address, watched.role, transfers.sender, sum(transfers.amount) as received, sum(case when dex_txs.tx_hash is not null then transfers.amount else 0 end) as received_in_dex_tx, min(transfers.block_time) as first_received, max(transfers.block_time) as last_received, count(*) as transfer_countfrom watchedinner join transfers on transfers.receiver = watched.addressleft join dex_txs on dex_txs.tx_hash = transfers.tx_hashgroup by 1, 2, 3order by watched.address, received desclimit 1000