amaUntitled Query
    Updated 2022-07-15
    with nfts as (
    select address from polygon.core.dim_labels
    where LABEL_TYPE='nft' and (label_subtype = 'token_contract' or label_subtype = 'general_contract'))
    ,
    first_buy as (
    select TO_ADDRESS as buyer,
    min(block_timestamp::date) as first_buy_date_nft
    from flipside_prod_db.polygon.udm_events u
    join nfts on nfts.address = u.CONTRACT_ADDRESS
    where EVENT_NAME='transfer'
    and AMOUNT_USD>0
    and TO_ADDRESS not in ('0x0000000000000000000000000000000000000000','0x00000000000b69ec332f49b7c4d2b101f93c3bed','0x00000000000b69ec332f49b7c4d2b101f93c3bed'
    ,'0x00000000000b186ebef1ac9a27c7eb16687ac2a9','0x000000000000000000000000000000000000dead','0x0000000000000000000000000000000000000001')
    group by 1)
    ,
    first_tx as (
    select
    from_address as user
    ,min(block_timestamp::date) as first_date_tx
    from flipside_prod_db.polygon.udm_events u
    where TO_ADDRESS not in ('0x0000000000000000000000000000000000000000','0x00000000000b69ec332f49b7c4d2b101f93c3bed','0x00000000000b69ec332f49b7c4d2b101f93c3bed'
    ,'0x00000000000b186ebef1ac9a27c7eb16687ac2a9','0x000000000000000000000000000000000000dead','0x0000000000000000000000000000000000000001')
    group by 1)


    ,count_start_nft as (select count(user) as Count_NFT_starters from first_tx join first_buy on (first_buy.buyer = first_tx.user and first_buy.first_buy_date_nft = first_tx.first_date_tx ) )
    ,count_Start_all as ( select count(user) as Count_all_starters from first_tx)


    select Count_NFT_starters, Count_all_starters,round(Count_NFT_starters/Count_all_starters*100,2) as percent_NFT_starters from count_start_nft,count_Start_all


    Run a query to Download Data