Updated 2024-02-07
    with all_user as (
    SELECT
    block_timestamp,
    tx_hash,
    tx_receiver,
    tx_signer,
    row_number() over (partition by tx_signer order by block_timestamp) as rank
    FROM near.core.fact_transactions
    WHERE TX_SUCCEEDED
    )
    ,
    active_users_q1 as (
    SELECT
    project_name,
    label_type as sector,
    count(DISTINCT tx_signer) as "Q1 2023"
    FROM all_user a
    LEFT JOIN near.core.dim_address_labels b
    on a.tx_RECEIVER = b.address
    WHERE block_timestamp BETWEEN '2023-01-01' AND '2023-04-01'
    AND project_name is not null
    AND rank = 1
    GROUP by 1 , 2
    )
    ,
    active_users_q2 as (
    SELECT
    project_name,
    label_type as sector,
    count(DISTINCT tx_signer) as "Q2 2023"
    FROM all_user a
    LEFT JOIN near.core.dim_address_labels b
    on a.tx_RECEIVER = b.address
    WHERE block_timestamp BETWEEN '2023-04-01' and '2023-07-01'
    AND project_name is not null
    AND rank = 1
    Last run: about 1 year ago
    PROJECT
    SECTORS
    New.U Q1 2023
    New.U Q2 2023
    New.U Q3 2023
    New.U Q4 2023
    Total New Users 2023
    % New users Q4 2023
    1
    kaikaidapp001723162117984281352159087
    2
    playembergames77681747656490391653511245499667
    3
    sweatgames561852396701340577698729199785935
    4
    okexcex32753024204436351197830
    5
    orderly networkdefi133697538231083235
    6
    coinbasecex1627102811512833663943
    7
    lisdefi43323171878549212
    8
    astro stakersdefi4333867661098268341
    9
    gate.iocex4764343241371260553
    10
    huobicex582631281373186720
    11
    swissborgcex25113215934088239
    12
    aurorabridge5001663146832
    13
    neatdefi000682682100
    14
    refdefi2571657113763022
    15
    octdefi148999824458941
    16
    mexccex908220720358235
    17
    everstakedefi1208424112456922
    18
    epic pooldefi777922215653429
    19
    taodefi28640120184644
    20
    near socialdapp2922530836485
    20
    869B
    292s