Popex404Existing Sellers and New Sellers vs New Seller Percentage
    Updated 2023-04-13
    with user_cohorts as (
    SELECT
    seller_address as address,
    min(date_trunc('d',block_timestamp)) as cohortDate
    from ethereum.core.ez_nft_sales
    where origin_to_address = '0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b'
    and event_type = 'sale'
    GROUP BY 1
    ),
    new_users as (
    SELECT cohortDate as date, count (distinct address) as new_users_count
    FROM user_cohorts uc
    Group by Date
    ),
    all_users as (
    Select date_trunc('d',block_timestamp) as date,
    count (distinct seller_address) as total_users
    from ethereum.core.ez_nft_sales
    where origin_to_address = '0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b'
    and event_type = 'sale'
    Group by 1
    )
    SELECT au.date,
    nu.new_users_count as "New Sellers",
    sum("New Sellers") over (order by au.date) as "Cumulative New Sellers",
    au.total_users - nu.new_users_count AS "Existing Sellers",
    (nu.new_users_count/au.total_users)*100 as "New Seller Percentage"
    FROM all_users au
    LEFT JOIN new_users nu
    ON au.date = nu.date
    Run a query to Download Data