Moenearsocial txns 3
Updated 2023-09-27Copy 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
›
⌄
with
base as
( SELECT
signer_id,
min(date_trunc('day', block_timestamp)) as first_day,
count(DISTINCT tx_hash) as profile_change_events
FROM near.social.fact_addkey_events
GROUP BY 1)
select
date_trunc(month, block_timestamp)::date as month,
label_type ,
count(distinct tx_hash) txns,
row_number()over(partition by month order by txns desc) as rank
from
near.core.fact_transactions , near.core.dim_address_labels
where
TX_SIGNER in (select signer_id from base )
and
tx_receiver = address
and BLOCK_TIMESTAMP > CURRENT_DATE - 180
group by 1 ,2
qualify rank <= 3
Run a query to Download Data