Query editor
selectsum(case when "to" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11 then amt * price end) - coalesce(sum(case when "from" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11 then amt * price end), 0) as sum_usd,symbolfrom(selectevt_block_time,"from","to",e.contract_address,cast(value as double) / power(10, p.decimals) as amt,p.symbol as symbol,p.price as pricefrom erc20_polygon.evt_Transfer eleft join prices.usd_latest p on p.contract_address = e.contract_address and blockchain = 'polygon'where "from" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11 or "to" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11) as txsgroup by symbolorder by sum_usd desc