Query editor
-- stonkbox on Base, contract 0x515a693fc474b2344a9a07f4962ef33ffc253447, from block 51277954with flows as (select date_trunc('day', block_time) as day,sum(case when topic2 = 0x000000000000000000000000515a693fc474b2344a9a07f4962ef33ffc253447 then bytearray_to_uint256(data) else 0 end) / 1e6 as usdc_in,sum(case when topic1 = 0x000000000000000000000000515a693fc474b2344a9a07f4962ef33ffc253447 then bytearray_to_uint256(data) else 0 end) / 1e6 as usdc_outfrom base.logswhere contract_address = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 and topic0 = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef and block_number >= 51277954and (topic1 = 0x000000000000000000000000515a693fc474b2344a9a07f4962ef33ffc253447 or topic2 = 0x000000000000000000000000515a693fc474b2344a9a07f4962ef33ffc253447)group by 1)select day, usdc_in, usdc_out, sum(usdc_in - usdc_out) over (order by day) as usdc_balancefrom flowsorder by day