Skip to content
Dune Analytics

@johaya / Fork of (#9504) Aave Liquidation Amt last 15 Days

SQL query results

Loading
 

SQL query

1SELECT sum(amt*price) as Liquidation
2FROM
3(SELECT sum("_liquidatedCollateralAmount"/10^decimals) as amt,t.symbol as token,date(evt_block_time) dt
4FROM aave."LendingPool_evt_LiquidationCall" liquidations 
5LEFT JOIN erc20."tokens" t ON liquidations."_collateral" = t.contract_address
6WHERE evt_block_time > now() - interval '15 days'
7GROUP BY 2,3)main
8LEFT JOIN 
9(select avg(price) as price,date(minute) as dt , symbol from prices.usd
10group by 2,3 ) p
11ON main.token=p.symbol and p.dt=main.dt
12
13