sallarNEAR Performance, percentage of failed and successful transactions Flow
    Updated 2022-07-20
    with initial_data_one as
    (
    select
    date_trunc(second, block_timestamp) as seconds,
    case
    when substr(tx_receipt[0]:outcome:status ,3 ,7) = 'Success' then count(distinct txn_hash)
    end as successful,
    case
    when substr(tx_receipt[0]:outcome:status ,3 ,7) != 'Success' then count(distinct txn_hash)
    end as failure,
    count(distinct txn_hash) as transactions_per_second
    from mdao_near.transactions
    where block_timestamp::date >= CURRENT_DATE - 30
    group by seconds, tx_receipt
    ),
    initial_data_two as
    (
    select
    date_trunc(second, block_timestamp) as seconds,
    case
    when status = 'SUCCESS' then count(distinct tx_hash)
    end as successful,
    case
    when status != 'SUCCESS' then count(distinct tx_hash)
    end as failure,
    count(distinct tx_hash) as transactions_per_second
    from ethereum.core.fact_transactions
    where block_timestamp::date >= CURRENT_DATE - 30
    group by seconds, status
    ),
    initial_data_three as
    (
    select
    date_trunc(second, block_timestamp) as seconds,
    case
    when tx_succeeded = true then count(distinct tx_id)
    Run a query to Download Data