zionhaleyFT_swap
    Updated 2022-10-03
    with failed_txn as (select date(block_timestamp) as date,
    count (distinct tx_hash) as number_failed_txn
    from ethereum.core.fact_transactions
    where STATUS ilike 'FAIL' and origin_function_signature in (select origin_function_signature
    from ((select distinct origin_function_signature from ethereum.sushi.ez_swaps)))
    and date >= CURRENT_DATE - {{past_days}} and date <= CURRENT_DATE-1
    group by 1),
    all_txn as (select date(block_timestamp) as date1,
    count (distinct tx_hash) as number_all_txn
    from ethereum.core.fact_transactions
    where origin_function_signature in (select origin_function_signature
    from ((select distinct origin_function_signature from ethereum.sushi.ez_swaps)))
    and date1 >= CURRENT_DATE - {{past_days}} and date1 <= CURRENT_DATE-1
    group by 1)
    select date, number_failed_txn, number_all_txn,
    number_failed_txn*100/number_all_txn as percentage_of_failed_txn
    from failed_txn, all_txn where date = date1

    Run a query to Download Data