ML6Transaction success rates op7
    Updated 2022-09-08
    with flow_count as (select count(*) as total ,block_timestamp::date as dt from flow.core.fact_transactions
    where block_timestamp::date>= '2022-06-15'
    group by 2)
    ,flow_success as (select count(*) as success ,block_timestamp::date as dt from flow.core.fact_transactions
    where block_timestamp::date>= '2022-06-15' and TX_SUCCEEDED=1
    group by 2)
    , solana_count as (select count(*) as total ,block_timestamp::date as dt from flipside_prod_db.solana.fact_transactions
    where block_timestamp::date>= '2022-06-15'
    group by 2
    )
    , solana_success as (select count(*) as success ,block_timestamp::date as dt from flipside_prod_db.solana.fact_transactions
    where block_timestamp::date>= '2022-06-15' and SUCCEEDED=1
    group by 2)
    , eth_count as (select count(*) as total ,block_timestamp::date as dt from flipside_prod_db.ethereum_core.fact_transactions
    where block_timestamp::date>= '2022-06-15'
    group by 2)
    , eth_success as (select count(*) as success ,block_timestamp::date as dt from flipside_prod_db.ethereum_core.fact_transactions
    where block_timestamp::date>= '2022-06-15' and STATUS='SUCCESS'
    group by 2)
    ,Optimism_count as (select count(*) as total ,block_timestamp::date as dt from optimism.core.fact_transactions
    where block_timestamp::date>='2022-06-15'
    group by 2)
    , Optimism_success as (select count(*) as success ,block_timestamp::date as dt from optimism.core.fact_transactions
    where block_timestamp::date>='2022-06-15' and STATUS='SUCCESS'
    group by 2)

    select success/total*100 as success_rate ,flow_count.dt as date, 'Flow : success rates' as lbl from flow_count inner join flow_success
    on flow_count.dt=flow_success.dt

    UNION

    select success/total*100 as success_rate , eth_count.dt as date,'Ethereum : success rates' as lbl from eth_count inner join eth_success
    on eth_count.dt=eth_success.dt

    UNION

    Run a query to Download Data