adriaparcerisasNear performance: near 2
    Updated 2023-01-17
    -- Q5. How does NEAR stock up to other L1s in terms of speed and performance?
    -- How fast is NEAR,
    -- and compare it with other blockchain speeds in terms of transactions per minute and percentage of transactions that fail.

    WITH
    near as (
    Select
    block_timestamp::date as date,
    count(distinct tx_hash) as txs,
    txs/1440 as tpm
    From near.core.fact_transactions
    Where block_timestamp::date >=current_date - INTERVAL '1 MONTH'
    Group by 1
    order by 1 ASC
    ),
    near_fail as (
    Select
    block_timestamp::date as date,
    count(distinct tx_hash) as failed_txs
    From near.core.fact_transactions
    Where block_timestamp::date >=CURRENT_DATE - INTERVAL '1 MONTH'
    and tx_status<>'Success'
    Group by date
    order by date ASC
    )
    SELECT
    x.date,
    txs,
    failed_txs,
    txs-failed_txs as succeeded_txs,
    (failed_txs/txs)*100 as pcg_failed,
    (succeeded_txs/txs)*100 as pcg_succeeded
    from near x, near_fail y where x.date=y.date
    Run a query to Download Data