khanhTop borrower per day
    Updated 2022-09-23
    with t as (
    select
    block_timestamp::date as day,
    borrower_address,
    count(distinct(tx_hash)) as tx_num,
    sum (borrowed_usd) as total_borrowed_usd,
    row_number() over (partition by day order by total_borrowed_usd desc) as n
    from ethereum.aave.ez_borrows
    where aave_version = 'Aave V2'
    group by borrower_address, day
    qualify n = 1
    order by total_borrowed_usd desc
    limit 10
    )

    select day, borrower_address, tx_num, total_borrowed_usd from t
    Run a query to Download Data