thea[Blur Mega] Trader Group Based on Sales Volume
    Updated 2023-04-13
    with trader as (
    select wallet,
    count(distinct tx_hash) as sales_count,
    sum(price_usd) as sales_volume
    from (
    select -- to_date(date_trunc('day', block_timestamp)) as block_date,
    buyer_address as wallet,
    tx_hash,
    price_usd
    from ethereum.core.ez_nft_sales
    where platform_name = 'blur'
    and price_usd is not null
    union all
    select -- to_date(date_trunc('day', block_timestamp)) as block_date,
    seller_address as wallet,
    tx_hash,
    price_usd
    from ethereum.core.ez_nft_sales
    where platform_name = 'blur'
    and price_usd is not null
    )
    group by 1
    )

    select case
    when sales_volume <= 10 then '$0 - $10'
    when sales_volume > 10 and sales_volume <= 100 then '$11 - $100'
    when sales_volume > 100 and sales_volume <= 1000 then '$101 - $1K'
    when sales_volume > 1000 and sales_volume <= 10000 then '$1K - $10K'
    when sales_volume > 10000 and sales_volume <= 100000 then '$10K - $100K'
    when sales_volume > 100000 and sales_volume <= 1000000 then '$100K - $1M'
    when sales_volume > 1000000 then '> $1M' end as sales_volume_tier,
    case
    when sales_volume <= 10 then 1
    when sales_volume > 10 and sales_volume <= 100 then 2
    when sales_volume > 100 and sales_volume <= 1000 then 3
    Run a query to Download Data