DeFi_reindsAave collaterals at block 13532886 (amount approximate)
Updated 2022-03-03Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with deposits as (select block_timestamp,
symbol,
aave_token as token_address,
issued_tokens as amount
from aave.deposits
where lending_pool_contract = '0x0000006daea1723962647b7e189d311d757fb793'
and block_id <= '13532886'),
withdraws as (select block_timestamp,
symbol,
aave_token as token_address,
(-1) * withdrawn_tokens as amount
from aave.withdraws
where depositor_address = '0x0000006daea1723962647b7e189d311d757fb793' -- wintermute smart contract address
and block_id <= '13532886'),
collaterals as (select * from deposits
union all
select * from withdraws
order by block_timestamp, token_address),
final_table as (select symbol,
token_address,
sum(amount) as amount
from collaterals
group by symbol, token_address)
select * from final_table
where amount > 0
and symbol != 'USDT' -- not accepted as collateral
order by symbol
--select date_trunc('day', block_timestamp) as date,
-- symbol,
-- token_address,
Run a query to Download Data