Query editor
WITH all_withdraw_events AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,'Withdraw' AS event_source,user,to,evt_tx_hashFROM aave_v3_ethereum.Pool_evt_Withdraw), all_supply_events AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,'Supply' AS event_source,user,onBehalfOf AS to,evt_tx_hashFROM aave_v3_ethereum.Pool_evt_Supply), all_borrow_events AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,'Borrow' AS event_source,user,onBehalfOf AS to,evt_tx_hashFROM aave_v3_ethereum.Pool_evt_Borrow), all_repay_events AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,'Repay' AS event_source,user,evt_tx_hashFROM aave_v3_ethereum.Pool_evt_Repay)SELECTevent_source,COUNT(*) AS total_events,COUNT(CASE WHEN NOT user IS NULL AND NOT to IS NULL THEN 1 END) AS events_with_user_and_to_set,COUNT(CASE WHEN user IS NULL OR to IS NULL THEN 1 END) AS events_with_missing_values,MIN(evt_tx_hash) AS sample_tx_hashFROM (SELECT*FROM all_withdraw_eventsUNION ALLSELECT*FROM all_supply_events) AS combined_eventsGROUP BYevent_sourceORDER BYevent_source