diff --git a/package.json b/package.json index c0013a5be..3eec4438b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "2.37.0", + "version": "2.37.1", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib", diff --git a/src/dex/hashflow/hashflow.ts b/src/dex/hashflow/hashflow.ts index dc7dbd2ff..e64bf8675 100644 --- a/src/dex/hashflow/hashflow.ts +++ b/src/dex/hashflow/hashflow.ts @@ -62,6 +62,7 @@ export class Hashflow extends SimpleExchange implements IDex { readonly isStatePollingDex = true; readonly hasConstantPriceLargeAmounts = false; readonly needWrapNative = false; + readonly needsSequentialPreprocessing = true; readonly isFeeOnTransferSupported = false; private api: HashflowApi; private rateFetcher: RateFetcher; @@ -737,7 +738,7 @@ export class Hashflow extends SimpleExchange implements IDex { ); await this.setBlacklist(options.txOrigin); } else { - if(e instanceof TooStrictSlippageCheckError) { + if (e instanceof TooStrictSlippageCheckError) { this.logger.warn( `${this.dexKey}-${this.network}: Market Maker ${mm} failed to build transaction on side ${side} with too strict slippage. Skipping restriction`, ); diff --git a/src/dex/idex.ts b/src/dex/idex.ts index a5e35cde4..3dd20f53d 100644 --- a/src/dex/idex.ts +++ b/src/dex/idex.ts @@ -20,6 +20,7 @@ import { IDexHelper } from '../dex-helper/idex-helper'; export interface IDexTxBuilder { needWrapNative: boolean; + needsSequentialPreprocessing?: boolean; // Returns the ETH fee required to swap // It is optional for a DEX to implement this diff --git a/src/dex/index.ts b/src/dex/index.ts index 4595ad24f..389106deb 100644 --- a/src/dex/index.ts +++ b/src/dex/index.ts @@ -315,4 +315,10 @@ export class DexAdapterService { ? this.sellAdapters[specialDexKey] : this.buyAdapters[specialDexKey]; } + + doesPreProcessingRequireSequentiality(dexKey: string): boolean { + const dex = this.getDexByKey(dexKey); + + return !!dex.needsSequentialPreprocessing; + } } diff --git a/src/dex/uniswap-v3/config.ts b/src/dex/uniswap-v3/config.ts index 816d1d4e0..5a2a8d819 100644 --- a/src/dex/uniswap-v3/config.ts +++ b/src/dex/uniswap-v3/config.ts @@ -273,7 +273,7 @@ export const UniswapV3Config: DexConfigMap = { 'https://api.studio.thegraph.com/query/44554/uniswap-v3/version/latest', }, }, - 'Retro': { + Retro: { [Network.POLYGON]: { factory: '0x91e1B99072f238352f59e58de875691e20Dc19c1', quoter: '0xfe08be075758935cb6cb9318d1fbb60920416d4e', @@ -284,8 +284,7 @@ export const UniswapV3Config: DexConfigMap = { chunksCount: 10, initRetryFrequency: 10, initHash: `0x817e07951f93017a93327ac8cc31e946540203a19e1ecc37bc1761965c2d1090`, - subgraphURL: - 'https://api.thegraph.com/subgraphs/name/ruvlol/univ3-test', + subgraphURL: 'https://api.thegraph.com/subgraphs/name/ruvlol/univ3-test', }, }, }; diff --git a/src/dex/uniswap-v3/uniswap-v3-integration.test.ts b/src/dex/uniswap-v3/uniswap-v3-integration.test.ts index 640ff7546..75a27e43d 100644 --- a/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +++ b/src/dex/uniswap-v3/uniswap-v3-integration.test.ts @@ -1101,7 +1101,6 @@ describe('SushiSwapV3', () => { }); }); - describe('Retro', () => { const dexKey = 'Retro'; @@ -1233,14 +1232,10 @@ describe('Retro', () => { }); it('getTopPoolsForToken', async function () { - const poolLiquidity = await retro.getTopPoolsForToken( - TokenB.address, - 10, - ); + const poolLiquidity = await retro.getTopPoolsForToken(TokenB.address, 10); console.log(`${TokenASymbol} Top Pools:`, poolLiquidity); checkPoolsLiquidity(poolLiquidity, TokenB.address, dexKey); }); }); - });