nitsUser Stats by Action and Symbol
Updated 2022-08-13
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
›
⌄
with w as
(SELECT symbol,sum(withdrawn_tokens) as total,sum(withdrawn_usd) as total_usd , 'withdrawn' as action
from aave.withdraws
where depositor_address = {{addr}}
GROUP by 1),
b as
(SELECT symbol,sum(borrowed_tokens) as total, sum(borrowed_usd) as total_usd, 'borrow' as action from aave.borrows
where borrower_address = {{addr}}
GROUP by 1),
d as
(SELECT symbol,sum(issued_tokens) as total,sum(supplied_usd) as total_usd, 'deposit' as action from aave.deposits
where depositor_address = {{addr}}
GROUP by 1)
,
r as
( SELECT symbol,sum(repayed_tokens) as total,sum(repayed_usd) as total_usd, 'repay' as action from aave.repayments
where borrower = {{addr}}
GROUP by 1 ),
l as
(SELECT collateral_token_symbol as symbol, sum(liquidated_amount) as total, sum(liquidated_amount_usd) as total_usd,'liquidate' as action from aave.liquidations
where borrower = {{addr}}
GROUP by 1 )
SELECT * from r
UNION ALL
SELECT * FROM b
UNION ALL
SELECT * FROM w
UNION ALL
SELECT * FROM d
UNION ALL
SELECT * from l
-- limit 100