select date_trunc('day',t) as date,collateral_token_symbol, COLLATERAL_TOKEN_PRICE,
count(borrower), sum(liquidated_amount), sum(liquidated_amount_usd)
from (select block_timestamp as t,borrower, collateral_token_symbol,COLLATERAL_TOKEN_PRICE, liquidated_amount, liquidated_amount_usd
from aave.liquidations
where block_timestamp>='2021-11-01'
)
where collateral_token_symbol is not null
group by 1,2,3 order by 1