Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/selectsum(amt_usd) as totalfrom(select evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_ethereum.Pool_evt_Withdrawleft join prices.usd p on p.blockchain = 'ethereum' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_ethereum.PoolV3_evt_Withdrawleft join prices.usd p on p.blockchain = 'ethereum' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_ethereum.Pool_v3_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'ethereum' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_ethereum.Pool_v4_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'ethereum' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_bnb.Pool_v3_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'bnb' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_bnb.Pool_v4_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'bnb' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_polygon.Pool_v3_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'polygon' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = tokenUNION ALLselect evt_block_time, account, (cast(amount as double) / power(10, p.decimals) * p.price) as amt_usd, p.symbolfrom airswap_polygon.Pool_v4_1_evt_Withdrawleft join prices.usd p on p.blockchain = 'polygon' and p.minute = date_trunc('minute', evt_block_time) and p.contract_address = token) as amt_withdrawn