elsina✅ transactions: TPS
    Updated 2022-12-07
    with info as (
    select
    date_trunc('hour', block_timestamp) as hour,
    count(distinct tx_id) as "tx count",
    "tx count"/3600 as tps
    from terra.core.fact_transactions
    group by 1
    ),
    final_tps as (
    SELECT
    date_trunc('week', hour) as "Day",
    avg(tps) as "TPS"
    from info
    group by 1
    order by 1 asc
    ),
    avg_info as (
    select avg("TPS") as "AVG TPS"
    from final_tps
    )
    select *
    from final_tps, avg_info
    order by "Day"
    Run a query to Download Data