hyoeisemanFailed Transactions_weekly data
    Updated 2022-10-03
    with swap as (select 'Swap' as type,
    date_trunc('week', block_timestamp) as week,
    count (case when STATUS ilike 'fail' then 1 end) as count_failed_txn,
    count (case when STATUS ilike 'success' then 1 end) as count_successful_txn,
    count_failed_txn + count_successful_txn as total_transaction,
    count_failed_txn*100/total_transaction as failure_percentage
    from ethereum.core.fact_transactions
    where week >= CURRENT_DATE - {{past_weeks}} and week <= CURRENT_DATE-1
    and origin_function_signature in (select distinct origin_function_signature from ethereum.sushi.ez_swaps)
    group by type, week),
    borrow as (select 'borrow' as type, date_trunc('week', block_timestamp) as week,
    count (case when STATUS ilike 'fail' then 1 end) as count_failed_txn,
    count (case when STATUS ilike 'success' then 1 end) as count_successful_txn,
    count_failed_txn + count_successful_txn as total_transaction,
    count_failed_txn*100/total_transaction as failure_percentage
    from ethereum.core.fact_transactions
    where week >= CURRENT_DATE - {{past_weeks}} and week <= CURRENT_DATE-1
    and origin_function_signature in (select distinct origin_function_signature from ethereum.sushi.ez_borrowing)
    group by type, week),
    lend as (select 'lend' as type,
    date_trunc('week', block_timestamp) as week,
    count (case when STATUS ilike 'fail' then 1 end) as count_failed_txn,
    count (case when STATUS ilike 'success' then 1 end) as count_successful_txn,
    count_failed_txn + count_successful_txn as total_transaction,
    count_failed_txn*100/total_transaction as failure_percentage
    from ethereum.core.fact_transactions
    where week >= CURRENT_DATE - {{past_weeks}} and week <= CURRENT_DATE-1
    and origin_function_signature in (select distinct origin_function_signature from ethereum.sushi.ez_lending)
    group by type, week),
    tem_tab as (select distinct pool_address from ethereum.core.dim_dex_liquidity_pools where platform ilike 'sushiswap'),
    add_remove_liq as ( select 'add_remove_liquidity' as type,
    date_trunc('week', block_timestamp) as week,
    count (case when STATUS ilike 'fail' then 1 end) as count_failed_txn,
    count (case when STATUS ilike 'success' then 1 end) as count_successful_txn,
    count_failed_txn + count_successful_txn as total_transaction,
    count_failed_txn*100/total_transaction as failure_percentage
    Run a query to Download Data