Pmisha-bmlMdxhold.duration
    Updated 2022-06-07
    with t1 as (select
    distinct PURCHASER as wl1,
    BLOCK_TIMESTAMP as mint_date,
    mint,
    MINT_PRICE
    from flipside_prod_db.solana.fact_nft_mints
    where BLOCK_TIMESTAMP>='2022-01-01'
    and SUCCEEDED='TRUE'
    and MINT_CURRENCY='So11111111111111111111111111111111111111111'
    and purchaser not in (select address from flipside_prod_db.solana.dim_labels where label_type = 'nft')
    ),

    t2 as (select
    mint,
    BLOCK_TIMESTAMP as sale_date,
    SALES_AMOUNT

    from flipside_prod_db.solana.fact_nft_sales
    where BLOCK_TIMESTAMP>='2022-01-01'
    and mint in (select mint from t1)
    and SUCCEEDED='TRUE'
    )

    select
    t1.wl1 as users,
    sum(mint_price) as paid_mint,
    sum(SALES_AMOUNT) as vol_sale,
    vol_sale-paid_mint as profit,
    min(mint_date) as d1,
    max(sale_date) as d2,
    abs(DATEDIFF(day, d1,d2)) as average_time

    from t1 join t2 on t1.mint=t2.mint
    group by 1
    order by 4 desc limit 10
    Run a query to Download Data