Updated 2023-12-07
    PSwith chains as (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 >= current_date - 30 and block_timestamp < current_date - 1
    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
    from optimism.core.fact_transactions
    where block_timestamp::date >= current_date - 30 and block_timestamp < current_date - 1
    group by 1,2
    UNION
    select date(block_timestamp) as date,
    'Avalanche' as chain,
    count(DISTINCT tx_hash) as total_tx,
    total_tx/86400 as tps
    from avalanche.core.fact_transactions
    where block_timestamp::date >= current_date - 30 and block_timestamp < current_date - 1
    group by 1,2
    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 >= current_date - 30 and block_timestamp < current_date - 1
    group by 1,2
    UNION
    select date(block_timestamp) as date,
    'Osmosis' as chain,
    count(DISTINCT tx_id) as total_tx,
    total_tx/86400 as tps
    Run a query to Download Data