elsinaMin,Max,AVG Block Age in ARBI
    Updated 2022-07-27
    with blocktage_diff as (
    select
    block_number as "Block Number",
    TX_COUNT as "TX count",
    date_trunc('day', block_timestamp) as "Day",
    block_timestamp as "current block time",
    lag(block_timestamp,1) over(order by block_number) as "previous block time",
    DATEDIFF(second , "previous block time" , "current block time" ) as "Block Age"
    from arbitrum.core.fact_blocks
    )
    select
    min("Block Age") as "Min Block Time",
    max("Block Age") as "Max Block Time",
    avg("Block Age") as "Average Block Time",
    round(avg("TX count"),2) as "Average TX count"

    from blocktage_diff
    where "Block Age" is not null -- first row have null age becuse we don't have prev


    Run a query to Download Data