hessNew Users Balance
Updated 2023-01-11Copy 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 user as ( select min(block_timestamp) as date, sender as user
from terra.core.ez_transfers
group by 2
UNION
select min(block_timestamp) as date, receiver as user
from terra.core.ez_transfers
group by 2)
,
new_user as ( select DISTINCT user
from user
where date >= CURRENT_DATE - 60)
,
sender as (select receiver as user , sum(amount/pow(10,6)) as amounts
from terra.core.ez_transfers
where receiver in (select user from new_user)
and currency = 'uluna'
group by 1
UNION
select sender as user, sum(amount/pow(10,6))*-1 as amounts
from terra.core.ez_transfers
where sender in (select user from new_user)
and currency = 'uluna'
group by 1)
select count(DISTINCT(user)) as total,
case when amounts <= 1 then 'Up to 1 Luna'
when amounts <= 10 then '1-10 Luna'
when amounts <= 100 then '10-100 Luna'
when amounts <= 500 then '100-500 Luna'
when amounts <= 1000 then '500-1K Luna'
when amounts <= 5000 then '1K-5K Luna'
when amounts <= 10000 then '10K Luna'
when amounts > 10000 then '+10K Luna' end as types
from sender
where amounts > 0
Run a query to Download Data