0xHaM-dStablecoins
Updated 2023-03-02
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
›
⌄
SELECT
date_trunc('{{Time_Interval}}', BLOCK_TIMESTAMP)::date as date,
'MakerDAO' as Platform,
COUNT(DISTINCT TX_HASH) as tx_cnt,
COUNT(DISTINCT DEPOSITOR) as user_cnt,
sum(AMOUNT_DEPOSITED) as deposit_amt,
sum(tx_cnt) over (partition by Platform order by date) as cum_tx_cnt,
sum(deposit_amt) over (partition by Platform order by date) as cum_deposit_amt
FROM ethereum.maker.ez_deposits
WHERE TX_STATUS = 'SUCCESS'
AND SYMBOL ilike any ('%DAI', '%USDT', '%USDC', '%Stablecoin', '%GUSD', '%LUSD', 'PAX', 'TUSD')
AND date >= CURRENT_DATE - INTERVAL '{{Past_Weeks}} WEEK'
GROUP by 1,2
UNION ALL
SELECT
date_trunc('{{Time_Interval}}', BLOCK_TIMESTAMP)::date as date,
'AAVE' as Platform,
COUNT(DISTINCT TX_HASH) as tx_cnt,
COUNT(DISTINCT DEPOSITOR_ADDRESS) as user_cnt,
sum(SUPPLIED_USD) as deposit_amt,
sum(tx_cnt) over (partition by Platform order by date) as cum_tx_cnt,
sum(deposit_amt) over (partition by Platform order by date) as cum_deposit_amt
FROM ethereum.aave.ez_deposits
WHERE SYMBOL ilike any ('DAI', 'USDT', 'USDC', '%Stablecoin', 'GUSD', 'LUSD', 'PAX', 'TUSD')
AND date >= CURRENT_DATE - INTERVAL '{{Past_Weeks}} WEEK'
GROUP by 1,2
UNION ALL
SELECT
date_trunc('{{Time_Interval}}', BLOCK_TIMESTAMP)::date as date,
'Compound' as Platform,
COUNT(DISTINCT TX_HASH) as tx_cnt,
COUNT(DISTINCT SUPPLIER) as user_cnt,
Run a query to Download Data