Abbas_ra21Other Tokens
Updated 2023-03-08
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
›
⌄
with tb AS (select
DISTINCT BORROWER_ADDRESS AS BORROWER
from ethereum.aave.ez_borrows where SYMBOL in ('MKR') and AAVE_VERSION='Aave V2'),
tb2 AS ( SELECT
DISTINCT BORROWER_ADDRESS AS BORROWER
from ethereum.aave.ez_borrows where SYMBOL in ('SNX') and AAVE_VERSION='Aave V2' ),
tb3 AS (SELECT
DISTINCT BORROWER_ADDRESS AS BORROWER
from ethereum.aave.ez_borrows where SYMBOL in ('UNI') and AAVE_VERSION='Aave V2' )
select
'MKR' AS B_SYMBOL,
Symbol,
sum(BORROWED_USD) AS "Borrowed Amount (USD)"
from ethereum.aave.ez_borrows where AAVE_VERSION='Aave V2' and BORROWER_ADDRESS in (SELECT BORROWER from tb) and Symbol NOT in ('MKR')
group by 1,2
UNION ALL
select
'SNX' AS B_SYMBOL,
Symbol,
sum(BORROWED_USD) AS "Borrowed Amount (USD)"
from ethereum.aave.ez_borrows where AAVE_VERSION='Aave V2' and BORROWER_ADDRESS in (SELECT BORROWER from tb2) and Symbol NOT in ('SNX')
group by 1,2
UNION ALL
select
'UNI' AS B_SYMBOL,
Symbol,
sum(BORROWED_USD) AS "Borrowed Amount (USD)"
from ethereum.aave.ez_borrows where AAVE_VERSION='Aave V2' and BORROWER_ADDRESS in (SELECT BORROWER from tb3) and Symbol NOT in ('UNI')
group by 1,2
Run a query to Download Data