Afonso_Diazaave-borrow-6
    Updated 2023-03-09
    with t as (
    select
    borrower_address as borrower,
    count(distinct block_timestamp::date) as active_days
    from ethereum.aave.ez_borrows
    where aave_version = 'Aave V2'
    and symbol in ('SNX')
    group by 1
    )

    select
    case
    when active_days = 1 then '1 Day'
    when active_days = 2 then '2 Days'
    when active_days = 3 then '3 Days'
    when active_days = 4 then '4 Days'
    when active_days = 5 then '5 Days'
    when active_days = 6 then '6 Days'
    when active_days = 7 then '7 Days'
    when active_days = 8 then '8 Days'
    when active_days = 9 then '9 Days'
    when active_days = 10 then '10 Days'
    when active_days = 11 then '11 Days'
    when active_days = 12 then '12 Days'
    when active_days = 13 then '13 Days'
    when active_days = 14 then '14 Days'
    else 'More than 14 Days'
    end as type,
    count(distinct borrower) as borrowers
    from t
    group by 1
    Run a query to Download Data