diff --git a/src/util/calculators/uniswapV2.ts b/src/util/calculators/uniswapV2.ts index b0f1a033..f5af4d13 100644 --- a/src/util/calculators/uniswapV2.ts +++ b/src/util/calculators/uniswapV2.ts @@ -259,8 +259,8 @@ async function getTvl( ); subPools.forEach((subPool, index) => { token01Infos[subPool] = {}; - token01Infos[subPool].token0 = tokens0[index].toLowerCase(); - token01Infos[subPool].token1 = tokens1[index].toLowerCase(); + token01Infos[subPool].token0 = tokens0[index]; + token01Infos[subPool].token1 = tokens1[index]; }); } else { const tokens01 = await bulk_reserves_contract.methods @@ -333,7 +333,8 @@ async function getTvl( token01Infos[reserve.pool_address].token0 && reserve.reserve0 ) { - const token = token01Infos[reserve.pool_address].token0.toLowerCase(); + const token = + token01Infos[reserve.pool_address]?.token0?.toLowerCase(); if (!balances[token]) { balances[token] = BigNumber(0); } @@ -346,7 +347,8 @@ async function getTvl( token01Infos[reserve.pool_address].token1 && reserve.reserve1 ) { - const token = token01Infos[reserve.pool_address].token1.toLowerCase(); + const token = + token01Infos[reserve.pool_address]?.token1?.toLowerCase(); if (!balances[token]) { balances[token] = BigNumber(0); }