feyikemi2024-04-17 12:32 AM
    Updated 2024-07-20
    With Transactions as (
    SELECT
    Date_trunc('day', block_timestamp) Date,
    Count(DISTINCT tx_id) Txns,
    Tx_succeeded
    FROM sei.core.fact_transactions
    WHERE block_timestamp :: date > current_date - 30
    GROUP BY 1, 3
    ORDER BY 1 DESC
    )

    SELECT
    --Date_trunc('day', block_timestamp) Date,
    Date,
    Txns,
    'Succeeded' as Type
    FROM Transactions
    WHERE Tx_succeeded = 'True'
    --GROUP BY Date, Type

    UNION ALL

    SELECT
    --Date_trunc('day', block_timestamp) Date,
    Date,
    Txns,
    'Failed' as Type
    FROM Transactions
    WHERE Tx_succeeded = 'False'
    --GROUP BY Date, Type
    QueryRunArchived: QueryRun has been archived