Afonso_DiazGrouping txns ($USD)
    Updated 2025-05-05
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as token_price_usd
    from
    sei.price.ez_prices_hourly
    where
    token_address = 'usei'
    group by 1
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    -- Determine NFT collection address
    iff(
    decoded_log:consideration[0]:token != '0x0000000000000000000000000000000000000000',
    decoded_log:consideration[0]:token,
    decoded_log:offer[0]:token
    ) as collection_address,

    -- Determine buyer and seller addresses
    iff(
    collection_address = '0x0000000000000000000000000000000000000000',
    origin_from_address,
    decoded_log:consideration[0]:recipient
    ) as buyer_address,

    iff(
    collection_address != '0x0000000000000000000000000000000000000000',
    origin_from_address,
    decoded_log:consideration[0]:recipient
    Last run: 20 days ago
    SALE_CATEGORY_USD
    TRANSACTIONS
    1
    Large Sale ($500–$1K)3
    2
    Micro Sale (< $10)16071
    3
    Mid-Tier Sale ($100–$500)254
    4
    Moderate Sale ($50–$100)397
    5
    Small Sale ($10–$50)1007
    5
    163B
    3s