SocioCryptosuccess rate per action - all time
    Updated 2022-10-01
    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,
    100*(succ/(fail+succ)) as success_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
    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
    FROM ethereum.core.fact_transactions
    WHERE origin_function_signature in (
    SELECT DISTINCT origin_function_signature
    Run a query to Download Data