Query editor
with nike_mints_2 as (select * FROM erc721."ERC721_evt_Transfer" as awhere contract_address in('\xc541fc1aa62384ab7994268883f80ef92aac6399', '\xd3f69f10532457d35188895feaa4c20b730ede88')AND "from"='\x0000000000000000000000000000000000000000'),nike_txns_2 as (select distinct a.evt_tx_hash, a.evt_block_time, b.value/1e18 as eth_spent, c.price from nike_mints_2 as aleft join (select *, date_trunc('minute', block_time) as minutejoiner from ethereum.transactions) as bon a.evt_tx_hash = b.hash and evt_block_time = b.block_timeleft join (select minute, price from prices.usd where symbol = 'WETH') as con b.minutejoiner = c.minute),nike_revenue_2 as (select 'Nike' as "Title", sum(eth_spent * price) as revenue_usd from nike_txns_2),nike_mints as (select * FROM erc1155."ERC1155_evt_TransferSingle" as awhere "contract_address" = '\x348FC118bcC65a92dC033A951aF153d14D945312'AND "from"='\x0000000000000000000000000000000000000000'),hoodie_revenue as (select 'Nike' as "Title", sum(case when mint_price_usd < 0 then null else mint_price_usd end*num_minted) as revenue_usdfrom(select hash, num_minted, total_usd_paid/num_minted/10^18 as mint_price_usd from(select et.hash, count(et.value) as num_minted, avg(et.value*peth.price - case when refunds.value is null then 0 else refunds.value*peth.price end) as total_usd_paidfrom ethereum.transactions etleft join(select * from erc721."ERC721_evt_Transfer"where contract_address = '\x212590B0DAc9502e0591b79db4ceDeb6356dcc36'and "from" = '\x0000000000000000000000000000000000000000') transferson et.hash = transfers.evt_tx_hashleft join(select * from ethereum.traceswhere "from" = '\x623FC4F577926c0aADAEf11a243754C546C1F98c'and "success") refundson et.hash = refunds.tx_hash and et."from" = refunds."to"left join (select * from prices.usd where symbol = 'WETH') pethon date_trunc('minute', et.block_time) = peth.minutewhere et."to" = '\x623FC4F577926c0aADAEf11a243754C546C1F98c'and et."value" > 0and et.successgroup by 1) mint_price) mints),nike_joined as (select a.evt_tx_hash, a.evt_block_time, b.value/1e18 as eth_spent, date_trunc('minute', b.block_time) as minute_joiner from nike_mints as aleft join (select * from ethereum.transactions) as bon a.evt_tx_hash = b.hash and a.evt_block_time = b.block_time),nike_usd_revenue as (select a.minute_joiner, (a.eth_spent * b.price) as usd_spent from nike_joined as a