Skip to content

Commit

Permalink
Update uniswapV2.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mantasfam committed Sep 18, 2023
1 parent b84da62 commit 895ccc8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/util/calculators/uniswapV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 895ccc8

Please sign in to comment.