From 530676c24c51c6d19a68347fc042e36cdf40c7fe Mon Sep 17 00:00:00 2001 From: Alberto Gualis Date: Thu, 3 Oct 2024 19:33:40 +0200 Subject: [PATCH] chore: add isUnbalancedLiquidityDisabled helper --- lib/modules/pool/pool.helpers.ts | 5 +++++ lib/shared/services/api/pool.graphql | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lib/modules/pool/pool.helpers.ts b/lib/modules/pool/pool.helpers.ts index de8a27a3b..2fd77b453 100644 --- a/lib/modules/pool/pool.helpers.ts +++ b/lib/modules/pool/pool.helpers.ts @@ -325,6 +325,11 @@ export function requiresPermit2Approval(pool: Pool): boolean { return isV3Pool(pool) } +export function isUnbalancedLiquidityDisabled(pool: Pool): boolean { + // 0x8fc07bcf9b88ace84c7523248dc4a85f638c9536 --> pool with that + return !!pool.liquidityManagement?.disableUnbalancedLiquidity +} + export function getRateProviderWarnings(warnings: string[]) { return warnings.filter(warning => !isEmpty(warning)) } diff --git a/lib/shared/services/api/pool.graphql b/lib/shared/services/api/pool.graphql index f98a5b254..5d3017359 100644 --- a/lib/shared/services/api/pool.graphql +++ b/lib/shared/services/api/pool.graphql @@ -13,6 +13,9 @@ query GetPool($id: String!, $chain: GqlChain!, $userAddress: String) { chain protocolVersion tags + liquidityManagement { + disableUnbalancedLiquidity + } dynamicData { poolId swapEnabled @@ -106,6 +109,7 @@ query GetPool($id: String!, $chain: GqlChain!, $userAddress: String) { stakingId } } + ... on GqlPoolWeighted { nestingType poolTokens {