0xHaM-dDistribution of Users based on Avg Time between Txs
Updated 2024-10-03
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 Distribution of Users based on Avg Time between Txs copy @ https://flipsidecrypto.xyz/edit/queries/453e7b8b-9fa7-4964-be49-a7e8d92cc6db
-- forked from Distribution of Users based on Avg Time between Txs @ https://flipsidecrypto.xyz/edit/queries/2339f5f5-358a-4818-a4e9-83d28d884382
-- forked from Distribution of Users based on Avg Time between Txs @ https://flipsidecrypto.xyz/edit/queries/7df25dad-571c-4cfd-ac09-53e31da6b77c
-- forked from Distribution of Users based on Avg Time between Txs @ https://flipsidecrypto.xyz/edit/queries/7df25dad-571c-4cfd-ac09-53e31da6b77c
with txs as (
select
block_timestamp,
TX_HASH,
tx_signer
from near.core.fact_transactions
)
,
txsGap AS (
SELECT
tx_signer as User,
block_timestamp as Txs_date,
LAG(block_timestamp) OVER (
PARTITION BY User
ORDER BY
block_timestamp
) AS prev_Txs_date
FROM txs
),
txs_time as (
SELECT
User,
AVG(
DATEDIFF(hour, prev_Txs_date, Txs_date)
) AS avg_txs_gap
FROM
txsGap
WHERE
prev_Txs_date IS NOT NULL
QueryRunArchived: QueryRun has been archived