From 0781c818af069c8989ddee9992000c2b52347042 Mon Sep 17 00:00:00 2001 From: 0X-SquidSol Date: Thu, 9 Apr 2026 13:16:25 -0400 Subject: [PATCH] fix: add blocklist filter to /prices/markets endpoint /prices/markets returned price data for blocked slabs (phantom/test markets) while /markets and /funding/global properly filter them out via isBlockedSlab(). Adds the same filter for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/routes/prices.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/prices.ts b/src/routes/prices.ts index 918f05a..2c5c9d7 100644 --- a/src/routes/prices.ts +++ b/src/routes/prices.ts @@ -1,6 +1,6 @@ import { Hono } from "hono"; import { getSupabase, getNetwork, createLogger, truncateErrorMessage } from "@percolator/shared"; -import { validateSlab } from "../middleware/validateSlab.js"; +import { validateSlab, isBlockedSlab } from "../middleware/validateSlab.js"; const logger = createLogger("api:prices"); @@ -15,7 +15,8 @@ export function priceRoutes(): Hono { .eq("network", getNetwork()) .not("slab_address", "is", null); if (error) throw error; - return c.json({ markets: data ?? [] }); + const filtered = (data ?? []).filter((m) => !isBlockedSlab(m.slab_address)); + return c.json({ markets: filtered }); } catch (err) { logger.error("Error fetching market prices", { error: truncateErrorMessage(err instanceof Error ? err.message : String(err), 120),