maybeyonasanc_claim_power_users
Updated 2022-02-08
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
›
⌄
with anc_claims as (
select
block_timestamp,
tx_id,
event_attributes:to::string as user,
event_attributes:claim_amount/pow(10,6) as anc_claimed
from terra.msg_events
where
tx_status = 'SUCCEEDED'
and event_type = 'from_contract'
and event_attributes:from::string = 'terra1mxf7d5updqxfgvchd7lv6575ehhm8qfdttuqzz'
and event_attributes:claim_amount is not null
),
total_claimed as (
select
user,
count(tx_id) as claims,
sum(anc_claimed) as anc_claimed
from anc_claims
where anc_claimed is not null
group by 1
),
big_users as (
select *
from total_claimed
where anc_claimed > 100000
)
select * from big_users
order by anc_claimed desc
Run a query to Download Data