D3 Team[Blast]
    Updated 2024-08-01
    with sub as (
    select
    block_timestamp,
    hash,
    block_number,
    tx_count,
    gas_used,
    lead(block_timestamp) over (
    order by
    block_number
    ) as next_block_timestamp
    from
    blast.core.fact_blocks
    )
    select
    max(block_number) as "Total Blocks",
    avg(timediff(second, block_timestamp, next_block_timestamp)) as "Average Block Time (s)",
    avg(tx_count / timestampdiff(second, block_timestamp, next_block_timestamp)) as "Average TPS",
    max(tx_count / timestampdiff(second, block_timestamp, next_block_timestamp)) as "Max TPS",
    min(tx_count / timestampdiff(second, block_timestamp, next_block_timestamp)) as "Min TPS",

    avg(tx_count) as "Average Tx/Block",
    max(tx_count) as "Max Tx/Block",
    min(tx_count) as "Min Tx/Block",

    sum(gas_used) as "Total Gas Used",
    avg(gas_used) as "Average Gas Used",
    max(gas_used) as "Max Gas Used",
    min(gas_used) as "Min Gas Used"
    from
    sub
    QueryRunArchived: QueryRun has been archived