feyikemiTotal Transactions November copy
    Updated 2024-12-18
    -- forked from Masi / Total Transactions November @ https://flipsidecrypto.xyz/Masi/q/L9e4LGIACc8s/total-transactions-november

    with tb1 as (select trunc(block_timestamp_hour,'day') as daily,
    BLOCKCHAIN,
    sum(TRANSACTION_COUNT_SUCCESS) as success_transaction,
    success_transaction/84400 as STPS,
    sum(success_transaction) over (partition by BLOCKCHAIN order by daily asc) as cumulative
    from crosschain.stats.ez_core_metrics_hourly
    where block_timestamp_hour::date >= '2024-11-01' and block_timestamp_hour::date < '2024-12-01'
    and blockchain in ('polygon','near','sei','blast','arbitrum','avalanche','optimism','axelar','aptos','bsc','ethereum','base','kaia','solana','flow')
    group by 1,2
    UNION
    select trunc(block_timestamp,'day') as daily,
    'Thorchain' as blockchain,
    count(*) as success_transaction,
    success_transaction/84400 as STPS,
    sum(success_transaction) over (partition by BLOCKCHAIN order by daily asc) as cumulative
    from thorchain.core.fact_transfers
    where block_timestamp::date >= '2024-11-01' and block_timestamp::date < '2024-12-01'
    group by 1,2
    UNION
    select trunc(block_timestamp,'day') as daily,
    'Kaia' as blockchain,
    count(DISTINCT tx_hash) as success_transaction,
    success_transaction/84400 as STPS,
    sum(success_transaction) over (partition by BLOCKCHAIN order by daily asc) as cumulative
    from kaia.core.fact_transactions
    where block_timestamp::date >= '2024-11-01' and block_timestamp::date < '2024-12-01'
    and tx_succeeded = 'TRUE'
    group by 1,2
    order by 1 asc )

    select case when blockchain = 'near' then 'Near' else 'Other Chains' end as type,
    blockchain,
    sum(success_transaction) as transactions,
    avg(stps) as "STPS"
    QueryRunArchived: QueryRun has been archived