rezarwzDaily Buyers Who are adding to old position
    Updated 2024-08-28
    with all_r as (
    SELECT
    ORIGIN_FROM_ADDRESS as ua,
    BLOCK_TIMESTAMP :: date as date,
    rank() over(
    partition by ORIGIN_FROM_ADDRESS
    ORDER by
    BLOCK_TIMESTAMP asc
    ) as rank
    from
    ethereum.defi.ez_dex_swaps
    where
    TOKEN_OUT = lower ('{{contract_address}}')
    )
    SELECT
    date,
    count(DISTINCT ua) as "Buyers Count"
    from
    all_r
    where
    rank > 1 and date >= current_date - {{last_x_days}}
    GROUP by
    1
    ORDER by
    1 desc
    QueryRunArchived: QueryRun has been archived