KaskoazulVolume by Collection coralcube
    Updated 2022-10-29
    -- with coralcube as (
    -- select s.mint as collection_address,
    -- case
    -- when m.contract_name is not NULL then m.contract_name
    -- else s.mint
    -- end as collection,
    -- sum(s.sales_amount) as volume,
    -- count(s.tx_id) as txs,
    -- count(distinct s.purchaser) as daily_unique_buyers,
    -- row_number() over (order by volume desc) as rank
    -- from solana.core.fact_nft_sales s
    -- left join solana.core.dim_nft_metadata m
    -- on s.mint = m.mint
    -- where s.marketplace = 'coral cube'--in ('hadeswap', 'coral cube', 'hyperspace')
    -- and s.block_timestamp >= '2022-10-01' and s.block_timestamp < CURRENT_DATE
    -- and s.succeeded = True
    -- group by 1,2
    -- order by rank
    -- ),

    with coralcube as (
    select m.project_name as collection,
    sum(s.sales_amount) as volume,
    count(s.tx_id) as sales,
    count(distinct s.purchaser) as unique_buyers,
    row_number() over (order by volume desc) as rank
    from solana.core.fact_nft_sales s
    inner join solana.core.dim_nft_metadata m
    on s.mint = m.mint
    where s.marketplace = 'coral cube'--in ('hadeswap', 'coral cube', 'hyperspace')
    and s.block_timestamp >= '2022-10-01' and s.block_timestamp < CURRENT_DATE
    and s.succeeded = True
    group by 1
    order by rank
    ),

    Run a query to Download Data