Query editor
WITH stusr_actions AS (SELECTevt_block_time AS action_time,_usrAmount / 1e18 AS amount,'deposit' AS actionFROM resolv_ethereum.StUSR_evt_DepositUNION ALLSELECTevt_block_time AS action_time,-(_usrAmount / 1e18) AS amount,'withdraw' AS actionFROM resolv_ethereum.StUSR_evt_Withdraw),usr_actions AS (SELECTcall_block_time AS action_time,_amount / 1e18 AS amount,'mint' AS actionFROM resolv_ethereum.ResolUSD_call_mintUNION ALLSELECTcall_block_time AS action_time,-(_amount / 1e18) AS amount,'burn' AS actionFROM resolv_ethereum.ResolUSD_call_burn),all_actions AS (SELECT action_time, amount, 'stusr' AS source FROM stusr_actionsUNION ALLSELECT action_time, amount, 'usr' AS source FROM usr_actions),ordered_actions AS (SELECTaction_time,COALESCE(amount, 0) AS stusr_amount,0 AS usr_amountFROM all_actionsWHERE source = 'stusr'UNION ALLSELECTaction_time,0 AS stusr_amount,COALESCE(amount, 0) AS usr_amountFROM all_actionsWHERE source = 'usr'),cumulative_sums AS (SELECTDATE_TRUNC('day', action_time) AS action_date,action_time,SUM(stusr_amount) OVER (ORDER BY action_time) AS cumulative_stusr,SUM(usr_amount) OVER (ORDER BY action_time) AS cumulative_usrFROM ordered_actions),daily_transfers AS (SELECTrebase_date,MAX(rebase_time) AS rebase_time,SUM(usr_distributed) AS usr_distributedFROM (