cilo-pShow the most common actions taken by users on NEAR (new users using NEAR for the first time) over the past 3 months
    Updated 2022-09-07
    WITH T_ID AS
    (select
    TRADER,
    BLOCK_TIMESTAMP
    from (
    select
    TRADER,
    BLOCK_TIMESTAMP,
    min(BLOCK_TIMESTAMP) over (partition by TRADER) as min_date
    from near.core.ez_dex_swaps
    ) t
    where BLOCK_TIMESTAMP = min_date AND BLOCK_TIMESTAMP >= CURRENT_DATE -90
    order by min_date DESC
    ),

    wh_done AS
    (SELECT DISTINCT TRADER,
    BLOCK_TIMESTAMP,
    SWAP_ID,
    TOKEN_IN,
    AMOUNT_IN,
    TOKEN_OUT,
    AMOUNT_OUT
    FROM near.core.ez_dex_swaps
    WHERE BLOCK_TIMESTAMP >= CURRENT_DATE -90
    ),

    old_users AS
    (SELECT
    DISTINCT TRADER,
    BLOCK_TIMESTAMP,
    SWAP_ID
    FROM near.core.ez_dex_swaps
    Run a query to Download Data