@@ -193,19 +193,9 @@ const DefaultTHead = ({
193193}
194194
195195const DefaultTr = ( { network, metadata, showExtraDetails, batchedCategoryData, dataFeedType } ) => {
196- // Risk categorization logic
197- const contractAddress = metadata . contractAddress || metadata . proxyAddress
198- const networkIdentifier = getNetworkIdentifier ( network )
199- let finalTier =
200- contractAddress && batchedCategoryData ?. size
201- ? ( getFeedCategoryFromBatch ( batchedCategoryData , contractAddress , networkIdentifier , metadata . feedCategory )
202- ?. final ?? metadata . feedCategory )
203- : metadata . feedCategory
204-
205- // Override with deprecating category if feed has shutdown date
206- if ( metadata . docs ?. shutdownDate ) {
207- finalTier = "deprecating"
208- }
196+ // Use the pre-computed finalCategory from enriched metadata
197+ // (already includes deprecating status and Supabase risk tier)
198+ const finalTier = metadata . finalCategory || metadata . feedCategory
209199
210200 // US Government Macroeconomic Data logic
211201 const isUSGovernmentMacroeconomicData = dataFeedType === "usGovernmentMacroeconomicData"
@@ -409,19 +399,9 @@ const SmartDataTr = ({ network, metadata, showExtraDetails, batchedCategoryData
409399 // Only show MVR badge if explicitly flagged as MVR
410400 const finalIsMVRFeed = isMVRFlagSet && hasDecoding
411401
412- // Resolve final category from batch (fallback to metadata)
413- const contractAddress = metadata . contractAddress || metadata . proxyAddress
414- const networkIdentifier = getNetworkIdentifier ( network )
415- let finalTier =
416- contractAddress && batchedCategoryData ?. size
417- ? ( getFeedCategoryFromBatch ( batchedCategoryData , contractAddress , networkIdentifier , metadata . feedCategory )
418- ?. final ?? metadata . feedCategory )
419- : metadata . feedCategory
420-
421- // Override with deprecating category if feed has shutdown date
422- if ( metadata . docs ?. shutdownDate ) {
423- finalTier = "deprecating"
424- }
402+ // Use the pre-computed finalCategory from enriched metadata
403+ // (already includes deprecating status and Supabase risk tier)
404+ const finalTier = metadata . finalCategory || metadata . feedCategory
425405
426406 return (
427407 < tr >
@@ -1121,35 +1101,41 @@ export const MainnetTable = ({
11211101 const isDefault = ! isStreams && ! isSmartData && ! isUSGovernmentMacroeconomicData
11221102 const isDeprecating = ecosystem === "deprecating"
11231103
1124- const filteredMetadata = network . metadata
1125- . sort ( ( a , b ) => ( a . name . toUpperCase ( ) < b . name . toUpperCase ( ) ? - 1 : 1 ) )
1126- . filter ( ( metadata ) => {
1127- // ---
1128- // Categorization logic:
1129- // 1. Try to get the risk category for this feed from Supabase (batchedCategoryData).
1130- // - Uses contractAddress and networkIdentifier as lookup keys.
1131- // - If found, use the DB value; if not, fall back to the default from metadata.
1132- // 2. If the risk category is 'hidden', exclude this feed from the docs.
1133- // ---
1134- const contractAddress = metadata . contractAddress || metadata . proxyAddress
1135- const networkIdentifier = getNetworkIdentifier ( network )
1136- let batchCategory = metadata . feedCategory
1137-
1138- if ( contractAddress && batchedCategoryData ?. size ) {
1139- const categoryResult = getFeedCategoryFromBatch (
1140- batchedCategoryData ,
1141- contractAddress ,
1142- networkIdentifier ,
1143- metadata . feedCategory
1144- )
1145- const finalCategory = categoryResult ?. final ?? null
1146-
1147- if ( finalCategory ) {
1148- batchCategory = finalCategory
1149- }
1104+ // Enrich metadata with final category (combining RDD and Supabase data)
1105+ // Priority: deprecating status from RDD > Supabase risk tier > RDD category fallback
1106+ const enrichedMetadata = network . metadata . map ( ( metadata ) => {
1107+ // Check for deprecating status from RDD first (has shutdown date)
1108+ if ( metadata . docs ?. shutdownDate ) {
1109+ return { ...metadata , finalCategory : "deprecating" }
1110+ }
1111+
1112+ // Otherwise, get risk category from Supabase (or fall back to RDD)
1113+ const contractAddress = metadata . contractAddress || metadata . proxyAddress
1114+ const networkIdentifier = getNetworkIdentifier ( network )
1115+ let finalCategory = metadata . feedCategory
1116+
1117+ if ( contractAddress && batchedCategoryData ?. size ) {
1118+ const categoryResult = getFeedCategoryFromBatch (
1119+ batchedCategoryData ,
1120+ contractAddress ,
1121+ networkIdentifier ,
1122+ metadata . feedCategory
1123+ )
1124+ const supabaseCategory = categoryResult ?. final ?? null
1125+
1126+ if ( supabaseCategory ) {
1127+ finalCategory = supabaseCategory
11501128 }
1129+ }
11511130
1152- if ( batchCategory === "hidden" ) return false
1131+ return { ...metadata , finalCategory }
1132+ } )
1133+
1134+ const filteredMetadata = enrichedMetadata
1135+ . sort ( ( a , b ) => ( a . name . toUpperCase ( ) < b . name . toUpperCase ( ) ? - 1 : 1 ) )
1136+ . filter ( ( metadata ) => {
1137+ // Filter out hidden feeds (from Supabase)
1138+ if ( metadata . finalCategory === "hidden" ) return false
11531139 if ( showOnlySVR && ! metadata . secondaryProxyAddress ) {
11541140 return false
11551141 }
@@ -1181,9 +1167,10 @@ export const MainnetTable = ({
11811167
11821168 return included
11831169 }
1170+ // Filter by final category (Supabase risk tier takes precedence over RDD)
11841171 return (
11851172 selectedFeedCategories . length === 0 ||
1186- selectedFeedCategories . map ( ( cat ) => cat . toLowerCase ( ) ) . includes ( metadata . feedCategory ?. toLowerCase ( ) )
1173+ selectedFeedCategories . map ( ( cat ) => cat . toLowerCase ( ) ) . includes ( metadata . finalCategory ?. toLowerCase ( ) )
11871174 )
11881175 } )
11891176 . filter (
@@ -1339,35 +1326,41 @@ export const TestnetTable = ({
13391326 const isUSGovernmentMacroeconomicData = dataFeedType === "usGovernmentMacroeconomicData"
13401327 const isDefault = ! isSmartData && ! isRates && ! isStreams && ! isUSGovernmentMacroeconomicData
13411328
1342- const filteredMetadata = network . metadata
1343- . sort ( ( a , b ) => ( a . name . toUpperCase ( ) < b . name . toUpperCase ( ) ? - 1 : 1 ) )
1344- . filter ( ( metadata ) => {
1345- // ---
1346- // Categorization logic:
1347- // 1. Try to get the risk category for this feed from Supabase (batchedCategoryData).
1348- // - Uses contractAddress and networkIdentifier as lookup keys.
1349- // - If found, use the DB value; if not, fall back to the default from metadata.
1350- // 2. If the risk category is 'hidden', exclude this feed from the docs.
1351- // ---
1352- const contractAddress = metadata . contractAddress || metadata . proxyAddress
1353- const networkIdentifier = getNetworkIdentifier ( network )
1354- let batchCategory = metadata . feedCategory
1355-
1356- if ( contractAddress && batchedCategoryData ?. size ) {
1357- const categoryResult = getFeedCategoryFromBatch (
1358- batchedCategoryData ,
1359- contractAddress ,
1360- networkIdentifier ,
1361- metadata . feedCategory
1362- )
1363- const finalCategory = categoryResult ?. final ?? null
1364-
1365- if ( finalCategory ) {
1366- batchCategory = finalCategory
1367- }
1329+ // Enrich metadata with final category (combining RDD and Supabase data)
1330+ // Priority: deprecating status from RDD > Supabase risk tier > RDD category fallback
1331+ const enrichedMetadata = network . metadata . map ( ( metadata ) => {
1332+ // Check for deprecating status from RDD first (has shutdown date)
1333+ if ( metadata . docs ?. shutdownDate ) {
1334+ return { ...metadata , finalCategory : "deprecating" }
1335+ }
1336+
1337+ // Otherwise, get risk category from Supabase (or fall back to RDD)
1338+ const contractAddress = metadata . contractAddress || metadata . proxyAddress
1339+ const networkIdentifier = getNetworkIdentifier ( network )
1340+ let finalCategory = metadata . feedCategory
1341+
1342+ if ( contractAddress && batchedCategoryData ?. size ) {
1343+ const categoryResult = getFeedCategoryFromBatch (
1344+ batchedCategoryData ,
1345+ contractAddress ,
1346+ networkIdentifier ,
1347+ metadata . feedCategory
1348+ )
1349+ const supabaseCategory = categoryResult ?. final ?? null
1350+
1351+ if ( supabaseCategory ) {
1352+ finalCategory = supabaseCategory
13681353 }
1354+ }
1355+
1356+ return { ...metadata , finalCategory }
1357+ } )
13691358
1370- if ( batchCategory === "hidden" ) return false
1359+ const filteredMetadata = enrichedMetadata
1360+ . sort ( ( a , b ) => ( a . name . toUpperCase ( ) < b . name . toUpperCase ( ) ? - 1 : 1 ) )
1361+ . filter ( ( metadata ) => {
1362+ // Filter out hidden feeds (from Supabase)
1363+ if ( metadata . finalCategory === "hidden" ) return false
13711364 // Use shared visibility logic with filters
13721365 return isFeedVisible ( metadata , dataFeedType as any , undefined , {
13731366 showOnlyDEXFeeds,
@@ -1389,9 +1382,10 @@ export const TestnetTable = ({
13891382
13901383 return included
13911384 }
1385+ // Filter by final category (Supabase risk tier takes precedence over RDD)
13921386 return (
13931387 selectedFeedCategories . length === 0 ||
1394- selectedFeedCategories . map ( ( cat ) => cat . toLowerCase ( ) ) . includes ( metadata . feedCategory ?. toLowerCase ( ) )
1388+ selectedFeedCategories . map ( ( cat ) => cat . toLowerCase ( ) ) . includes ( metadata . finalCategory ?. toLowerCase ( ) )
13951389 )
13961390 } )
13971391 . filter (
0 commit comments