permaryplayer stats
    Updated 2025-02-25
    with avax_price as (
    select
    date_trunc('day', hour) as day,
    avg(price) as price
    from avalanche.price.ez_prices_hourly
    where symbol = 'AVAX' -- Changed from 'WAVAX' to 'AVAX' as it's the native token
    and hour >= dateadd('day', -30, current_date) -- Added time filter
    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', -- Blub Flip
    '0x0382df14b587c51052ffcca53db8697849ca1b2e', -- Blub Plinko
    '0x3d74cbac40e2f23a795c665056613e3f3a83d160' -- Blub Wheel
    )
    and a.origin_function_signature in (
    '0x53ccbeea', '0xe427275b', '0x11af445d'
    )
    and a.block_timestamp >= dateadd('day', -30, current_date)
    and a.block_timestamp < current_date
    group by 1, 2, 5
    )

    select
    Last run: about 2 months ago
    PLAYER
    TOTAL_WAGERED
    TOTAL_PLAYS
    ACTIVE_DAYS
    1
    0x26737fb3fb631a057a085b51af5087e578b02584933219.5991254392
    2
    0x9bfe0a05a274b229e0e4bd162bd22aea9276cdbf665444.3917458334302
    3
    0xfa80c1a8f2968d6526607d780b06acb68d61beb8444375.96263754173
    4
    0x1142184c427c843172c14025df52501536cafe26336860.0556743752844
    5
    0x2962f50c660287834a617d0a8de7dd1a5affcf44316312.0585729171644
    6
    0xf83128ae01dc7d66d4d8807903fa0431efb4e123268655.650833333872
    7
    0xa9614ce2adfff408877b56caff111ba591196997195503.136596854
    8
    0x808a7287d7ce25f06b6f2201a95042e15f047c6b182480.4263708335026
    9
    0xfda8a1094327e78ea9748176867977bad05e5b1b177767.5111568133121
    10
    0x94f35b2444ec6e60296002e028a7fcd74fd6c5ed171167.5191041671314
    11
    0x327d9c5d98000e84cf3375cb5607da2ae5cc4850160389.64525611
    12
    0x6954f7add88b0c0a2761a5dd0a56913df88894c8159504.0789191672024
    13
    0x37099c929a51083c83f3eff38e811dda24c783c6154053.0888157087014
    14
    0x75333d612f37fcb6c3a0da520bee0ba8380318bf121817.17910856319433
    15
    0x95894a9da8596206545787300f2e77c5b68e5ac6113202.4240822922359
    16
    0x55dfea1cc66f2de013a594ae304f2988d58267f197841.5410214171312
    17
    0x65690116a8b689e434754c7d58930e4741b71b8394354.6782185422258
    18
    0xd35cf25f2768a2d82ea123136c393c4586486c2563866.81214927118312
    19
    0x19a88cfc0b097e6f9f2bfdd0cc18765e169ca05c50303.127838542942
    20
    0x62dff92444562cbe6842523216ca7b6fa71fb9e746074.2318770831457
    ...
    600
    38KB
    1s