Specterdistribution of tx
    Updated 2024-11-05
    WITH user_tx_count AS (
    -- Count the number of transactions per user
    SELECT
    origin_from_address AS donor,
    COUNT(DISTINCT tx_hash) AS tx_count,
    SUM(eth_amount_usd) AS total_amount_usd
    FROM
    crosschain.olas.ez_service_donations
    GROUP BY
    donor
    )

    -- origin_from_address AS donor,
    -- COUNT(DISTINCT tx_hash) AS total_transactions,
    -- SUM(eth_amount_usd) AS total_amount_usd

    -- Group users by transaction count range
    SELECT
    CASE
    WHEN tx_count < 5 THEN '< 5 transactions'
    WHEN tx_count BETWEEN 5 AND 10 THEN '5-10 transactions'
    WHEN tx_count BETWEEN 11 AND 11 THEN '11-20 transactions'
    ELSE '> 20 transactions'
    END AS tx_range,
    COUNT(DISTINCT donor) AS user_count
    FROM
    user_tx_count
    GROUP BY
    tx_range
    ORDER BY
    tx_range;

    QueryRunArchived: QueryRun has been archived