omer93Avalanche principals 6
Updated 2024-01-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
27
›
⌄
WITH
blocks as (
select
block_number,
min(block_timestamp) as block_debut,
LAG(block_debut,1) IGNORE NULLS OVER (ORDER BY block_number) as last_block_time
from avalanche.core.fact_transactions
where block_timestamp>=current_date-interval '3 months' and status='SUCCESS'
group by 1
--order by 1 asc
),
times as (
SELECT
block_number,
block_debut,
datediff('second',last_block_time,block_debut) as time_between_blocks_in_sec
from blocks
)
SELECT
trunc(block_debut,'day') as date,
avg(time_between_blocks_in_sec) as avg_time_per_block_in_sec
from times where date<current_date
group by 1
order by 1 asc
QueryRunArchived: QueryRun has been archived