Tobi_1internal-brown
    Updated 2024-08-03
    WITH Daily_Transactions_Fees AS (
    SELECT
    DATE_TRUNC('DAY', BLOCK_TIMESTAMP) AS transaction_day,
    COUNT(*) AS total_transactions,
    SUM(TX_FEE) AS total_fees
    FROM
    base.core.fact_transactions
    WHERE
    BLOCK_TIMESTAMP >= DATEADD(DAY, -30, CURRENT_TIMESTAMP())
    AND BLOCK_TIMESTAMP < CURRENT_TIMESTAMP()
    GROUP BY
    transaction_day
    )
    SELECT
    transaction_day,
    total_transactions,
    total_fees
    FROM
    Daily_Transactions_Fees
    ORDER BY
    transaction_day;

    QueryRunArchived: QueryRun has been archived