NavidCopy of Copy of Untitled Query
Updated 2022-12-07Copy 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 wallets as (
select
date(block_timestamp) as day,
USER_ADDRESS,
avg(balance/1e18) as amt
from
ethereum.core.fact_token_balances
where
contract_address = '0x4d224452801aced8b2f0aebe155379bb5d594381' and day>='2022-03-14' and balance>0 and day<CURRENT_DATE
group by 1,2
), wallets_labled as (
select
day,
USER_ADDRESS,
amt,
case
when amt<=10 then '10'
when amt>10 and amt<=100 then '100'
when amt>100 and amt<=1000 then '1000'
when amt>1000 and amt<=10000 then '1000'
when amt>10000 and amt<=100000 then '10000'
else '> 10000'
end as holder_type
from
wallets
)
select
day,
holder_type,
count(distinct USER_ADDRESS) as holders_cnt,
sum(amt) as sum_amt
from
wallets_labled
group by
day, holder_type
Run a query to Download Data