Hosseingrouping users
    Updated 2024-01-03
    with main as (
    select
    tx_hash,
    block_timestamp,
    case
    when block_timestamp :: date between '2020-09-01'
    and '2021-04-17' then 'Bull'
    when block_timestamp :: date between '2020-04-17'
    and '2021-07-18' then 'Bear'
    when block_timestamp :: date between '2021-07-18'
    and '2021-11-14' then 'Bull'
    when block_timestamp :: date between '2021-11-14'
    and '2023-01-03' then 'Bear'
    else 'Bull'
    end as type,
    abs(amount0_usd) as amount,
    liquidity_provider as user
    from
    ethereum.uniswapv3.ez_lp_actions
    where
    amount < 1000000
    and block_timestamp :: date >= '2020-09-01'
    ),
    txns as (
    select
    type,
    user,
    count(distinct tx_hash) as txns
    from
    main
    group by
    1,
    2
    )

    select
    QueryRunArchived: QueryRun has been archived