Query editor
select sum(ev_contribution) as estimated_eth_val_of_mint_from_burn from(selectmints.month,name,mints.rarity,num_minted,num_minted/(sum(num_minted) over (partition by mints.month)) as prob_mint,num_minted/(sum(num_minted) over (partition by mints.month)) * avg_eth_price as ev_contribution,avg_eth_price,avg_usd_pricefrom(selectdate_trunc('month', block_date) as month,h.hero_id,h.rarity,sum(cards_minted) as num_mintedfrom fantasy.events feleft outer join dune.hildobby.dataset_fantasy_cards hon array_join(fe.minted_ids, ',') = cast(h.token_id as varchar)left outer join dune.hildobby.dataset_fantasy_cards h2on fe.burned_ids[1] = h2.token_idwhere minted_ids is not null and burned_ids is not null and regexp_count(array_join(burned_ids,','), ',') < 3 and h2.rarity = {{rarity}}group by 1, 2, 3) mintsleft outer join(selectdate_trunc('month', block_date) as month,hero_id,rarity,avg(amount_original) as avg_eth_price,avg(amount_usd) as avg_usd_pricefrom fantasy.trades ftleft outer join dune.hildobby.dataset_fantasy_cards hon ft.token_id = h.token_idgroup by 1, 2, 3) tradeson mints.month = trades.month and mints.hero_id = trades.hero_id and mints.rarity = trades.rarityleft outer join (select distinct handle, name, id from dune.hildobby.dataset_fantasy_heroes) hon mints.hero_id = h.idwhere avg_usd_price is not null and mints.month = cast('{{month_string}}' as date)order by mints.month desc, num_minted desc)