majahaha-xhAEhAGetting Started
    Updated 2024-12-30
    -- WITH MonthlyTransactions AS (
    -- SELECT
    -- DATE_TRUNC('month', block_timestamp) AS month, -- Group by month
    -- SUM(TX_FEE) AS total_transaction_revenue -- Sum of transaction fees
    -- FROM
    -- base.core.fact_transactions
    -- WHERE
    -- block_timestamp >= '2023-01-01' -- Adjust the date range as needed
    -- AND TX_FEE IS NOT NULL -- Ensure fees are valid
    -- AND STATUS = 'SUCCESS'
    -- GROUP BY
    -- DATE_TRUNC('month', block_timestamp) -- Group by month
    -- ORDER BY
    -- month
    -- LIMIT 100
    -- )
    -- SELECT
    -- month,
    -- total_transaction_revenue
    -- FROM
    -- MonthlyTransactions
    -- ORDER BY
    -- month;

    WITH all_chain_metrics AS (
    SELECT 'aleo' as blockchain,
    DATE_TRUNC('month', block_timestamp_hour) AS month,
    SUM(total_fees_usd) AS total_transaction_revenue,
    FROM aleo.stats.ez_core_metrics_hourly
    WHERE month >= '2023-01-01'
    GROUP BY blockchain, month

    UNION ALL

    SELECT 'aptos' as blockchain,
    DATE_TRUNC('month', block_timestamp_hour) AS month,
    QueryRunArchived: QueryRun has been archived