permaryMost played blub game
    Updated 2025-02-26
    with avax_price as (
    select
    date_trunc('day', hour) as day,
    avg(price) as price
    from avalanche.price.ez_prices_hourly
    where symbol = 'AVAX'
    and hour between timestamp '2025-02-22 21:20'
    and timestamp '2025-02-25 06:40'
    group by 1
    ),

    blub_games as (
    select
    date_trunc('day', a.block_timestamp) as date,
    a.origin_from_address as player,
    count(distinct a.tx_hash) as play_count,
    sum(a.amount * b.price) as total_wagered,
    case
    when lower(a.origin_to_address) = '0x7d812a58dd63eb3a7b3b84f9290bd84db148893f' then 'blub flip'
    when lower(a.origin_to_address) = '0x0382df14b587c51052ffcca53db8697849ca1b2e' then 'blub plinko'
    when lower(a.origin_to_address) = '0x3d74cbac40e2f23a795c665056613e3f3a83d160' then 'blub wheel'
    end as game
    from avalanche.core.ez_native_transfers a
    join avax_price b
    on date_trunc('day', a.block_timestamp) = b.day
    where lower(a.origin_to_address) in (
    '0x7d812a58dd63eb3a7b3b84f9290bd84db148893f',
    '0x0382df14b587c51052ffcca53db8697849ca1b2e',
    '0x3d74cbac40e2f23a795c665056613e3f3a83d160'
    )
    and a.origin_function_signature in ('0x53ccbeea', '0xe427275b', '0x11af445d')
    and a.block_timestamp between timestamp '2025-02-22 21:20' and timestamp '2025-02-25 06:40'
    group by 1, 2, 5
    )

    select
    Last run: about 2 months ago
    GAME
    UNIQUE_PLAYERS
    TOTAL_WAGERED
    TOTAL_PLAYS
    TOTAL_GAME_STARTS
    1
    Blub Flip2852090818.57148828899326829
    2
    Blub Wheel2431709693.877973737917662
    3
    Blub Plinko1831023683.2010226730735630
    3
    139B
    3s