Query editor
/* Error: Unable to fully debug query */WITH depositable_keys AS (SELECTnodeOperatorId,evt_block_time AS depositable_time,evt_block_number AS depositable_block,depositableKeysCount AS keys_countFROM lido_ethereum.CSModule_evt_DepositableSigningKeysCountChangedWHEREdepositableKeysCount > 0), deposited_keys AS (SELECTnodeOperatorId,evt_block_time AS deposited_time,evt_block_number AS deposited_block,depositedKeysCount AS keys_countFROM lido_ethereum.CSModule_evt_DepositedSigningKeysCountChangedWHEREdepositedKeysCount > 0), matched_keys AS (SELECTd.nodeOperatorId,DATE_TRUNC('day', d.depositable_time) AS depositable_date,DATE_TRUNC('day', dk.deposited_time) AS deposited_date,((TRY_CAST(TO_UNIXTIME(dk.deposited_time) - TO_UNIXTIME(d.depositable_time) AS DOUBLE)) / 3600.0) AS wait_time_hours,d.keys_countFROM depositable_keys AS dJOIN deposited_keys AS dkON d.nodeOperatorId = dk.nodeOperatorIdAND d.keys_count = dk.keys_countAND dk.deposited_time >= d.depositable_time)SELECTdepositable_date AS date,ROUND(AVG(wait_time_hours), 2) AS avg_wait_time_hours,ROUND(MIN(wait_time_hours), 2) AS min_wait_time_hours,ROUND(MAX(wait_time_hours), 2) AS max_wait_time_hours,ROUND(APPROX_PERCENTILE(wait_time_hours, 0.5), 2) AS median_wait_hours,ROUND(APPROX_PERCENTILE(wait_time_hours, 0.75), 2) AS p75_wait_hours,ROUND(APPROX_PERCENTILE(wait_time_hours, 0.25), 2) AS p25_wait_hours,SUM(keys_count) AS total_keys_processed,COUNT(*) AS batches_processedFROM matched_keysGROUP BYdepositable_dateORDER BYdepositable_date