yasmin1 OVERVIEW
    Updated 2025-05-02
    WITH deploy_contracts AS (
    SELECT
    created_block_timestamp::date AS day,
    COUNT(DISTINCT address) AS Contracts
    FROM avalanche.core.dim_contracts
    WHERE
    created_block_timestamp::date >= CURRENT_DATE - INTERVAL '90 days'
    GROUP BY created_block_timestamp::date
    ),
    user_first_tx AS (
    SELECT
    from_address,
    MIN(block_timestamp::date) AS first_tx_date
    FROM avalanche.core.fact_transactions
    GROUP BY from_address
    ),
    daily_metrics AS (
    SELECT
    t.block_timestamp::date AS Date,
    COUNT(DISTINCT t.tx_hash) AS Transactions,
    COUNT(DISTINCT t.from_address) AS Users,
    SUM(t.tx_fee * p.price) AS Fees,
    AVG(t.tx_fee * p.price) AS Avg_Fee
    FROM avalanche.core.fact_transactions t
    JOIN avalanche.price.ez_prices_hourly p
    ON date_trunc('hour', t.block_timestamp) = p.hour
    WHERE t.block_timestamp::date >= DATEADD(month, -3, CURRENT_DATE())
    AND p.symbol = 'WAVAX'
    GROUP BY t.block_timestamp::date
    )
    SELECT
    d.Date,
    d.Transactions,
    d.Users,
    d.Fees,
    d.Avg_Fee,
    QueryRunArchived: QueryRun has been archived