banbannardFailure Rate on Sushiswap 4
    Updated 2022-10-02
    with kashi as
    (select contract_address
    from ethereum.core.fact_event_logs
    where contract_name ilike '%kashi%'
    union
    select origin_to_address
    from ethereum.core.fact_event_logs
    where contract_name ilike '%kashi%'
    union
    select
    lending_pool_address
    from ethereum.sushi.ez_lending
    union
    select
    lending_pool_address
    from ethereum.sushi.ez_borrowing),

    base as (select
    split(text_signature, '(')[0]::string as event_name,
    case
    when event_name ilike 'LogAddAsset%' then 'Add Asset to Bentobox'
    when event_name ilike 'LogRemoveAsset%' then 'Remove Asset from Bentobox'
    when event_name ilike 'adda%' then 'Add Collateral'
    when event_name ilike 'RemoveCollateral%' then 'Remove Collateral'
    when event_name ilike 'Removeasset%' then 'Remove Collateral'
    when event_name ilike 'Borrow%' then 'Borrow Assets'
    when event_name ilike 'lend%' then 'Lend Assets'
    when event_name ilike 'repay%' then 'Repay Loans'
    when event_name ilike 'Mint%' then 'Add Liquidity'
    when event_name ilike 'Addl%' then 'Add Liquidity'
    when event_name ilike 'Burn%' then 'Remove Liquidity'
    when event_name ilike 'Removel%' then 'Remove Liquidity'
    when event_name ilike 'Swap%' then 'Swapping'
    when event_name ilike 'accrue%' then 'Accrue'
    when event_name ilike 'cook%' then 'Deposit to Bentobox'
    else 'no'
    Run a query to Download Data