0-MIDcompare borrow count
    Updated 2023-04-13
    with tab1 as(
    select date_trunc('month',BLOCK_TIMESTAMP)as month,count(distinct TX_HASH)as borrow_count
    , case
    when month>='2019-05-01'and month<'2020-01-01' then '2019'
    when month>='2020-01-01'and month<'2021-01-01' then '2020'
    when month>='2021-01-01'and month<'2022-01-01' then '2021'
    when month>='2020-01-01' then '2022' end as time_period
    from ethereum.compound.ez_borrows
    where month>='2019-05-01'
    group by 1
    order by 1)
    select sum(borrow_count)as cum_borrow_count,time_period
    , avg(borrow_count)as daily_avg_borrow_count
    from tab1
    group by 2
    Run a query to Download Data