Query editor
withstake_events as (selectCAST(amount as double) / 1e18 as amount_norm,*fromtable (decode_evm_event (abi => '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"}',input => table (select*fromethereum.logswherecontract_address = 0x4E41488C19cD35EB4de3083Fc3e204854c75c86a -- GROVE TRand topic0 = 0x9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d -- Staked(user,amount)and block_number > 20677433)))),unstake_events as (select- CAST(amount as double) / 1e18 as amount_norm,*fromtable (decode_evm_event (abi => '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"}',input => table (select*fromethereum.logswherecontract_address = 0x4E41488C19cD35EB4de3083Fc3e204854c75c86a -- GROVE TRand topic0 = 0x7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5 -- Staked(user,amount)and block_number > 20677433)))),daily_flows as (selectblock_date,user as address,SUM(amount_norm) as daily_net,SUM(amount_norm) filter (where amount_norm > 0) as daily_stake,SUM(amount_norm) filter (where amount_norm < 0) as daily_unstakefrom ( select * from stake_events union all select * from unstake_events)group byblock_date,userorder byblock_date desc),--select * from daily_flows limit 10