ZSaed2.3 follower and following Top Users followers
Updated 2023-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
›
⌄
-- forked from 1c5940ca-503f-4ee4-ad51-4fbacbfa2a58
-- forked from 82a63486-4271-4702-a3cb-42405cb9a440
with flat as (
with reg as (
select a.*, parse_json(REGEXP_REPLACE(NODE_DATA,'null','"unfollow"')) as data from
near.social.fact_decoded_actions a
INNER join near.core.fact_transactions b on a.tx_hash = b.tx_hash and b.TX_STATUS ='Success'
where NODE ='graph'
and NODE_DATA:follow is not null
)
select
*
from reg,
table(
FLATTEN( INPUT =>data:follow)
)
-- where NODE ='graph'
-- and NODE_DATA:follow is not null
)
, follow as (
select SIGNER_ID,key, max(BLOCK_TIMESTAMP) as date from flat
where value !='unfollow'
-- and SIGNER_ID= 'manzanal.near'
group by SIGNER_ID,key
)
,unfollow as
(
select SIGNER_ID,key, max(BLOCK_TIMESTAMP) as date from flat
where value ='unfollow'
-- and SIGNER_ID= 'manzanal.near'
group by SIGNER_ID,key
)
,abslot_unfollow as (
Run a query to Download Data