Afonso_Diazwhales vs small users
    Updated 2024-07-11
    with arbitrum as (
    select
    block_timestamp::Date AS date,tx_hash,
    amount_in_usd AS amountUSD,
    origin_from_address as user
    from arbitrum.defi.ez_dex_swaps
    where amount_in_usd<power(10,6)
    and tx_hash in (select distinct(tx_hash) from arbitrum.core.ez_decoded_event_logs where origin_to_address in ('0x5e325eda8064b456f4781070c0738d849c824258','0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b','0x4c60051384bd2d3c01bfc845cf5f4b44bcbe9de5'))
    and platform = 'uniswap-v3'
    )
    ,users_type as (
    select
    user,
    sum(amountUSD) as totalAmount,
    CASE
    when totalAmount < 100 then 'Plankton'
    when totalAmount < 1000 then 'Shrimp'
    when totalAmount < 5000 then 'Crab'
    when totalAmount < 10000 then 'Octopus'
    when totalAmount < 50000 then 'Fish'
    when totalAmount < 100000 then 'Dolphin'
    when totalAmount < 500000 then 'Shark'
    when totalAmount < 1000000 then 'Whale'
    when totalAmount < 10000000 then 'Humpback Whale'
    else 'Leviathan'
    END as userType
    from arbitrum
    group by user
    ),

    arbitrum2 as (
    select * from arbitrum join users_type on arbitrum.user = users_type.user
    where date>='2023-01-01'
    )

    select
    QueryRunArchived: QueryRun has been archived