0xHaM-dAll - Block Time Daily
    Updated 2024-10-22
    -- forked from All - Block Time Daily copy @ https://flipsidecrypto.xyz/edit/queries/ac871813-82cb-42a3-9e05-86326953bdee

    -- forked from h4wk / All - Block Time Daily @ https://flipsidecrypto.xyz/h4wk/q/ZMrbbFmMCZpr/all---block-time-daily

    -- forked from EVM Daily Block Time @ https://flipsidecrypto.xyz/edit/queries/306ce1ff-2eb6-49a3-b987-f2a607b80e4e

    -- Credited #M-Zamani
    with
    parallel as (
    select
    date(a.block_timestamp) as date,
    'Aptos' as chain,
    avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    from aptos.core.fact_blocks a, aptos.core.fact_blocks b
    where a.block_number = b.block_number-1
    and a.block_timestamp::date >= '2023-08-15'
    and b.block_timestamp::date >= '2023-08-15'
    group by 1,2
    -- UNION ALL
    -- select
    -- date(a.block_timestamp) as date,
    -- 'Sei' as chain,
    -- avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    -- from sei.core.fact_blocks a, sei.core.fact_blocks b
    -- where a.block_id = b.block_id-1
    -- and a.block_timestamp::date >= '2023-08-15'
    -- and b.block_timestamp::date >= '2023-08-15'
    -- group by 1,2
    -- UNION ALL
    -- select
    -- date(a.block_timestamp) as date,'Solana' as chain, avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    -- from solana.core.fact_blocks a, solana.core.fact_blocks b
    -- where a.block_id = b.block_id-1
    -- and a.block_timestamp::date >= '2023-08-15'
    -- and b.block_timestamp::date >= '2023-08-15'
    -- group by 1,2
    QueryRunArchived: QueryRun has been archived