Query editor
-- in alloy ERC-1155 Token ID 1000000000 0x4fDfc1B53Fd1D80d969C984ba7a8CE4c7bAaD442WITHget_removed_listings AS (-- original query excluded listings with events aavegotchi_diamond_evt_ERC1155ExecutedListing-- BUT this is also emitted for partial-buys i.e. when some amount is still left in the listing-- If all the amount is sold out, then the ListingRemoved event should be emittedSELECT"listingId"FROMaavegotchi_polygon.aavegotchi_diamond_evt_ERC1155ListingCancelledUNION ALLSELECT"listingId"FROMaavegotchi_polygon.aavegotchi_diamond_evt_ERC1155ListingRemoved),get_erc1155_listing_evt AS (SELECT"listingId","seller","quantity","priceInWei"/ 1e18 AS price_ghst,"evt_tx_hash" AS tx_hashFROMaavegotchi_polygon.aavegotchi_diamond_evt_ERC1155ListingAddWHEREerc1155TypeId = cast(1000000000 as uint256)AND erc1155TokenAddress = 0x4fDfc1B53Fd1D80d969C984ba7a8CE4c7bAaD442)SELECTDATE_TRUNC('day', now()) AS day,'Alloy' AS token,min(price_ghst) AS priceFROMget_erc1155_listing_evtWHERENOT "listingId" IN (SELECT * FROM get_removed_listings)