Ali3NDistribution of Particpants By Bought Tickets Blubbrr Raffllrr
    Updated 2025-02-27
    with maintable as (
    select origin_from_address,
    count (distinct tx_hash) as Transaction,
    sum (decoded_log:ticketCount) as Tickets
    from avalanche.core.ez_decoded_event_logs
    where origin_to_address = '0xea82821f75d3cb02c2b450eb43ae528603ea614a'
    and topic_0 = '0xaf2aee3d8cdab65f2d45ee09beee32f3c25f465d16fa61f5c86cca3f13e86057'
    and contract_address = '0xea82821f75d3cb02c2b450eb43ae528603ea614a'
    and decoded_log:raffleId = '6285'
    group by 1)

    select case when tickets = 1 then '1'
    when tickets > 1 and tickets <= 10 then '2 - 10 Tickets'
    when tickets > 10 and tickets <= 25 then '10 - 25 Tickets'
    when tickets > 25 and tickets <= 50 then '25 - 50 Tickets'
    when tickets > 50 and tickets <= 100 then '50 - 100 Tickets'
    else '> 100 Tickets' end as type,
    count (distinct origin_From_address) as Users
    from maintable
    group by 1
    order by 2 desc


    /*select *
    from avalanche.core.ez_decoded_event_logs
    where tx_hash = '0x7e9d588ec94cefc3f97943f5086a09049f261f5aaf6bf9006733633f3b1e98ca'*/



    Last run: 2 months ago
    TYPE
    USERS
    1
    1563
    2
    2 - 10 Tickets237
    3
    10 - 25 Tickets12
    4
    > 100 Tickets7
    5
    25 - 50 Tickets7
    6
    50 - 100 Tickets4
    6
    122B
    2s