RamaharStatistics
    Updated 2022-12-11
    With txs_table as (select
    'FLOW' as chain,
    {{timeperiod}}(block_timestamp) as dayz,
    count (distinct tx_id) as daily_txs,
    count (distinct proposer) as daily_users,
    daily_txs/1440 as TPM,
    daily_txs/86400 as TPS,
    (daily_txs/daily_users) as tx_per_user
    from flow.core.fact_transactions
    where block_timestamp::date >= '2022-01-01'
    and block_timestamp::date <= CURRENT_DATE - 1
    group by 2
    UNION ALL

    select
    'Cosmos' as chain,
    {{timeperiod}}(block_timestamp) as dayz,
    count(distinct tx_id) as daily_txs,
    count(distinct TX_FROM) as daily_users,
    (daily_txs/1440) as TPM,
    (daily_txs/86400) as TPS,
    (daily_txs/daily_users) as tx_per_user
    from cosmos.core.fact_transactions
    where block_timestamp::date >= '2022-01-01'
    AND block_timestamp::date <= CURRENT_DATE - 1
    group by 2

    union ALL

    select 'Ethereum' as chain,
    {{timeperiod}}(block_timestamp) as dayz,
    count (distinct tx_hash) as daily_txs,
    count (distinct from_address) as daily_users,
    daily_txs/1440 as TPM,
    daily_txs/86400 as TPS,
    Run a query to Download Data