HadisehTotal
    Updated 2025-02-28
    WITH daily_metrics AS (
    SELECT
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS transaction_day,
    COUNT(DISTINCT TX_HASH) AS daily_tx_count,
    COUNT(DISTINCT FROM_ADDRESS) AS daily_user_count,
    SUM(TX_FEE) AS daily_fee_total
    FROM boba.core.fact_transactions
    GROUP BY 1
    ),
    monthly_metrics AS (
    SELECT
    DATE_TRUNC('month', BLOCK_TIMESTAMP) AS transaction_month,
    COUNT(DISTINCT TX_HASH) AS monthly_tx_count,
    COUNT(DISTINCT FROM_ADDRESS) AS monthly_user_count,
    SUM(TX_FEE) AS monthly_fee_total
    FROM boba.core.fact_transactions
    GROUP BY 1
    ),
    user_first_tx AS (
    SELECT
    FROM_ADDRESS AS user_address,
    MIN(BLOCK_TIMESTAMP) AS first_transaction_date
    FROM boba.core.fact_transactions
    GROUP BY 1
    ),
    user_activity AS (
    SELECT
    uft.user_address,
    DATE_TRUNC('day', uft.first_transaction_date) AS cohort_period,
    COUNT(DISTINCT DATE_TRUNC('day', t.BLOCK_TIMESTAMP)) AS active_day_count,
    MAX(DATEDIFF('day', uft.first_transaction_date, t.BLOCK_TIMESTAMP)) AS retention_days
    FROM user_first_tx uft
    JOIN boba.core.fact_transactions t
    ON uft.user_address = t.FROM_ADDRESS
    GROUP BY 1, 2
    ),
    Last run: 21 days ago
    TOTAL_TX_COUNT
    TOTAL_USER_COUNT
    AVG_DAILY_TX
    AVG_MONTHLY_TX
    PEAK_DAILY_TX
    AVG_DAILY_USERS
    AVG_MONTHLY_USERS
    AVG_TX_FEE
    TOTAL_FEES
    TX_GROWTH_RATE
    USER_GROWTH_RATE
    AVG_TX_PER_USER
    1
    152871463771012540.726825372857.21951263465159.9655461755.048780.000072478131431107.98384943891878.2608739257.142857124.038491513536
    1
    147B
    6s