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_listings-- where call_block_time >= now() - interval '1' yearwhere call_block_time <= now()),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 = 0xDbB97AA933174361D3638B37862B030A7007606A then 'The Beacon Founding Characters1'-- when nftAddress = 0x990eb28e378659b93a29d46ff41f08dc6316dd98 then 'The Beacon Founding Characters2'when nftAddress = 0xfFBcdB5d402477d385b80dE7dAAa6A5C14F5eebC then 'The Beacon Items'when nftAddress = 0xC7196FD8AEf0870F51D3C6646b5152F6Fe35A40b then 'The Beacon Eggs1'when nftAddress = 0x02B035994F016bA6CCdfB1A02ddA243125Fb6340 then 'The Beacon Eggs2'when nftAddress = 0xD72089D51b7cE30C7B543cf7BB70398D1fb79c17 then 'The Beacon Eggs3'when nftAddress = 0x77Aa1488e0BA0E06e34B3e0b49A517469e88f06A then 'The Beacon Eggs4'when nftAddress = 0x813159A767F1c82ae8656897d5B9876c1Eb84BD8 then 'The Beacon Eggs5'when nftAddress = 0x381227255ef6c5d85966b78d13e4b4a4c8719b5e then 'Tales of Elleria: Relics'when nftAddress = 0x7480224ec2b98f28cee3740c80940a2f489bf352 then 'Tales of Elleria: Heroes'when nftAddress = 0xce3051ff2ed963406b55ef505751ef88b8f0d791 then 'Realm: Collectibles'when nftAddress = 0x8ec68f970e1c61b44b6d81c3b78ca931c6ffc92d then 'Realm: Article Particle Reactor'when nftAddress = 0x4de95c1e202102e22e801590c51d7b979f167fbb then 'Realm'when nftAddress = 0x6325439389e0797ab35752b4f43a14c004f22a9c then 'Smol Brains'when nftAddress = 0x17dacad7975960833f374622fad08b90ed67d1b5 then 'Smol Bodies'when nftAddress = 0xc5295c6a183f29b7c962df076819d44e0076860e then 'Smol Relics'when nftAddress = 0x0dD35869e1C11767Aa044da506e4d31459A9d028 then 'Smol Age'-- when nftAddress = 0x00000000016c35e3613ad3ed484aa48f161b67fd then 'Smithonia'-- when nftAddress = 0x09cae384c6626102abe47ff50588a1dbe8432174 then 'Toadstoolz'when nftAddress = 0x10e49b96a4bb66bef39b27c3a9d81ae19908c65d then 'Battlefly 1155' -- ERC1155when nftAddress = 0x0af85a5624d24e2c6e7af3c0a0b102a28e36cea3 then 'Battlefly 721'-- else 'Other'-- when nftAddress = 0x1aaEC0Fa487A979A3F6B46DCCf0aC2648167a61E then 'CryptoGenerals'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.paymentToken-- where evt_block_time >= now() - Interval '1' yearwhere call_block_time <= now()group by 1, 2, 3, 4, pricePerItem, quantity, evt_block_time)