Query editor
with usd_to as (select contract_address, sum(cast(value as double)/1e6) as token_total from erc20_polygon.evt_Transferwhere to = 0xb68fba324Fb1404De8DAA8fbb9F44ef852264EF6and contract_address = 0x2791bca1f2de4661ed88a30c99a7a9449aa84174group by 1),usd_from as (select contract_address, -sum(cast(value as double)/1e6) as token_total from erc20_polygon.evt_Transferwhere "from" = 0xb68fba324Fb1404De8DAA8fbb9F44ef852264EF6and contract_address = 0x2791bca1f2de4661ed88a30c99a7a9449aa84174group by 1),weth_to as (select contract_address, sum(cast(value as double)/1e18) as token_total from erc20_polygon.evt_Transferwhere to = 0xb68fba324Fb1404De8DAA8fbb9F44ef852264EF6and contract_address = 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619group by 1),weth_from as (select contract_address, -sum(cast(value as double)/1e18) as token_total from erc20_polygon.evt_Transferwhere "from" = 0xb68fba324Fb1404De8DAA8fbb9F44ef852264EF6and contract_address = 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619group by 1),total as (select contract_address,token_total,(token_total*0.01) as daily_total from usd_tounion allselect contract_address,token_total,(token_total*0.01) as daily_total from usd_fromunion allselect contract_address,token_total,(token_total*0.01) as daily_total from weth_tounion allselect contract_address,token_total,(token_total*0.01) as daily_total from weth_from)select contract_address,sum(token_total) as total,sum(token_total*0.01) as daily_total from totalgroup by 1order by 1 asc