Query editor
withbase as (select *from query_4118294),name_mint as (select *,date_trunc('day', evt_block_time) as time_periodfrom basewhere event = 'mint'),latest_transfer as (select blockchain,contract_address,tokenId,max(evt_block_number) as latest_block_number,max(evt_index) as latest_evt_indexfrom basegroup by blockchain, contract_address, tokenId),current_holder as (select t.blockchain,t.tokenId,t.to as holder,date_trunc('day', t.evt_block_time) as time_period,t.evt_block_time as last_transfer_timefrom base tjoin latest_transfer lton t.contract_address = lt.contract_addressand t.tokenId = lt.tokenIdand t.evt_block_number = lt.latest_block_numberand t.evt_index = lt.latest_evt_index)-- 按时间段计算 mint 数量selectnm.blockchain,nm.time_period,count(distinct nm.tokenId) as daily_mint,count(distinct ch.holder) as daily_holder,sum(count(distinct nm.tokenId)) over (partition by nm.blockchain order by nm.time_period) as cumulative_mint,sum(count(distinct nm.tokenId)) over (partition by nm.blockchain order by nm.time_period) as cumulative_holderfromname_mint nmleft joincurrent_holder ch on nm.blockchain = ch.blockchain and nm.time_period = ch.time_periodgroup by nm.blockchain, nm.time_periodorder by nm.blockchain, nm.time_period