sakineh5021-nIQRzBUntitled Query
Updated 2022-04-18
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 USDC_daily as (
SELECT balance_date , sum(balance) as TVL
from ethereum.erc20_balances B
where balance_date >= '2022-01-01'
and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
and symbol like '%/USDC-LINK'
group by 1)
,
DAI_daily as (
SELECT balance_date , sum(balance) as TVL
from ethereum.erc20_balances B
where balance_date >= '2022-01-01'
and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
and symbol like '%/DAI-LINK'
group by 1)
,
USDT_daily as (
SELECT balance_date , sum(balance) as TVL
from ethereum.erc20_balances B
where balance_date >= '2022-01-01'
and user_address <> '0x82ccea8020dde8df2932f6920c39e1259ff5eea1'
and user_address <> '0xad492e78ea607f1ccf1cefaa7ee37871932b1d02'
and user_address <> '0x8c654ea010cfb5312fc711f05cde3d91a7a8ddbe'
and symbol like '%/USDT-LINK'
group by 1)
SELECT C.balance_date , sum(D.TVL) as DAI , sum(C.TVL) as USDC , sum(T.TVL) as USDT
from USDC_daily C , USDT_daily T , DAI_daily D
Run a query to Download Data