TheLaughingManNEAR Old vs NEW
Updated 2024-10-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
›
⌄
with base_wallets as (
SELECT
TX_SIGNER as wallet,
MIN(date_trunc('day', block_timestamp)) as min_date
from near.core.fact_transactions
WHERE
block_timestamp >= '2021-11-01' -- Extra Time to store up wallets
GROUP BY wallet
),
new_txns as (
SELECT
COUNT(TX_HASH) as totals,
TX_SIGNER as wallet,
date_trunc('day', block_timestamp) as ddate,
CASE WHEN ddate>min_date THEN 'old' ELSE 'new' END as cat
from near.core.fact_transactions t
LEFT JOIN base_wallets b ON t.TX_SIGNER = b.wallet
WHERE
block_timestamp >= '2023-01-01'
GROUP BY ddate, TX_SIGNER, cat
)
SELECT
COUNT(DISTINCT wallet) as total_wallets,
ddate,
cat
from new_txns
GROUP BY ddate,cat ORDER BY ddate
QueryRunArchived: QueryRun has been archived