Query editor
-- select project, version, count(*) from nft.trades-- group by 1,2-- order by 3 descwith seaport_royalties as (select day, sum(royalty_fee) as seaport_royalties_paid from(select day, evt_tx_hash, max(royalty_fee) as royalty_fee from(select date_trunc('day', nt.block_time) as day, seaport_logs.evt_tx_hash, seaport_logs.consideration_amount*p.price as royalty_fee from nft.trades ntleft join(select evt_tx_hash, evt_block_time, cast(json_extract(val, '$["recipient"]') as varchar(42)) as consideration_recipient, cast(json_extract(val, '$["amount"]') as decimal(38,0))/power(10,18) as consideration_amountfrom seaport_ethereum.Seaport_evt_OrderFulfilled, unnest(consideration) as vals(val)where cast(json_extract(val, '$["token"]') as varchar(42)) in (0x0000000000000000000000000000000000000000, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)and cast(json_extract(val, '$["recipient"]') as varchar(42)) not in (0x5b3256965e7c3cf26e11fcaf296dfc8807c01073,0x8de9c5a032463c561423387a9648c5c7bcc5bc90, 0x34ba0f2379bf9b81d09f7259892e26a8b0885095, 0x0000a26b00c1f0df003000390027140000faa719)) seaport_logson nt.tx_hash = seaport_logs.evt_tx_hashleft join(select * from prices.usd where blockchain = 'ethereum' and symbol = 'WETH') pon date_trunc('minute', nt.block_time) = p.minutewhere nt.project = 'opensea'and nt.blockchain = 'ethereum'and nt.version in ('v3')and nt.currency_symbol in ('ETH','WETH')and seaport_logs.consideration_recipient <> nt.seller) dedupgroup by 1, 2) seaport_finalgroup by 1order by 1 desc),wyvern_royalties as (select date_trunc('day', block_time) as day, sum(royalty_fee) as wyvern_royalties_paidfrom(select tx_hash, block_time, max(royalty_fee) as royalty_fee from(select nt.tx_hash, block_time,case when((case when total_eth_received is null then 0 else total_eth_received end+case when total_weth_received is null then 0 else total_weth_received end)-(amount_original*0.025))*p.price< 0 then 0 else((case when total_eth_received is null then 0 else total_eth_received end+case when total_weth_received is null then 0 else total_weth_received end)-(amount_original*0.025))*p.priceendas royalty_fee from nft.trades ntleft join(select tx_hash, sum(cast(value as decimal(38,0))/power(10,18)) as total_eth_received from ethereum.traceswhere "to" in (0x5b3256965e7c3cf26e11fcaf296dfc8807c01073,0x8de9c5a032463c561423387a9648c5c7bcc5bc90, 0x34ba0f2379bf9b81d09f7259892e26a8b0885095, 0x0000a26b00c1f0df003000390027140000faa719)and tx_success = truegroup by 1) opensea_eth_feeson nt.tx_hash = opensea_eth_fees.tx_hashleft join(select evt_tx_hash as tx_hash, sum(cast(value as decimal(38,0))/power(10,18)) as total_weth_received from erc20_ethereum.evt_Transferwhere "to" in (0x5b3256965e7c3cf26e11fcaf296dfc8807c01073,0x8de9c5a032463c561423387a9648c5c7bcc5bc90, 0x34ba0f2379bf9b81d09f7259892e26a8b0885095, 0x0000a26b00c1f0df003000390027140000faa719)