jackguyTop Near Social Dashboard
    Updated 2023-03-13
    with tab1 as (
    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
    )


    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
    WHERE signer_id in (
    SELECT
    DISTINCT signer_id
    FROM tab1
    WHERE first_day BETWEEN '{{ user_group_first_day }}' AND '{{ user_group_last_day }}'
    )
    GROUP BY 1
    ORDER BY 2 DESC

    Run a query to Download Data