StangFAST01 - distribution users
    Updated 2023-08-25
    -- forked from retention rate of old users @ https://flipsidecrypto.xyz/edit/queries/396f56a1-f364-4436-ad74-c7a68a4821fb

    -- PositionLiquidated
    -- PositionTranslated

    -- PositionModified
    -- ReferralBonusAdded

    with

    avax_price AS
    (
    SELECT
    date_trunc( 'day' , a.hour ) AS day
    , avg( a.price ) AS price
    , a.symbol
    FROM
    avalanche.core.fact_hourly_token_prices a
    WHERE
    a.symbol = 'WAVAX'
    GROUP BY 1 , 3
    ORDER BY 1 DESC
    )
    ,
    hubble AS
    (
    SELECT
    a.address AS address
    , a.address_name AS name
    FROM
    avalanche.core.dim_labels a
    WHERE
    a.project_name = 'hubble'
    GROUP BY 1 , 2
    )
    ,
    Run a query to Download Data