Query editor
WITHblueprint_layer3_drops AS (SELECTname,contract_addressFROMquery_4081147GROUP BYname,contract_address),eth_price AS (SELECTpriceFROMprices.usd_latestWHEREblockchain = 'ethereum'AND symbol = 'WETH'LIMIT1),base_price AS (-- Get the base price for the NFT mints (use this as the only source for mint price)SELECTMIN(trades.amount_original) AS base_price_eth,bld.name AS creator_name,trades.nft_contract_addressFROMnft.mints AS tradesJOIN blueprint_layer3_drops AS bld ON trades.nft_contract_address = bld.contract_addressWHEREtrades.amount_original IS NOT NULLAND trades.amount_original > 0AND trades.trade_type = 'Single Item Mint'AND trades.currency_symbol = 'ETH'AND trades.blockchain = 'base'GROUP BYbld.name,trades.nft_contract_address),all_mints AS (-- Use only base price for mint revenue calculationSELECTtrades.block_time AS evt_block_time,DATE_TRUNC('day', trades.block_time) AS mint_date,bld.name AS creator_name,bp.base_price_eth AS mint_price_eth, -- Use base price onlytrades.number_of_items,(bp.base_price_eth * trades.number_of_items) AS mint_revenue_ethFROMnft.mints AS tradesJOIN blueprint_layer3_drops AS bld ON trades.nft_contract_address = bld.contract_addressJOIN base_price AS bp ON trades.nft_contract_address = bp.nft_contract_address),date_range AS (-- Create a range of dates using UNNESTSELECTDATE_ADD('day', day_index, min_date) AS dateFROM