Skip to content

Commit

Permalink
fix: Enable unbalanced PI for protocolVersion 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrantuk committed Nov 6, 2024
1 parent b927594 commit af74a48
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/entities/priceImpact/addLiquidityNested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ export async function addLiquidityNested(
input: AddLiquidityNestedInput,
nestedPoolState: NestedPoolState,
): Promise<PriceImpactAmount> {
if (nestedPoolState.protocolVersion === 1)
throw Error('Nested Price Impact not supported for protocolVersion 1');

const addLiquidity = new AddLiquidity();
const addLiquidityBoosted = new AddLiquidityBoostedV3();
// sort pools from child to parent
Expand Down Expand Up @@ -102,7 +99,7 @@ async function getAddUnbalancedResult(
rpcUrl: string,
pool: NestedPoolV2,
amountsIn: InputAmount[],
protocolVersion: 2 | 3,
protocolVersion: 1 | 2 | 3,
): Promise<AddResult> {
const addLiquidityInput: AddLiquidityUnbalancedInput = {
chainId,
Expand Down

0 comments on commit af74a48

Please sign in to comment.