RamaharSuccess/Fail Rate
    Updated 2022-12-11
    With tx_table as (select
    'FLOW' as chain,
    {{timeperiod}}(block_timestamp) as time,
    count (case when tx_succeeded != 'TRUE' then 1 end) as failed_txs,
    count (case when tx_succeeded = 'TRUE' then 1 end) as success_txs,
    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'
    group by 2
    UNION ALL

    select
    'Cosmos' as chain,
    {{timeperiod}}(block_timestamp) as time,
    count (case when tx_succeeded != 'TRUE' then 1 end) as failed_txs,
    count (case when tx_succeeded = 'TRUE' then 1 end) as success_txs,
    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'
    group by 2

    union ALL

    select 'Ethereum' as chain,
    {{timeperiod}}(block_timestamp) as time,
    count (case when status != 'SUCCESS' then 1 end) as failed_txs,
    count (case when status = 'SUCCESS' then 1 end) as success_txs,
    Run a query to Download Data