select block_timestamp::date as day,
sum(price) as total_amount
from flow.core.ez_nft_sales as a
join (select nft_collection, nft_id from flow.core.dim_allday_metadata) b
on (a.nft_id = b.nft_id and a.nft_collection = b.nft_collection)
where a.tx_succeeded = 'TRUE'
and current_date >= a.block_timestamp::date
group by day