0xHaM-dSocial Profiles & Wallet's Age
Updated 2023-06-10
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
›
⌄
with createTb as (
select
signer_id,
min(block_timestamp)::date as creation_date
from near.social.fact_profile_changes
join near.core.fact_transactions using(tx_hash)
where tx_status = 'Success'
group by signer_id
)
, monthTb as (
SELECT
signer_id,
monthname(creation_date) as months
FROM createTb
WHERE months in ('{{Birthday_Month}}') -- Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
)
SELECT
signer_id as "Account",
min(block_timestamp)::date as first_tx,
max(block_timestamp)::date as last_tx,
datediff('day', first_tx, last_tx) as age_wallet
FROM near.core.fact_transactions JOIN monthTb on TX_SIGNER = signer_id
GROUP by 1
ORDER by 4 DESC
Run a query to Download Data