with flow_whales as (
select
buyer,
sum(price) as volume
from flow.core.fact_nft_sales
group by 1
order by 2 desc
limit 50
),
flow_nft as (
select
nft_collection,
count(tx_id) as sale_count
from flow.core.fact_nft_sales
where block_timestamp::date >= '2022-04-20'
and buyer in (select buyer from flow_whales)
group by 1
order by 2 desc
)
select
CONTRACT_NAME,
sale_count
from flow.core.dim_contract_labels a join flow_nft b on a.event_contract = b.nft_collection
where sale_count is not null
order by 2 desc
limit 10