mhmTotal success rate
    Updated 2022-10-03
    with swap_data as (
    select 'Swap' as tx_type,count(tx_hash) as total_txs,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    (success/total_txs)*100 as success_rate
    from ethereum.core.fact_transactions s
    where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_swaps)
    group by 1
    ),
    lend_data as (
    select 'Lend' as tx_type, count(tx_hash) as total_txs,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    (success/total_txs)*100 as success_rate
    from ethereum.core.fact_transactions L
    where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_lending)
    group by 1
    ),

    borrow_data as (
    select 'Borrow' as tx_type, count(tx_hash) as total_txs,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    (success/total_txs)*100 as success_rate
    from ethereum.core.fact_transactions B
    where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_borrowing)
    group by 1
    ),
    liquidity_data as (
    select 'add or remove liquidity' as tx_type, count(tx_hash) as total_txs,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    (success/total_txs)*100 as success_rate
    from ethereum.core.fact_transactions A
    Run a query to Download Data