WITH nft_allday AS (
SELECT
date_trunc('month', b.block_timestamp) AS date,
b.NFT_ID as nft_id,
b.BUYER as BUYER,
b.SELLER as SELLER
FROM flow.core.dim_allday_metadata a
LEFT JOIN flow.core.ez_nft_sales b
ON a.NFT_ID = b.NFT_ID
)
SELECT
date,
COUNT(DISTINCT BUYER) as unique_buyers,
COUNT(DISTINCT SELLER) as unique_sellers
FROM nft_allday
GROUP BY date
ORDER BY date ASC