nickpayiatis_balance groupings
Updated 2022-07-25
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
›
⌄
with addresses as(
select distinct address, count(*) as NFT from "FLIPSIDE_PROD_DB"."ALGORAND"."ACCOUNT_ASSET"
where (asset_id = 790226679 or asset_id = 790227414)
and amount = 1
group by address )
,group_addresses as (
select address from addresses a
where NFT = 2 )
,wallet_profile as(
select acc.address, case
when acc.balance >= 0 and acc.balance < 10 then '0-10 ALGO'
when acc.balance >= 10 and acc.balance < 100 then '10-100 ALGO'
when acc.balance >= 100 and acc.balance < 1000 then '100-1000 ALGO'
when acc.balance >= 100 and acc.balance < 1000 then '1000-10000 ALGO'
else '1000-10000 ALGO'
end as balance_group,
acc.balance as account_balance,
block.block_timestamp::Date as created_at
from group_addresses addr
left join algorand.account acc
on addr.address = acc.address
left join algorand.block block
on acc.created_at = block.block_id
where acc.address is not NULL
)
select distinct balance_group, count(*)
from wallet_profile
group by balance_group
Run a query to Download Data