Abbas_ra21Cohort retention 3
    Updated 2023-10-27
    -- forked from Cohort retention 3 @ https://flipsidecrypto.xyz/edit/queries/ddae2566-1229-484a-965e-20c8e3669bf7

    -- forked from Cohort retention 2 @ https://flipsidecrypto.xyz/edit/queries/0849a674-c4e4-4033-9863-6185976001d8

    -- forked from Cohort retention @ https://flipsidecrypto.xyz/edit/queries/9e6e8f74-e33a-4483-913d-3eb0d9edd129

    with users AS ( select
    BLOCK_TIMESTAMP,TX_HASH,Buyer_address AS User
    from
    avalanche.nft.ez_nft_sales
    where
    PLATFORM_NAME = '{{MarketPlace}}'
    union ALL
    select
    BLOCK_TIMESTAMP,TX_HASH,Seller_address AS User
    from
    avalanche.nft.ez_nft_sales
    where
    PLATFORM_NAME = '{{MarketPlace}}' ),
    new_users AS (
    select
    User,
    min(BLOCK_TIMESTAMP) AS First_Seen
    from
    Users
    group by
    1
    ),
    main AS (SELECT
    min(date_trunc('week',Block_timestamp)) AS First_Week,
    user
    FROM
    users group by 2),
    main2 AS (
    select
    users.user,
    Run a query to Download Data