Query editor
SELECTdate_trunc('hour', block_time) as "hour",type,sum(amount) / 1e18 as "amount"FROM(-- outbound transfersSELECTblock_time,CAST(value as decimal) AS amount,'Outflow' as typeFROMfantom.tracesWHERE"from" = 0xE50ec1021ce736a0c4f45a529faf24DAf6f96baDAND successAND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall')OR call_type IS null)UNION ALL-- inbound transfersSELECTblock_time,CAST(value as decimal) AS amount,'Inflow' as typeFROMfantom.tracesWHERE"to" = 0xE50ec1021ce736a0c4f45a529faf24DAf6f96baDAND successAND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall')OR call_type IS null)UNION ALL-- gas costsSELECTblock_time,- CAST(gas_used as decimal) * CAST(gas_price as decimal) AS amount,'Gas Fees' as typeFROMfantom.transactionsWHERE"from" = 0xE50ec1021ce736a0c4f45a529faf24DAf6f96baD) tGROUP BY1,2ORDER BY1 DESC,2