binhachonGetting Your Feet Wet, Part 2 - Protocols with stats - Users
Updated 2022-03-06
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 address_list as (
select
address,
address_name,
label_type,
label_subtype,
label
from terra.labels
-- where (label_type in ('dapp', 'defi', 'dex', 'layer2') or label_subtype = 'marketplace')
-- and label_subtype not in ('token_contract', 'pool')
),
new_user_list as (
select
block_timestamp,
tx_from,
row_number() over (partition by tx_from order by block_id) as rank
from terra.transactions
where tx_from[1] is null
qualify rank = 1
),
small_sample as (
select
*
from terra.transactions
where block_timestamp > getdate() - interval'30 days'
and tx_from in (select tx_from from new_user_list where block_timestamp > getdate() - interval'30 days')
),
final_table as (
select
address,
address_name,
label_type,
label_subtype,
label,
tx_id,
tx_from
Run a query to Download Data