Query editor
--Aave protocol Practical--Total deposited value--Total withdraw value--Net txn flow--TVL (total value locked)--Total daily lenders--Top depositorsSELECTdate_trunc('day', block_time) as day,blockchain,project,--total deposit and withdraw valuesum(case when transaction_type = 'deposit' then amount_usd else 0 end) as total_deposit_value,sum(case when transaction_type = 'withdraw' then amount_usd else 0 end) as total_withdraw_value,--total net flowsum(case when transaction_type = 'deposit' then amount_usd when transaction_type = 'withdraw' then amount_usd else 0 end) as net_tnx_flow,--tvlsum(sum(case when transaction_type = 'deposit' then amount_usd when transaction_type = 'withdraw' then amount_usd else 0 end))over(order by date_trunc('day', block_time)) as total_value_locked,--total lenderscount(distinct depositor) as total_lendersFROM lending.supplyWHERE blockchain = 'ethereum'and project = 'aave'and version = '3'-- and transaction_type in ('deposit', 'withdraw')and block_time >= current_date - interval '365' dayGROUP BY 1, 2, 3ORDER BY 1 desc