Afonso_DiazOvertime
    Updated 2025-01-27
    with

    main as (
    select
    tx_id as tx_hash,
    block_timestamp,
    authorizers[0]::string as user,
    'Flow' as chain
    from
    flow.core.fact_transactions
    where
    tx_succeeded

    union all

    select
    tx_hash,
    block_timestamp,
    from_address as user,
    'Flow EVM' as chain
    from
    flow.core_evm.fact_transactions
    where
    tx_succeeded
    ),

    overtime as (
    select
    date_trunc('{{ period }}', block_timestamp) as date,
    chain,
    count(distinct tx_hash) as transactions,
    count(distinct user) as users
    from
    main
    group by 1, 2
    ),
    QueryRunArchived: QueryRun has been archived