with base as (select
borrower,
min(block_timestamp) as first_tx
from ethereum.maker.ez_flash_loans
where tx_status = 'SUCCESS'
group by 1)
select date_trunc('{{time}}', first_tx) as first_tx_date,
count(distinct(borrower)) as count_new_borrower,
sum(count_new_borrower) over (order by first_tx_date) as cumulative_count_new_borrower
from base
group by 1
order by 1 desc