diff --git a/sdks/v4-sdk/src/entities/pool.ts b/sdks/v4-sdk/src/entities/pool.ts index db67f193..c6645421 100644 --- a/sdks/v4-sdk/src/entities/pool.ts +++ b/sdks/v4-sdk/src/entities/pool.ts @@ -12,7 +12,7 @@ import { } from '@uniswap/v3-sdk' import { defaultAbiCoder, isAddress } from 'ethers/lib/utils' import { sortsBefore } from '../utils/sortsBefore' -import { HookOptions, Hook } from '../utils/hook' +import { Hook } from '../utils/hook' import { ADDRESS_ZERO, NEGATIVE_ONE, Q192 } from '../internalConstants' import JSBI from 'jsbi' @@ -300,7 +300,7 @@ export class Pool { amountSpecified: JSBI, sqrtPriceLimitX96?: JSBI ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> { - if (!this.hookHasSwapPermissions()) { + if (!this.hookImpactsSwap()) { return v3Swap( JSBI.BigInt(this.fee), this.sqrtRatioX96, @@ -317,9 +317,9 @@ export class Pool { } } - private hookHasSwapPermissions(): boolean { - return ( - Hook.hasPermission(this.hooks, HookOptions.BeforeSwap) || Hook.hasPermission(this.hooks, HookOptions.AfterSwap) - ) + private hookImpactsSwap(): boolean { + // could use this function to clear certain hooks that may have swap Permissions, but we know they don't interfere + // in the swap outcome + return Hook.hasSwapPermissions(this.hooks) } }