adriaparcerisassushi adding and removing liquidity failure
    Updated 2023-04-06
    with
    t1 as (
    SELECT pool_address
    FROM ethereum.core.dim_dex_liquidity_pools
    WHERE platform = 'sushiswap'
    ),
    t3 as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    count(case when status = 'SUCCESS' then 1 end) as succeed_tx,
    count(case when status = 'FAIL' then 1 end) as failed_tx,
    (failed_tx/(failed_tx+succeed_tx))*100 as failed_rate,
    count(distinct tx_hash) as n_transactions
    FROM ethereum.core.fact_transactions
    WHERE (from_address in (select * from t1) or to_address in (select * from t1))
    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)
    GROUP BY 1
    )
    select * from t3 where date >=CURRENT_DATE-INTERVAL'{{number_months}} MONTHS'
    Run a query to Download Data