From 8b27bd7b978e8e890e08a8f3363294e29d429bc8 Mon Sep 17 00:00:00 2001 From: franz Date: Mon, 6 Nov 2023 13:30:41 +0100 Subject: [PATCH] dont filter bpt in nested phantomstable --- modules/pool/lib/pool-gql-loader.service.ts | 56 ++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/modules/pool/lib/pool-gql-loader.service.ts b/modules/pool/lib/pool-gql-loader.service.ts index 302785ba7..b381545ee 100644 --- a/modules/pool/lib/pool-gql-loader.service.ts +++ b/modules/pool/lib/pool-gql-loader.service.ts @@ -1001,38 +1001,36 @@ export class PoolGqlLoaderService { __typename: 'GqlPoolPhantomStableNested', ...pool, nestingType: this.getPoolNestingType(pool), - tokens: pool.tokens - .filter((token) => token.address !== pool.address) - .map((token) => { - const nestedPool = token.nestedPool; + tokens: pool.tokens.map((token) => { + const nestedPool = token.nestedPool; - if (nestedPool && nestedPool.type === 'LINEAR') { - const totalShares = parseFloat(nestedPool.dynamicData?.totalShares || '0'); - const percentOfLinearSupplyNested = - totalShares > 0 ? parseFloat(token.dynamicData?.balance || '0') / totalShares : 0; + if (nestedPool && nestedPool.type === 'LINEAR') { + const totalShares = parseFloat(nestedPool.dynamicData?.totalShares || '0'); + const percentOfLinearSupplyNested = + totalShares > 0 ? parseFloat(token.dynamicData?.balance || '0') / totalShares : 0; - return { - ...this.mapPoolTokenToGql({ - ...token, - dynamicData: token.dynamicData - ? { - ...token.dynamicData, - balance: `${parseFloat(token.dynamicData.balance) * percentOfSupplyNested}`, - } - : null, - }), - __typename: 'GqlPoolTokenLinear', - ...this.getLinearPoolTokenData(token, nestedPool), - pool: this.mapNestedPoolToGqlPoolLinearNested( - nestedPool, - percentOfSupplyNested * percentOfLinearSupplyNested, - ), - totalBalance: token.dynamicData?.balance || '0', - }; - } + return { + ...this.mapPoolTokenToGql({ + ...token, + dynamicData: token.dynamicData + ? { + ...token.dynamicData, + balance: `${parseFloat(token.dynamicData.balance) * percentOfSupplyNested}`, + } + : null, + }), + __typename: 'GqlPoolTokenLinear', + ...this.getLinearPoolTokenData(token, nestedPool), + pool: this.mapNestedPoolToGqlPoolLinearNested( + nestedPool, + percentOfSupplyNested * percentOfLinearSupplyNested, + ), + totalBalance: token.dynamicData?.balance || '0', + }; + } - return this.mapPoolTokenToGql(token); - }), + return this.mapPoolTokenToGql(token); + }), totalLiquidity: `${pool.dynamicData?.totalLiquidity || 0}`, totalShares: pool.dynamicData?.totalShares || '0', swapFee: pool.dynamicData?.swapFee || '0',