sepehrmhz8Untitled Query
    Updated 2022-11-27
    with swap_hash as (
    select distinct tx_hash
    from bsc.core.fact_event_logs
    where origin_to_address = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
    ), main as (
    select
    origin_from_address,
    min(date_trunc('day', block_timestamp)) as min_day
    from bsc.core.fact_token_transfers
    left outer join bsc.core.dim_labels
    ON contract_address = address
    where tx_hash in (select * from swap_hash)
    and block_timestamp::date >= '2022-07-10'
    group by 1
    ), final as (
    select
    min_day,
    count(*) as new_users
    from main
    group by 1
    )
    select
    min_day,
    new_users,
    sum(new_users) OVER (ORDER BY min_day) as total_users
    from final


    Run a query to Download Data