SocioCryptoPolygon vs L1: the average time between blocks
Updated 2022-07-23
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
›
⌄
SELECT rank()over(ORDER BY avg_time_diff) as rank,
rank || '-' || label as label,
avg_time_diff,
sub_label
FROM
(
SELECT 'Polygon' as label,
'Polygon' as sub_label,
avg(datediff(second, a.block_timestamp,b.block_timestamp)) as avg_time_diff
FROM polygon.core.fact_blocks a, polygon.core.fact_blocks b
WHERE a.block_number = b.block_number -1
AND a.block_timestamp::date BETWEEN current_date-{{past_days}} and current_date -1
UNION
SELECT 'Ethereum' as label,
'L1' as sub_label,
avg(datediff(second, a.block_timestamp,b.block_timestamp)) as avg_time_diff
FROM ethereum.core.fact_blocks a, ethereum.core.fact_blocks b
WHERE a.block_number = b.block_number -1
AND a.block_timestamp::date BETWEEN current_date-{{past_days}} and current_date -1
UNION
SELECT 'Solana' as label,
'L1' as sub_label,
avg(datediff(second, a.block_timestamp,b.block_timestamp)) as avg_time_diff
FROM solana.core.fact_blocks a, solana.core.fact_blocks b
WHERE a.block_id = b.block_id -1
AND a.block_timestamp::date BETWEEN current_date-{{past_days}} and current_date -1
UNION
SELECT 'BSC' as label,
'L1' as sub_label,
avg(datediff(second, a.block_timestamp,b.block_timestamp)) as avg_time_diff
FROM bsc.core.fact_blocks a, bsc.core.fact_blocks b
WHERE a.block_number = b.block_number -1
AND a.block_timestamp::date BETWEEN current_date-{{past_days}} and current_date -1
UNION
SELECT 'Avalanche' as label,
Run a query to Download Data