hbd1994All Users in Desired Project Over Time
    Updated 2023-09-04
    with labels as (
    with labl as (
    select *
    from near.core.dim_address_labels
    where address not in ('usdt.tether-token.near', 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near')
    and PROJECT_NAME is not null)
    select
    ADDRESS,
    lower(PROJECT_NAME) as PROJECT_NAMES,
    LABEL_TYPE,
    LABEL_SUBTYPE
    from labl
    where LABEL_TYPE not in ('Category', 'cex', 'validator', 'fungible_token', 'token')
    and PROJECT_NAME != 'Exchanges'
    ),

    desired_project as (
    select
    ADDRESS,
    PROJECT_NAMES
    from labels
    where PROJECT_NAMES = '{{Project}}')

    select
    DATE_TRUNC('Week',BLOCK_TIMESTAMP::date) as "Date",
    count(distinct tx_signer) as "All Users",
    sum("All Users") over (order by "Date") as "Cumulative All Users"
    from near.core.fact_transactions
    join desired_project on tx_receiver = ADDRESS
    where tx_status = 'Success'
    group by 1
    order by 1
    Run a query to Download Data