Query editor
-- This query has been migrated to run on DuneSQL.-- If you need to change back because you’re seeing issues, use the Query History view to restore the previous version.-- If you notice a regression, please email [email protected].WITHblocks AS (SELECTb.*,date_diff('second', LAG(time) OVER (ORDER BYheight), time) AS time_elapsedFROMsolana.blocks AS bWHEREdate >= CAST('2022-01-01' AS TIMESTAMP)AND date < CURRENT_DATE)SELECTdate,(24 * 60 * 60) / CAST(COUNT(1) AS DOUBLE) AS avg_time_to_produce_block,AVG(TRY_CAST(time_elapsed AS INTEGER)) AS avg_time_to_produce_block_altFROMblocksGROUP BY1ORDER BY1