Updated 2023-11-01
    -- forked from userem1 @ https://flipsidecrypto.xyz/edit/queries/50868d26-455d-4c67-aa24-9bb3d50162dc

    with t1 as (
    SELECT
    date_trunc('day',BLOCK_TIMESTAMP) as day,
    from_address as user
    from avalanche.core.fact_transactions
    where to_address in ('0x94025780a1ab58868d9b2dbbb775f44b32e8e6e5', -- token
    '0x1a75280f832280af93f588f715a5fb4ca7918430', -- treasury
    '0x8d940a4859570754d364b86ccc05052ea5068ea6', -- Dice 4.0
    '0x908a71b19b25f3c7cdc7597136d8f4ac068d4971', -- Bank 3.0
    '0xc763f8570a48c4c00c80b76107cbe744dda67b79', -- token
    '0x556bc2bbe113cec48fc3b2c45afb708fb09dda63', -- Roulette 2.0
    '0x272b4dd8e842be1012c9ccbb89b636996f9bae98', -- Coin Toss 4.0
    '0x5883ee078531307c5a8057b593c0af7b76cb1ea0') -- Russian Roulette
    and STATUS = 'SUCCESS'
    and block_timestamp>='2022-09-01'
    ),


    t2 as (
    select
    day,
    count(distinct user) as daily_users
    from (
    select * from t1
    )
    group by 1
    ),


    t3 as (
    select
    week,
    count(distinct user) as weekly_user
    from (
    Run a query to Download Data