rezarwzCOMPARE NEAR'S BLOCK
    Updated 2022-07-19
    select
    avg(abs(period)) as average_sec, --its per seconds
    max(abs(period)) as max_sec,
    min(abs(period)) as min_sec,
    'Near' as blockchain
    from (
    SELECT
    distinct BLOCK_HEIGHT,
    block_timestamp,
    LAG(block_timestamp) IGNORE NULLS OVER (ORDER BY BLOCK_HEIGHT) as last_block_timestamp,
    datediff(SECOND,block_timestamp,last_block_timestamp) as period
    from flipside_prod_db.mdao_near.blocks
    order by block_timestamp asc
    )
    UNION
    select
    avg(abs(period)) as average_sec, --in seconds
    max(abs(period)) as max_sec,
    min(abs(period)) as min_sec,
    'Ethereum' as blockchain
    from (
    SELECT
    distinct BLOCK_NUMBER,
    block_timestamp,
    LAG(block_timestamp) IGNORE NULLS OVER (ORDER BY BLOCK_NUMBER) as last_block_timestamp,
    datediff(SECOND,block_timestamp,last_block_timestamp) as period
    from ethereum.core.fact_blocks
    order by block_timestamp asc
    )
    UNION
    select
    avg(abs(period)) as average_sec, --in seconds
    max(abs(period)) as max_sec,
    min(abs(period)) as min_sec,
    'Binance Smart Chain' as blockchain
    from (
    Run a query to Download Data