From 0a317f23eb1b9f9d2fe29c77d654d27cc3a17663 Mon Sep 17 00:00:00 2001 From: Himess Date: Thu, 16 Jul 2026 03:55:09 +0300 Subject: [PATCH] fix(ilRisk): don't collapse ETHFI/sETHFI into the ETH family checkIlRisk substring-matches each token against a hardcoded L1 list, so 'ethfi'.includes('eth') collapses ETHFI into the ETH family and mislabels ETHFI/ETH pools as ilRisk "no" (ETHFI is Ether.fi's governance token, uncorrelated with ETH). Add a notCorrelated exception set so tokens that merely contain an L1 substring don't collapse. 11 live pools (~$1.54M) flip to the correct "yes"; 0 regressions across all 15,410 pools. --- src/handlers/triggerEnrichment.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/handlers/triggerEnrichment.js b/src/handlers/triggerEnrichment.js index a890bd566c..450cb85cbb 100644 --- a/src/handlers/triggerEnrichment.js +++ b/src/handlers/triggerEnrichment.js @@ -375,6 +375,10 @@ const enrich = (pool, days, offsets) => { // 3: - more than 1 asset but same underlying assets const checkIlRisk = (el) => { const l1Token = ['btc', 'eth', 'avax', 'matic', 'eur', 'link', 'sushi']; + // tokens that merely CONTAIN an l1Token substring but are NOT correlated with it + // (independent governance/utility tokens). Without this, e.g. 'ethfi'.includes('eth') + // collapses ETHFI into the ETH family and mislabels ETHFI-ETH pools as ilRisk 'no'. + const notCorrelated = ['ethfi', 'sethfi', 'ethdydx', 'ethix']; const symbol = el.symbol.toLowerCase(); const tokens = symbol.split('-'); @@ -393,6 +397,7 @@ const checkIlRisk = (el) => { } else { const elements = []; for (const t of tokens) { + if (notCorrelated.includes(t)) continue; for (const x of l1Token) { if (t.includes(x)) { elements.push(x);