zyroqminiature-tomato
Updated 2025-01-28
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 daily_activity AS (
SELECT
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS activity_date,
FROM_ADDRESS AS user_address,
TX_HASH AS transaction_hash,
BLOCK_TIMESTAMP
FROM
avalanche.core.fact_transactions
WHERE
activity_date >= '2024-12-16 17:00:00.000' -- after upgrade
),
user_classification AS (
SELECT
user_address,
MIN(BLOCK_TIMESTAMP) AS first_txn_timestamp
FROM
daily_activity
GROUP BY
user_address
),
new_user_transactions AS (
SELECT
da.user_address,
da.transaction_hash AS first_txn_hash,
da.BLOCK_TIMESTAMP AS first_txn_timestamp
FROM
daily_activity da
INNER JOIN
user_classification uc
ON
da.user_address = uc.user_address
AND da.BLOCK_TIMESTAMP = uc.first_txn_timestamp
),
contract_addresses AS (
SELECT
nut.user_address,
QueryRunArchived: QueryRun has been archived