with tab1 as (
select BLOCK_TIMESTAMP::date as date,BORROWER,sum(LOAN_AMOUNT_USD) as borrow_amount
from ethereum.compound.ez_borrows
where LOAN_AMOUNT_USD is not null
group by 1,2)
select BORROWER, borrow_amount,rank()over(order by borrow_amount)as rank
from tab1
group by 1,2
order by 2 desc
limit 10