Query editor
selectblock_date,blockchain,sum(amount_usd) trade_vol,count(distinct trader_address) as trader_cnt,'binance wallet' as wallet_namefrom(selectblock_date, blockchain, tx_from as trader_address, amount_usd, evt_index, MAX(evt_index) OVER (PARTITION BY tx_hash) AS max_indexfrom dex.tradeswhere block_month >= DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '3' monthand tx_to in (selectfrom_hex(address)from dune.night_walker.dataset_crypto_wallet_router_update20251128where name = 'binance'and (blockchain <> 'solana' and blockchain <> 'alpha')))whereevt_index = max_indexgroup byblock_date, blockchainunion allselectblock_date, 'solana' as blockchain, sum(amount_usd) as trade_vol, count(distinct trader_id) as trader_cnt, 'binance wallet' as wallet_namefrom dex_solana.tradeswhere block_month >= DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '3' monthand trade_source in (selectaddressfrom dune.night_walker.dataset_crypto_wallet_router_update20251128where name = 'binance'and blockchain = 'solana')group byblock_date