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(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_bnb.evt_Transfer eleft join prices.usd_latest p on p.contract_address = e.contract_address and blockchain = 'bnb'where "from" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11 or "to" = 0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11) as txsgroup by symbolorder by sum_usd desc