kiacryptoBlock time, TPB
Updated 2023-01-11Copy Reference Fork
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
›
⌄
with block as (
select block_timestamp,
lead(block_timestamp) over(order by block_id) as next_block_time,
datediff('s',block_timestamp,next_block_time) as diff,
tx_count
from near.core.fact_blocks
),
info as (
select
date_trunc('day', block_timestamp) as "Day",
avg(diff) as "block time",
avg(tx_count) as "TPB"
from block
where "Day" between '2022-07-01' and '2022-09-30'
group by 1
),
avg_info as (
select
avg("block time") as "AVG block time",
avg("TPB") as "AVG TPB"
from info
)
select *
from info, avg_info
order by "Day"
Run a query to Download Data