diff --git a/src/ports/catalog/queries.ts b/src/ports/catalog/queries.ts index 574e123..1f5707c 100644 --- a/src/ports/catalog/queries.ts +++ b/src/ports/catalog/queries.ts @@ -696,7 +696,7 @@ export const getCollectionsItemsCatalogQueryWithTrades = (filters: CatalogQueryF SQL`.order AS orders WHERE orders.status = 'open' - AND orders.expires_normalized > NOW() ` + AND orders.expires_at_normalized > NOW() AND nft.owner_address = orders.owner` ) ) .append(getOrderRangePriceWhere(filters)) diff --git a/src/ports/nfts/ensQueries.ts b/src/ports/nfts/ensQueries.ts index 8f1db8e..1b74caa 100644 --- a/src/ports/nfts/ensQueries.ts +++ b/src/ports/nfts/ensQueries.ts @@ -56,12 +56,12 @@ export function getENSs(nftFilters: GetNFTsFilters): SQLStatement { SELECT o.nft_id, o.status, - o.expires_normalized + o.expires_at_normalized FROM squid_marketplace.order o WHERE o.status = 'open' - AND o.expires_normalized > now() + AND o.expires_at_normalized > now() )` : SQL`` ) diff --git a/src/ports/nfts/landQueries.ts b/src/ports/nfts/landQueries.ts index fafc55e..e0db90c 100644 --- a/src/ports/nfts/landQueries.ts +++ b/src/ports/nfts/landQueries.ts @@ -81,7 +81,7 @@ function getAllLANDWheres(filters: GetNFTsFilters & { rentalAssetsIds?: string[] function getOpenOrderNFTsCTE(filters: GetNFTsFilters): SQLStatement { const FILTER_IS_ON_SALE = filters.isOnSale - ? SQL`nft.active_order_id IS NOT NULL AND o.status = 'open' AND o.expires_normalized > NOW()` + ? SQL`nft.active_order_id IS NOT NULL AND o.status = 'open' AND o.expires_at_normalized > NOW()` : null const { @@ -306,7 +306,7 @@ export function getAllLANDsQuery(filters: GetNFTsFilters) { JOIN squid_marketplace.nft nft ON nft.id = top_land.id JOIN squid_marketplace."order" o ON nft.active_order_id = o.id WHERE o.status = 'open' - AND o.expires_normalized > NOW() + AND o.expires_at_normalized > NOW() )` .append(getTradesCTE(filters)) .append(getOpenTradesCTE(filters)) diff --git a/src/ports/nfts/queries.ts b/src/ports/nfts/queries.ts index af67421..1786dfb 100644 --- a/src/ports/nfts/queries.ts +++ b/src/ports/nfts/queries.ts @@ -624,7 +624,7 @@ function getRecentlyListedNFTsCTE(nftFilters: GetNFTsFilters): SQLStatement { FROM squid_marketplace."order" WHERE status = 'open' - AND expires_normalized > NOW() + AND expires_at_normalized > NOW() ` .append( nftFilters.isLand @@ -635,7 +635,7 @@ function getRecentlyListedNFTsCTE(nftFilters: GetNFTsFilters): SQLStatement { ) .append( SQL` - ORDER BY expires_normalized DESC NULLS LAST + ORDER BY expires_at_normalized DESC NULLS LAST LIMIT 24 ), nfts_with_orders AS ( diff --git a/src/ports/orders/queries.ts b/src/ports/orders/queries.ts index f9cb752..4a34f62 100644 --- a/src/ports/orders/queries.ts +++ b/src/ports/orders/queries.ts @@ -130,7 +130,7 @@ function getOrdersAndTradesFilters(filters: OrderFilters & { nftIds?: string[] } const FILTER_ORDER_BY_ITEM_ID = filters.itemId ? SQL` ord.item_id = ${`${filters.contractAddress}-${filters.itemId}`} ` : null const FILTER_TRADE_BY_ITEM_ID = filters.itemId ? SQL` item_id = ${filters.itemId} ` : null const FILTER_BY_NFT_ID = filters.nftIds ? SQL` nft_id = ANY(${filters.nftIds}) ` : null - const FILTER_ORDER_NOT_EXPIRED = SQL` expires_normalized > NOW() ` + const FILTER_ORDER_NOT_EXPIRED = SQL` expires_at_normalized > NOW() ` const FILTER_TRADE_NOT_EXPIRED = SQL` expires_at > EXTRACT(EPOCH FROM now()::timestamptz(3)) ` const COMMON_FILTERS = [