Alexayusd donut
Updated 2022-09-18Copy 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 compound as ( select count (distinct tx_hash) as txns,
count (distinct redeemer) as users, sum (received_amount) as volume, sum (received_amount_usd) as volume_usd
from ethereum.compound.ez_redemptions
where received_contract_symbol ilike '%ETH%'
and block_timestamp >= '2022-06-01'
and block_number <= 15537393 --last block mined.
),
makerdao as ( with price as ( select date_trunc('day',HOUR) as day , avg(price) as eth_price
from ethereum.core.fact_hourly_token_prices
where SYMBOL = 'WETH'
group by 1 )
select count(distinct a.tx_hash) as txns,
count(distinct a.withdrawer) as users, sum(a.amount_withdrawn) as volume,
sum(amount_withdrawn * p.eth_price) as volume_usd
from ethereum.maker.ez_withdrawals a
join price p on p.day = a.block_timestamp::date
where symbol ilike '%ETH%'
and a.block_timestamp >= '2022-06-01'
and tx_status = 'SUCCESS'
and block_number <= 15537393 --last block mined.
),
aave as ( select count (distinct tx_hash) as txns,
count (distinct depositor_address) as users,sum (withdrawn_tokens) as volume,
sum (withdrawn_usd) as volume_usd
from ethereum.aave.ez_withdraws
where symbol ilike '%ETH%'
and block_timestamp >= '2022-06-01'
and withdrawn_tokens>0
Run a query to Download Data