SocioCryptoKPIs: Timeseries
Updated 2024-11-30
999
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 User Metrics: Timeseries @ https://flipsidecrypto.xyz/studio/queries/11b095f8-47b4-40bd-8c36-d3fd05e31307
-- forked from User Metrics: Overview @ https://flipsidecrypto.xyz/studio/queries/27f59797-88ea-427b-8c96-1dd80cdf7a5c
-- forked from DAU @ https://flipsidecrypto.xyz/studio/queries/e987dc66-23b0-4f4b-a242-8fd6b831621a
with cw_txns as (
SELECT *
FROM sei.core.fact_transactions
WHERE tx_from NOT IN (SELECT address FROM sei.core.dim_labels)
AND tx_id NOT IN ( -- remove both evm and oracle txs by doing fee = '0usei'
SELECT DISTINCT tx_id
FROM sei.core.fact_transactions
WHERE fee = '0usei'
AND block_timestamp::DATE >= current_date - interval '{{time_frame}}'
)
AND fact_transactions_id NOT IN (
SELECT DISTINCT fact_transactions_id
FROM sei.core_evm.fact_transactions)
AND block_timestamp::DATE >= current_date - interval '{{time_frame}}'
),
cw_first_txn as (
SELECT tx_from,
min(block_timestamp) as first_txn
FROM cw_txns
GROUP BY 1
),
cw_new_users as (
SELECT date_trunc('day', first_txn) as date,
zeroifnull(count(DISTINCT tx_from)) as n_new_users
--,sum(n_new_users)over(ORDER BY date) as cum_new_users
from crosschain.core.dim_dates a
LEFT JOIN cw_first_txn b
on a.date_day = date_trunc('day', b.first_txn)
GROUP by 1),
cw_active_users as (
QueryRunArchived: QueryRun has been archived