MasiNew Vs. Returning
    Updated 2025-04-12
    WITH tb1 AS (
    SELECT
    from_address,
    MIN(block_timestamp) AS first_tx_time
    FROM mezo.testnet.fact_transactions
    GROUP BY from_address
    ),
    tb2 AS (
    SELECT DISTINCT
    from_address
    FROM mezo.testnet.fact_transactions
    WHERE block_timestamp::date = current_date - 1
    )
    SELECT
    'New Wallets' AS category,
    COUNT(*) AS count
    FROM tb2 a
    JOIN tb1 f ON a.from_address = f.from_address
    WHERE f.first_tx_time::date >= current_date() - 1
    UNION ALL
    SELECT
    'Returning Wallets' AS category,
    COUNT(*) AS count
    FROM tb2 a
    JOIN tb1 f ON a.from_address = f.from_address
    WHERE f.first_tx_time::date < current_date() - 1

    Last run: 12 days ago
    CATEGORY
    COUNT
    1
    New Wallets541
    2
    Returning Wallets372
    2
    47B
    1s