bachifail txn2
    Updated 2022-10-03
    SELECT 'adding or removing liquidity' as label,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as succ,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    round(100*(succ/(fail+succ)),2) as success_rate,
    round(100*(fail/(fail+succ)),2) as failure_rate
    FROM ethereum.core.fact_transactions
    WHERE (from_Address in (
    SELECT pool_address
    FROM ethereum.core.dim_dex_liquidity_pools
    WHERE platform ilike 'sushiswap') OR
    to_address in (
    SELECT pool_address
    FROM ethereum.core.dim_dex_liquidity_pools
    WHERE platform ilike 'sushiswap'))
    AND tx_hash not IN (SELECT tx_hash
    FROM ethereum.sushi.ez_lending)
    AND tx_hash not IN (SELECT tx_hash
    FROM ethereum.sushi.ez_borrowing)
    AND tx_hash not IN (SELECT tx_hash
    FROM ethereum.sushi.ez_swaps)
    UNION
    SELECT 'Swap' as label,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as succ,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    100*(succ/(fail+succ)) as success_rate,
    round((100-success_rate),2) as failure_rate
    FROM ethereum.core.fact_transactions
    WHERE origin_function_signature in (
    SELECT DISTINCT origin_function_signature
    FROM ethereum.sushi.ez_swaps)
    UNION
    SELECT 'Borrowing' as label,
    count(CASE WHEN status = 'SUCCESS' THEN 1 end) as succ,
    count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
    100*(succ/(fail+succ)) as success_rate,
    round((100-success_rate),2) as failure_rate
    Run a query to Download Data