jackguyTop Near Social Dashboard copy
    Updated 2023-03-12
    -- forked from 0da4e33a-03bc-438b-b184-a67d8dc7ef1b
    with tab1 as (
    SELECT
    *,
    sum(new_near_social_users) over (ORDER BY first_day) as total_users

    FROM (
    SELECT
    first_day,
    count(*) as new_near_social_users
    FROM (
    SELECT
    signer_id,
    min(date_trunc('day', block_timestamp)) as first_day,
    count(DISTINCT tx_hash) as profile_change_events
    FROM near.social.fact_addkey_events
    GROUP BY 1
    )
    GROUP BY 1
    )
    )


    SELECT
    signer_id,
    count(DISTINCT tx_hash) as transactions,
    count(DISTINCT date_trunc('week', block_timestamp)) as active_weeks,
    min(block_timestamp) as first_day_on_near_social

    FROM near.social.fact_decoded_actions
    GROUP BY 1
    ORDER BY 2 DESC


    Run a query to Download Data