avaemaPolygon : Transaction per hour, minute and second
    Updated 2022-07-18
    with total as (select count(1) as total_count ,trunc(block_timestamp,'DAY') as days
    from polygon.core.fact_transactions
    where trunc(block_timestamp,'DAY') >= getdate() - interval '120 days'
    group by 2)
    , success as
    (select count(1) as success_count ,trunc(block_timestamp,'DAY') as days
    from polygon.core.fact_transactions
    where status='SUCCESS' and trunc(block_timestamp,'DAY') >= getdate() - interval '120 days'
    group by 2)
    , fail as
    (select count(1) as fail_count ,trunc(block_timestamp,'DAY') as days
    from polygon.core.fact_transactions
    where status='FAIL' and trunc(block_timestamp,'DAY') >= getdate() - interval '120 days'
    group by 2)

    select total_count/24 as per_hour , total_count/(24*60) as per_minute , total_count/(24*60*60) as per_second , days from total
    Run a query to Download Data