MLDZMNNFTFLOW.1
    Updated 2022-10-25
    with tb1 as ( select CONTRACT_NAME,
    count(distinct BUYER) as purchasers,
    COUNT (tx_id) as total_sales,
    sum(price) as volume,
    avg(price) as average_sale_price,
    total_sales/purchasers as average_buyer,
    volume/total_sales as average_sale
    FROM flow.core.fact_nft_sales s left join flow.core.dim_contract_labels b on s.NFT_COLLECTION=b.EVENT_CONTRACT
    where CURRENCY='A.ead892083b3e2c6c.DapperUtilityCoin'
    --and BLOCK_TIMESTAMP>='2022-05-01'
    group BY 1
    order by 3 desc
    limit 10)
    select
    date_trunc('week',BLOCK_TIMESTAMP) as week,
    CONTRACT_NAME as NFT_collection,
    COUNT (tx_id) as total_sales,
    count(distinct BUYER) as purchasers,
    sum(price) as volume,
    avg(price) as average_sale_price,
    total_sales/purchasers as average_buyer,
    volume/total_sales as average_sale
    FROM flow.core.fact_nft_sales s left join flow.core.dim_contract_labels b on s.NFT_COLLECTION=b.EVENT_CONTRACT
    where CURRENCY='A.ead892083b3e2c6c.DapperUtilityCoin' and CONTRACT_NAME in (select CONTRACT_NAME from tb1)
    and TX_SUCCEEDED='TRUE'
    group by 1,2
    order by 1
    Run a query to Download Data