Query editor
-- show schemas from delta_prod like '%treasure%'-- treasure_arbitrum, treasure_beacon_arbitrum, treasure_bridgeworld_arbitrum, treasure_dao_arbitrum, treasure_magicswap_arbitrum, treasure_trove_arbitrumwith trove as (select 0x09986B4e255B3c548041a30A2Ee312Fe176731c2 as wallet, 'Marketplace' as address_type, 'Trove' as contractunion allselect 0x2e3b85f85628301a0bce300dee3a6b04195a15ee as wallet, 'Marketplace' as address_type, 'Trove' as contract),collections as (select * from treasure_trove_arbitrum.TreasureMarketplaceV2_call_listingswhere call_block_time >= now() - interval '1' month),treasure_trove_arbitrum as (select distinct nftAddress as nft,(CASEwhen nftAddress = 0xebba467ecb6b21239178033189ceae27ca12eadf then 'Bridgeworld: Treasures'when nftAddress = 0xf3d00a2559d84de7ac093443bcaada5f4ee4165c then 'Bridgeworld: Consumables'when nftAddress = 0xfe8c1ac365ba6780aec5a985d989b327c27670a1 then 'Bridgeworld: Legions'when nftAddress = 0xf3d00a2559d84de7ac093443bcaada5f4ee4165c then 'Bridgeworld: Consumables'when nftAddress = 0x990eb28e378659b93a29d46ff41f08dc6316dd98 then 'The Beacon'when nftAddress = 0x381227255ef6c5d85966b78d13e4b4a4c8719b5e then 'Tales of Eleria: Relics'when nftAddress = 0x7480224ec2b98f28cee3740c80940a2f489bf352 then 'Tales of Elleria: Heroes'when nftAddress = 0xce3051ff2ed963406b55ef505751ef88b8f0d791 then 'Realm: Collectibles'when nftAddress = 0x6325439389e0797ab35752b4f43a14c004f22a9c then 'Smol Brains'when nftAddress = 0xc5295c6a183f29b7c962df076819d44e0076860e then 'Smol Relics'when nftAddress = 0x8ec68f970e1c61b44b6d81c3b78ca931c6ffc92d then 'Realm: Article Particle Reactor'when nftAddress = 0x4de95c1e202102e22e801590c51d7b979f167fbb then 'Realm'when nftAddress = 0x00000000016c35e3613ad3ed484aa48f161b67fd then 'Smithonia'when nftAddress = 0x09cae384c6626102abe47ff50588a1dbe8432174 then 'Toadstoolz'when nftAddress = 0x0af85a5624d24e2c6e7af3c0a0b102a28e36cea3 then 'Battlefly'when nftAddress = 0x0dD35869e1C11767Aa044da506e4d31459A9d028 then 'Smol Age'when nftAddress = 0x10e49b96a4bb66bef39b27c3a9d81ae19908c65d then 'Battlefly'when nftAddress = 0x17dacad7975960833f374622fad08b90ed67d1b5 then 'Smol Bodies'when nftAddress = 0x1aaEC0Fa487A979A3F6B46DCCf0aC2648167a61E then 'CryptoGenerals' else 'Other'END) as collection_names,date_trunc('day', evt_block_time) as dt,paymentToken as pay_token,count(distinct bidder) as unique_bids,count(*) as total_txs,sum(cast(pricePerItem as double) * cast(quantity as double)) over (partition by nftAddress order by evt_block_time) as price_perfrom treasure_trove_arbitrum.TreasureMarketplaceV2_evt_BidAccepted ttainner join collections c on c.output_paymentTokenAddress = tta.paymentTokenwhere evt_block_time >= now() - Interval '1' monthgroup by 1, 2, 3, 4, pricePerItem, quantity, evt_block_time)select collection_names,(CASE when pay_token = 0x539bde0d7dbd336b79148aa742883198bbf60342 then 'MAGIC' else 'Other'END) as pay_token,sum(total_txs) over (partition by collection_names) as txs_per_collection,sum(unique_bids) as unique_bids,avg(((price_per * p.price) /total_txs) / 1e18) as pricefrom treasure_trove_arbitrum tinner join prices.usd p on p.minute = t.dt and p.contract_address = t.pay_tokengroup by 1, 2, total_txsorder by 1, 5 desc