Abolfazl_771025Deposit & withdraw
Updated 2023-03-03
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
›
⌄
with deposit as (select
date_trunc('week',block_timestamp) as date,
'Deposit' as action,
b.symbol,
count(DISTINCT tx_hash) as tx_count,
count(DISTINCT DEPOSITOR) as user_count,
sum(AMOUNT_DEPOSITED * price) as action_volume
from ethereum.maker.ez_deposits a join ethereum.core.fact_hourly_token_prices b on a.block_timestamp::date=b.hour::date and token_address = TOKEN_DEPOSITED
where TX_STATUS = 'SUCCESS'
and block_timestamp >= '2022-01-01'
group by 1,2,3
), withdraw as (select
date_trunc('week',block_timestamp) as date,
'Withdraw' as action,
b.symbol,
count(DISTINCT tx_hash) as tx_count,
count(DISTINCT WITHDRAWER) as user_count,
sum(AMOUNT_WITHDRAWN * price) as action_volume
from ethereum.maker.ez_withdrawals a join ethereum.core.fact_hourly_token_prices b on a.block_timestamp::date=b.hour::date and token_address = TOKEN_WITHDRAWN
where TX_STATUS = 'SUCCESS'
and block_timestamp >= '2022-01-01'
group by 1,2,3)
select
*
from deposit
union
select
*
from withdraw
Run a query to Download Data