Updated 2024-02-01
    with all_user as (
    SELECT
    block_timestamp,
    tx_hash,
    to_address,
    from_address,
    row_number() over (partition by from_address order by block_timestamp) as rank
    FROM polygon.core.fact_transactions
    WHERE STATUS = 'SUCCESS'
    )

    SELECT
    project_name,
    label_type as sector,
    count(DISTINCT from_address) as new_user
    FROM all_user a
    LEFT JOIN polygon.core.dim_labels b
    on a.to_address = b.address
    WHERE block_timestamp BETWEEN '2023-01-01' AND '2023-12-31'
    AND project_name is not null
    AND label_type not in ('token', 'chadmin')
    AND rank = 1
    GROUP by 1 , 2
    ORDER BY new_user DESC
    LIMIT 50



    Last run: about 1 year ago
    PROJECT_NAME
    SECTOR
    NEW_USER
    1
    hopbridge2823170
    2
    binancecex319226
    3
    okxcex252907
    4
    imvugames244246
    5
    indigggames240074
    6
    gameegames208623
    7
    ultimate championsgames186946
    8
    socketdapp144187
    9
    smart catsnft127791
    10
    metatracenft111386
    11
    metamaskdex105561
    12
    qorpogames101169
    13
    stargate financebridge100365
    14
    credit daodapp98105
    15
    uniswapdex82341
    16
    snsdapp82225
    17
    carvnft80009
    18
    0xdex74547
    19
    sandboxgames70406
    20
    openseanft69799
    50
    1KB
    438s