From e836ade21ad7d0e42d4b8bff603844d57cbe33e0 Mon Sep 17 00:00:00 2001 From: vrtnd Date: Mon, 4 Sep 2023 15:12:14 +0300 Subject: [PATCH] fix --- src/utils/aggregate.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/aggregate.ts b/src/utils/aggregate.ts index a4b3bcea..0898fcae 100644 --- a/src/utils/aggregate.ts +++ b/src/utils/aggregate.ts @@ -247,7 +247,7 @@ export const aggregateData = async ( if (!is_usd_volume) { if (!token || !chain) return; const tokenL = token.toLowerCase(); - uniqueTokens[transformTokens[chain][tokenL] ?? `${chain}:${tokenL}`] = true; + uniqueTokens[transformTokens[chain]?.[tokenL] ?? `${chain}:${tokenL}`] = true; } }) ); @@ -285,8 +285,8 @@ export const aggregateData = async ( usdValue = rawBnAmount.toNumber(); } else { const tokenL = token.toLowerCase(); - const transformedDecimals = transformTokenDecimals[chain][tokenL] ?? null; - tokenKey = transformTokens[chain][tokenL] ?? `${chain}:${tokenL}`; + const transformedDecimals = transformTokenDecimals[chain]?.[tokenL] ?? null; + tokenKey = transformTokens[chain]?.[tokenL] ?? `${chain}:${tokenL}`; if (blacklist.includes(tokenKey)) { console.log(`${tokenKey} in blacklist. Skipping`); return;