Query editor
with hash as (select evt_tx_hashfrom (select evt_tx_hashfrom erc20_base.evt_transferwhere to = 0x86cbac9d9ac726f729eef6627dc4817bcbb03a9cand contract_address = 0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1band evt_block_time >= cast('2024-10-15' as timestamp)and evt_block_time < cast('2024-12-18' as timestamp)except --except token tradingselect tx_hash from query_4240598where block_time >= cast('2024-11-01' as timestamp)and block_time < cast('2024-12-18' as timestamp))union allselect evt_tx_hashfrom erc20_base.evt_transferwhere to = 0x86cbac9d9ac726f729eef6627dc4817bcbb03a9cand contract_address = 0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1band evt_block_time >= cast('2024-12-18' as timestamp)), raw as (select "from" as address, sum(cast(value as double)/1e18) as amountfrom erc20_base.evt_transferwhere to = 0x86cbac9d9ac726f729eef6627dc4817bcbb03a9cand contract_address = 0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1band evt_tx_hash in (select evt_tx_hash from hash)and evt_block_time >= cast('2024-10-01' as timestamp)and evt_block_time < cast('2024-12-18' as timestamp)group by 1)-- , fee as (select token_address, address as pair_address, token_pair, amountfrom (select address, token_pair, amountfrom rawleft join (select distinct project_contract_address, token_pairfrom dex.trades) on project_contract_address = addresswhere amount > 0and token_pair is not null)left join (select token_address, pairfrom query_4245403) on pair = address-- select project_contract_address-- , token_pair-- , sum(amount_usd) as volume-- from dex.trades-- where project_contract_address in (select address from fee)