adriaparcerisasPolygon TPS comparison
    Updated 2022-07-08
    -- Show the average TPS per second by hour.
    -- What's the average number of transactions per block? What's the max number of transactions we've seen in a block and the minimum?-
    -- 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 as (
    select
    trunc(block_timestamp,'day') as date,
    count(distinct tx_hash) as txs,
    txs/84600 as tps
    from polygon.core.fact_transactions
    where block_timestamp>CURRENT_DATE- INTERVAL '1 MONTH' and status='SUCCESS'
    group by 1
    order by 1 asc
    ),
    avx as (
    select
    trunc(block_timestamp,'day') as date,
    count(distinct tx_hash) as txs,
    txs/84600 as tps
    from avalanche.core.fact_transactions
    where block_timestamp> CURRENT_DATE- INTERVAL '1 MONTH' and status='SUCCESS'
    group by 1
    order by 1 asc
    ),
    optimism as (
    select
    trunc(block_timestamp,'day') as date,
    count(distinct tx_hash) as txs,
    txs/84600 as tps
    from optimism.core.fact_transactions where block_timestamp > CURRENT_DATE - INTERVAL '1 MONTH' and status='SUCCESS'
    group by 1
    order by 1 asc
    ),
    arbitrum as (
    Run a query to Download Data