ValiMohammadiDaily Flow Transactions
    Updated 2024-03-04
    ------------------------FLOW-------------------
    with flow_transactions as (
    select 'Flow' as chain,
    date_trunc('day', block_timestamp) as date,
    case
    when date >= '2022-06-01 00:00:00.000' then 'Second Half of 2022'
    else 'First Half of 2022'
    end as period,
    count (distinct tx_id) as "Daily TX Count",
    "Daily TX Count"/1440 as "Transactions Per Minute (TPM)",
    "Daily TX Count"/86400 as "Transactions Per Second (TPS)"
    from flow.core.fact_transactions
    where block_timestamp >= '2022-01-01'
    and block_timestamp::date != CURRENT_DATE
    group by 1,2),

    flow_data as(
    select chain, period,
    avg("Daily TX Count") as avg_tpd,
    avg("Transactions Per Minute (TPM)") as avg_tpm,
    avg("Transactions Per Second (TPS)") as avg_tps
    from flow_transactions
    group by 1,2),
    ------------------------Etherum-------------------
    etherum_transactions as (
    select 'Etherum' as chain,
    date_trunc('day', block_timestamp) as date,
    case
    when date >= '2022-06-01 00:00:00.000' then 'Second Half of 2022'
    else 'First Half of 2022'
    end as period,
    count (distinct tx_hash) as "Daily TX Count",
    "Daily TX Count"/1440 as "Transactions Per Minute (TPM)",
    "Daily TX Count"/86400 as "Transactions Per Second (TPS)"
    from ethereum.core.fact_transactions
    where block_timestamp >= '2022-01-01'
    QueryRunArchived: QueryRun has been archived