par_rnStellar 01
    Updated 2025-02-18
    WITH TransactionSummary AS (
    SELECT
    COUNT(*) AS total_transactions,
    COUNT(DISTINCT ACCOUNT) AS total_users
    FROM stellar.core.fact_transactions
    ),
    FeeSummary AS (
    SELECT
    SUM(FEE_CHARGED/power(10,7)) AS total_fees,
    AVG(FEE_CHARGED/power(10,7)) AS avg_fee,
    MAX(FEE_CHARGED/power(10,7)) AS max_fee
    FROM stellar.core.fact_transactions
    ),
    DailyTransactionCount AS (
    SELECT
    DATE_TRUNC('month', BLOCK_TIMESTAMP) AS transaction_date,
    COUNT(*) AS transaction_count
    FROM stellar.core.fact_transactions
    GROUP BY transaction_date
    ORDER BY transaction_date DESC
    ),
    TopAccounts AS (
    SELECT
    ACCOUNT,
    COUNT(*) AS transaction_count
    FROM stellar.core.fact_transactions
    GROUP BY ACCOUNT
    ORDER BY transaction_count DESC
    LIMIT 10
    ),
    DailyFeeSummary AS (
    SELECT
    DATE_TRUNC('month', BLOCK_TIMESTAMP) AS transaction_date,
    SUM(FEE_CHARGED/power(10,7)) AS total_fees
    FROM stellar.core.fact_transactions
    GROUP BY transaction_date