Query editor
with-- get tyb collection holderscollection_list as (selecttx_hash,varbinary_substring(data,13,20) as collection_addressfromavalanche_c.logswherecontract_address=0x5ffb513e7653e24bb7c7d3effe2fa27b20edcb13 and topic0=0x0932763e5a18f9be5bc3fb4ab7811741698b07a6b017eed8f9e6e0c5738f28ce),tb as (select *from (selectblock_time,varbinary_substring(topic1, 13, 20) as from_address,varbinary_substring(topic2, 13, 20) as to_address,contract_address,varbinary_to_uint256(topic3) as token_idfromavalanche_c.logswhere1=1and contract_address in (select collection_address from collection_list)and topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efand tx_to=0x669b9f4ba20e1bc8283dfbd8224acf382a5795a9)where from_address=0x0000000000000000000000000000000000000000),-- get wallets for each collectionwallet_collection_date as (select*,rank() over (partition by user_address order by block_time asc) first_collection_datefrom (selectblock_time,contract_address,case when contract_address=0xac3f47c5a31b804e6db75027df2495acda456c21 then 'Glossier'when contract_address=0x134ce3f6ec482099ade689bb9a666e40da71d13c then 'Rare Beauty'when contract_address=0x9c426ecc0c0403d36bb4030e2bef017ffab9c39e then 'BYOMA'when contract_address=0x28f1af69f83ae564a65d52bf19a6cc00790bb075 then 'Mario Badescu'when contract_address=0x6ca218c67fdebb1cf67fa3572d71fddbd2f40ce0 then 'Bubble'when contract_address=0x8f2a70770e3d85b87aef2e7d0ccc14de94adf0d5 then 'Dieux'when contract_address=0x53f4a783c31bebe473db082c744866b797fdb054 then 'The Outset'when contract_address=0x1d50319f6366c8172069910f9cf341fe61b90bae then 'The Rootist'when contract_address=0x88ceb61aaf34d4b4f20654dab4f71aa98b62540d then 'Saysh+'else 'Others' end as contract_name,to_address as user_addressfromtb))selectcontract_address,count(distinct user_address) as user_count,