hessAVERAGE DAILY TPS
    Updated 2023-11-17
    with zk_import as ( select * from (
    SELECT
    livequery.live.udf_api (
    'https://api.dune.com/api/v1/query/3145263/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:"total_tx" as total_tx,
    total_tx/86400 as tps
    from zk_import
    where date >= '2023-08-15'
    UNION
    select date(block_timestamp) as date,
    'Sei' as chain,
    count(DISTINCT tx_id) as total_tx,
    total_tx/86400 as tps
    from sei.core.fact_transactions
    where block_timestamp::date >= '2023-08-15'
    and TX_SUCCEEDED = 'true'
    group by 1,2
    UNION
    select date(block_timestamp) as date,
    'Arbitrum' as chain,
    count(DISTINCT tx_hash) as total_tx,
    total_tx/86400 as tps
    from arbitrum.core.fact_transactions
    where block_timestamp::date >= '2023-08-15'
    and STATUS = 'SUCCESS'
    group by 1,2
    UNION
    select date(block_timestamp) as date,
    'Optimism' as chain,
    count(DISTINCT tx_hash) as total_tx,
    total_tx/86400 as tps
    Run a query to Download Data