adriaparcerisasPolygon time per block comparison
Updated 2023-04-13
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
›
⌄
-- Show the average time between blocks over time
-- Show transaction gas price over time.
-- Note any other interesting findings about the number of transactions, blocks, or gas for the Avalanche blockchain!
WITH
poly_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 polygon.core.fact_transactions
where block_timestamp>CURRENT_DATE-INTERVAL '1 MONTH' and status='SUCCESS'
group by 1
--order by 1 asc
),
poly_times as (
SELECT
block_number,
block_debut,
datediff('second',last_block_time,block_debut) as time_between_blocks_in_sec
from poly_blocks
),
poly as (
SELECT
trunc(block_debut,'day') as date,
avg(time_between_blocks_in_sec) as avg_time_per_block_in_sec
from poly_times
group by 1
order by 1 asc
),
optimism_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 optimism.core.fact_transactions
where block_timestamp>CURRENT_DATE-INTERVAL '1 MONTH' and status='SUCCESS'
Run a query to Download Data