Query editor
--cast (bytearray_to_uint256(cast(bytearray_substring(data,1,32) as varchar)) as double) as tranche,--cast(bytearray_substring(data,45,20) as varchar) as address,with a as(select date_trunc('week',evt_block_time) as time, 'Deposit' as action,sum(cast(amount as double)/1e18) as amountfrom tranchessethsharestaking_bnb.ShareStaking_evt_Depositedwhere cast(tranche as double) = 0group by 1union allselect date_trunc('week',evt_block_time) as time, 'Withdrawn' as action,-sum(cast(amount as double)/1e18) as amountfrom tranchessethsharestaking_bnb.ShareStaking_evt_Withdrawnwhere cast(tranche as double) = 0group by 1)selecttime,sum(amount) as amount_stake,sum(sum(amount)) over (order by time asc) as acc_netfrom agroup by 1-- select * from tranchess_bnb.ExchangeV2_evt_Withdrawn-- where evt_tx_hash = 0xfb113c09dee8fb32c64249f5b6e6ca2d52ce2628644f457e09d6943f065574cc