rajsArbitrum Blocks
    Updated 2023-04-13
    with blocks as
    (
    SELECT
    -- *
    block_number,
    tx_count,
    block_timestamp,
    lag(block_timestamp,1) over (order by block_timestamp) as lag,
    datediff('seconds', lag(block_timestamp,1) over (order by block_timestamp), block_timestamp) as block_time
    FROM arbitrum.core.fact_blocks
    order by 1 DESC
    -- limit 100
    )

    SELECT
    date_trunc('hour', block_timestamp) as date,
    count(*) as no_of_blocks,
    sum(tx_count) as no_of_txs,
    avg(block_time) as avg_block_time
    from blocks
    group by 1
    order by 1
    Run a query to Download Data