ThatGuyOptimism - User Behavior 6. eth tx p user
    Updated 2022-10-26
    WITH
    opt as (
    SELECT
    FROM_ADDRESS as wallet,
    COUNT(DISTINCT tx_hash) as tx_count,
    SUM(TX_FEE) as fees
    FROM ethereum.core.fact_transactions
    WHERE
    STATUS = 'SUCCESS' AND block_timestamp::date >= '2021-11-11'
    GROUP BY 1
    ORDER BY 1
    )
    ,
    eth as (
    SELECT
    FROM_ADDRESS as wallet,
    COUNT(DISTINCT tx_hash) as tx_count,
    SUM(TX_FEE) as fees
    FROM ethereum.core.fact_transactions
    WHERE
    STATUS = 'SUCCESS' AND block_timestamp::date >= '2021-11-11'
    GROUP BY 1
    ORDER BY 1
    )

    SELECT
    CASE
    WHEN tx_count = 1 THEN 'Single Transaction'
    WHEN tx_count > 1 and tx_count < 5 THEN '1-5 Transactions'
    WHEN tx_count >= 5 and tx_count < 10 THEN '5-10 Transactions'
    WHEN tx_count >= 10 and tx_count < 25 THEN '10-25 Transactions'
    WHEN tx_count >= 25 and tx_count < 50 THEN '25-50 Transactions'
    WHEN tx_count >= 50 and tx_count < 100 THEN '50-100 Transactions'
    WHEN tx_count >= 100 and tx_count < 250 THEN '100-250 Transactions'
    WHEN tx_count >= 250 and tx_count < 500 THEN '250-500 Transactions'
    WHEN tx_count >= 500 THEN 'More than 500 Transactions'
    Run a query to Download Data