hessAverage Daily Time January
    Updated 2024-06-12
    with zk_import as ( select * from (
    SELECT
    livequery.live.udf_api (
    'https://api.dune.com/api/v1/query/3144999/results?api_key=nPlMJ4JjTsMZcIo0C6kGSt5rpbcoXujU') as resp)
    ,
    table(FLATTEN(parse_json(resp:data:"result":"rows"))))
    ,
    final as ( select TO_TIMESTAMP(value:"date") as date,
    'Zksync' as chain,
    value:"avg_time" as avg_time
    from zk_import
    where date >= '2024-04-01'
    UNION
    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 >= '2024-04-01'
    and b.block_timestamp::date >= '2024-04-01'
    group by 1,2
    UNION
    select date(a.block_timestamp) as date,'Osmosis' as chain, avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    from osmosis.core.fact_blocks a, osmosis.core.fact_blocks b
    where a.block_id = b.block_id-1
    and a.block_timestamp::date >= '2024-04-01'
    and b.block_timestamp::date >= '2024-04-01'
    group by 1,2
    UNION
    select date(a.block_timestamp) as date,'Cosmos' as chain, avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    from cosmos.core.fact_blocks a, cosmos.core.fact_blocks b
    where a.block_id = b.block_id-1
    and a.block_timestamp::date >= '2024-04-01'
    and b.block_timestamp::date >= '2024-04-01'
    group by 1,2
    UNION
    select date(a.block_timestamp) as date,'Flow' as chain, avg(datediff(second,a.block_timestamp, b.block_timestamp)) as avg_time
    from flow.core.fact_blocks a, flow.core.fact_blocks b
    QueryRunArchived: QueryRun has been archived