DatafiTest Case NEXO
Updated 2023-01-30Copy 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 nexo_binance_deposit as
(SELECT
'deposit' as type,
block_timestamp::date as date,
from_address as entity,
symbol,
sum(amount) as amount,
sum(amount_usd) as usd_value
from ethereum.core.ez_token_transfers
where to_address = '0x9ec9bc7fb027448bb2670c4bd56043ea9dfd2dcc'
-- and block_timestamp >= current_date -interval '30 days'
group by 1,2,3,4
union all
SELECT
'withdraw' as type,
block_timestamp::date as date,
to_address as entity,
symbol,
sum(amount) as amount,
sum(amount_usd) as usd_value
from ethereum.core.ez_token_transfers
where from_address = '0x9ec9bc7fb027448bb2670c4bd56043ea9dfd2dcc'
-- and block_timestamp >= current_date -interval '30 days'
group by 1,2,3,4)
select
date,
symbol,
type,
count(distinct entity) as no_wallet,
sum(amount) as amount,
sum(usd_value) as usd_value
from nexo_binance_deposit
where symbol = 'NEXO'
AND date >= current_date - interval '60 days'
Run a query to Download Data