kitlunaFlow Performance
    Updated 2022-07-19
    SELECT
    c."date",
    c.all_transactions,
    c.successful_transactions,
    c.all_transactions - c.successful_transactions AS failed_transaction,
    100 - (c.successful_transactions / c.all_transactions * 100) AS "Failed Transactions Percentage"
    FROM (
    WITH transactions AS (
    SELECT
    BLOCK_TIMESTAMP::date AS "date",
    ROUND (COUNT (DISTINCT TX_ID) / 1440) AS all_transactions
    FROM flow.core.fact_transactions
    GROUP BY "date"
    ),
    s_transactions AS (
    SELECT
    BLOCK_TIMESTAMP::date AS "date",
    ROUND (COUNT (DISTINCT TX_ID) / 1440) AS successful_transactions
    FROM flow.core.fact_transactions
    WHERE TX_SUCCEEDED = 'TRUE'
    GROUP BY "date"
    )
    SELECT
    a."date",
    a.all_transactions,
    b.successful_transactions
    FROM transactions a
    LEFT JOIN s_transactions b
    ON a."date" = b."date" ) c
    ORDER BY "date"
    Run a query to Download Data