Skip to content

Commit

Permalink
ignore inactive liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
LpcAries committed Apr 16, 2024
1 parent c1d6b24 commit b82afa7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions adapters/izumiswap/src/utils/subgraphDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ export const getLPValueByUserAndPoolFromPositions = (
let result = new Map<string, Map<string, UserTokenBalanceInfo>>();
for (let i = 0; i < positions.length; i++) {
let position = positions[i];

let positionWithUSDValue = getPositionDetailsFromPosition(position);
if (positionWithUSDValue.token0DecimalValue == 0 || positionWithUSDValue.token1DecimalValue == 0){
continue
}

let tokenXAddress = position.tokenX.id;
let tokenYAddress = position.tokenY.id;
let owner = position.owner;
Expand All @@ -281,8 +287,7 @@ export const getLPValueByUserAndPoolFromPositions = (
if (tokenYAmount === undefined) {
tokenYAmount = {tokenBalance: new BigNumber(0), tokenSymbol: position.tokenY.symbol, usdPrice: 0};
}

let positionWithUSDValue = getPositionDetailsFromPosition(position);

tokenXAmount.tokenBalance = tokenXAmount.tokenBalance.plus(new BigNumber(positionWithUSDValue.token0DecimalValue));
tokenYAmount.tokenBalance = tokenYAmount.tokenBalance.plus(new BigNumber(positionWithUSDValue.token1DecimalValue));

Expand Down

0 comments on commit b82afa7

Please sign in to comment.