kiacryptoDaily tx and success rate - curtain chain
    Updated 2022-12-11
    with all_chain as (
    select
    date_trunc ('day', block_timestamp) as date,
    count(distinct tx_id) as tx_count,
    (sum(iff(tx_succeeded = 'TRUE', 1, 0)) / tx_count) * 100 as success_rate,
    'Flow' as chain
    from flow.core.fact_transactions
    where date >= '2022-01-01'
    group by 1

    union all

    select
    date_trunc ('day', block_timestamp) as date,
    count(distinct tx_hash) as tx_count,
    (sum(iff(status = 'SUCCESS', 1, 0)) / tx_count) * 100 as success_rate,
    'BSC' as chain
    from bsc.core.fact_transactions
    where date >= '2022-01-01'
    group by 1

    union all

    select
    date_trunc ('day', block_timestamp) as date,
    count(distinct tx_hash) as tx_count,
    (sum(iff(status = 'SUCCESS', 1, 0)) / tx_count) * 100 as success_rate,
    'Ethereum' as chain
    from ethereum.core.fact_transactions
    where date >= '2022-01-01'
    group by 1

    union all

    select
    date_trunc ('day', block_timestamp) as date,
    Run a query to Download Data