Query editor
with ethpx as (select date(timestamp) as d, price from prices.daywhere blockchain = 'ethereum'and contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2and timestamp >= timestamp '2026-06-15'),vpx as (select date(timestamp) as d, price from prices.daywhere blockchain = 'base'and contract_address = 0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1band timestamp >= timestamp '2026-06-15'),flows as (select t.block_date as d, 'in' as dir, cast(t.value as double)/1e18 * e.price as usdfrom robinhood.transactions tjoin ethpx e on e.d = t.block_datewhere t.gas_price = 0 and t.value > cast(0 as uint256)and t.block_time >= timestamp '2026-06-15'union allselect t.block_date, 'out', cast(t.value as double)/1e18 * e.pricefrom robinhood.transactions tjoin ethpx e on e.d = t.block_datewhere t."to" = 0x0000000000000000000000000000000000000064and t.value > cast(0 as uint256)and t.block_time >= timestamp '2026-06-15'union allselect tr.block_date,case when tr."from" = 0x0000000000000000000000000000000000000000 then 'in' else 'out' end,tr.amount * case when tr.contract_address = 0xc6911796042b15d7fa4f6cde69e245ddcd3d9c31then coalesce(v.price, 0) else 1 endfrom tokens.transfers trleft join vpx v on v.d = tr.block_datewhere tr.blockchain = 'robinhood'and tr.block_date >= date '2026-06-15'and tr.contract_address in (0x5fc5360d0400a0fd4f2af552add042d716f1d168,0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34,0xc6911796042b15d7fa4f6cde69e245ddcd3d9c31)and (tr."from" = 0x0000000000000000000000000000000000000000or tr."to" = 0x0000000000000000000000000000000000000000))select d as day,sum(case when dir = 'in' then usd else 0 end) as inflow_usd,sum(case when dir = 'out' then usd else 0 end) as outflow_usd,sum(case when dir = 'in' then usd else -usd end) as net_usd,sum(sum(case when dir = 'in' then usd else -usd end)) over (order by d) as cum_net_usdfrom flowsgroup by dorder by d