Query editor
-- define users as coin minters or coin burns-- churn definition: monthly churned / no. of customers at the beginning of the monthwithcoin_list as (select 'Glossier' as brand_name, 0x6d7f22438b7b4394d97c14d942833e639a6d5a14 as token_address union allselect 'Rare Beauty' as brand_name, 0x4cc5d6ac79b9e1b525236c7affa9ab350a4aca57 as token_address union allselect 'Topicals' as brand_name, 0xf08fa6d30734e76918c1d2c2522a6ff60adec66a as token_address union allselect 'Dieux' as brand_name, 0x9e25b78dc7998dbb9be1089dc5679150132d098a as token_address union allselect 'OUAI' as brand_name, 0x3e0b07b47917a296f5ad92637551838fb6ebde50 as token_address union allselect 'Cult Gaia' as brand_name, 0x99843411020e898f08fded7f48eef49de3e1d6e0 as token_address union allselect 'The Outset' as brand_name, 0xbe9b3eb446f1e3321465ec61d44f23b09cc3306b as token_address union allselect 'Mario Badescu' as brand_name, 0xbc6c33bb0c2c6c08756d4350c7c7e08aa4cdb8c4 as token_address union allselect 'Skinfix' as brand_name, 0x339fe79302e8952adb375891f6a040deca66dad4 as token_address union allselect 'TSC' as brand_name, 0x38cb16cb771505ca866def2052653515c831c4be as token_address union allselect 'Urban Outfitters' as brand_name, 0x47f5339460e362599ef5191528e9e18eff8a2b49 as token_address union allselect 'Loops' as brand_name, 0xe0adce2d42cb3cc1290ecccd8d8a019406e9329d as token_address union allselect 'Bubble' as brand_name, 0x40bc2fd80f6810c2431031b2832c717d53f39d94 as token_address union allselect 'BYOMA' as brand_name, 0x59debe24b18d272aae97c2cd60db9afdb8cb9784 as token_address),coin_emitter as (-- each coin contract has its own emit contractselect"to" as emitter_address,contract_address as token_emittedfromerc20_avalanche_c.evt_Transferwhere1=1and contract_address in (select token_address from coin_list)and "from"=0x0000000000000000000000000000000000000000),coin_tx as (-- get coin holdersselectevt_block_time,evt_tx_hash,"from" as from_address,"to" as to_address,case when "from" in (select emitter_address from coin_emitter) then "to"when "to"=0x0000000000000000000000000000000000000000 then "from" end as user_address,value as amount,token_address,brand_namefromerc20_avalanche_c.evt_Transferleft joincoin_list on token_address=contract_addresswherecontract_address in (select token_address from coin_list)--contract_address=lower('0x6D7f22438B7b4394d97C14D942833E639a6D5A14')and ("from" in (select emitter_address from coin_emitter) or"to" = 0x0000000000000000000000000000000000000000)),coin_mint_tx as (