diff --git a/package.json b/package.json index 8087e3fa..a8290102 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "2.0.21", + "version": "2.0.22", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib", diff --git a/src/dex/index.ts b/src/dex/index.ts index d88bbdd1..d3b9a387 100644 --- a/src/dex/index.ts +++ b/src/dex/index.ts @@ -238,9 +238,9 @@ export class DexAdapterService { return side === SwapSide.SELL ? this.sellAdapters : this.buyAdapters; } - getDexKeySpecial(dexKey: string) { + getDexKeySpecial(dexKey: string, isAdapters: boolean = false) { dexKey = dexKey.toLowerCase(); - if (/^paraswappool(.*)/i.test(dexKey)) return 'zerox'; + if (!isAdapters && /^paraswappool(.*)/i.test(dexKey)) return 'zerox'; else if ('uniswapforkoptimized' === dexKey) { if (!this.uniswapV2Alias) throw new Error( @@ -252,7 +252,7 @@ export class DexAdapterService { } getAdapter(dexKey: string, side: SwapSide) { - const specialDexKey = this.getDexKeySpecial(dexKey); + const specialDexKey = this.getDexKeySpecial(dexKey, true); return side === SwapSide.SELL ? this.sellAdapters[specialDexKey] : this.buyAdapters[specialDexKey];