From 811fae0481958be8b973a09da53ee97b13c2a705 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Thu, 28 Nov 2024 12:42:39 +0200 Subject: [PATCH 1/5] fix: use decentralized subgraphs for zkevm --- src/dex/algebra/config.ts | 3 +-- src/dex/uniswap-v3/config.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dex/algebra/config.ts b/src/dex/algebra/config.ts index ae374b7d1..515145dd6 100644 --- a/src/dex/algebra/config.ts +++ b/src/dex/algebra/config.ts @@ -27,8 +27,7 @@ export const AlgebraConfig: DexConfigMap = { chunksCount: 3, initRetryFrequency: 30, algebraStateMulticall: '0xa6bc273A238867dD74F2bBbD5fBbA3c941C939B9', - subgraphURL: - 'https://api.studio.thegraph.com/query/44554/quickswap-v3-02/0.0.7', + subgraphURL: '3L5Y5brtgvzDoAFGaPs63xz27KdviCdzRuY12spLSBGU', uniswapMulticall: '0x61530d6E1c7A47BBB3e48e8b8EdF7569DcFeE121', deployer: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', version: 'v1.1', diff --git a/src/dex/uniswap-v3/config.ts b/src/dex/uniswap-v3/config.ts index e2b2a0678..363671e15 100644 --- a/src/dex/uniswap-v3/config.ts +++ b/src/dex/uniswap-v3/config.ts @@ -285,8 +285,7 @@ export const UniswapV3Config: DexConfigMap = { chunksCount: 5, initRetryFrequency: 30, initHash: `0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54`, - subgraphURL: - 'https://api.studio.thegraph.com/query/44554/uniswap-v3/version/latest', + subgraphURL: 'E9PLkFzXVX1a9YFtLLyXmLV93ihAUFCvgrnrdnTrnFeN', }, }, SpookySwapV3: { From 75d8230079ccdd0a4d88b2548365360c1b6661cf Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Thu, 28 Nov 2024 12:44:47 +0200 Subject: [PATCH 2/5] 3.11.4-zk-evm.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a653af81d..807bac5d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "3.11.3", + "version": "3.11.4-zk-evm.0", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib", From c25a493fb2a2eca7dd151bacbc1fba2ee334f217 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Thu, 28 Nov 2024 13:23:34 +0200 Subject: [PATCH 3/5] feat: return cleanup not existing pools on algebra --- src/dex/algebra/algebra.ts | 39 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/dex/algebra/algebra.ts b/src/dex/algebra/algebra.ts index b18e65927..559d31092 100644 --- a/src/dex/algebra/algebra.ts +++ b/src/dex/algebra/algebra.ts @@ -61,8 +61,8 @@ type PoolPairsInfo = { const PoolsRegistryHashKey = `${CACHE_PREFIX}_poolsRegistry`; -// const ALGEBRA_CLEAN_NOT_EXISTING_POOL_TTL_MS = 3 * 24 * 60 * 60 * 1000; // 3 days -// const ALGEBRA_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 24 * 60 * 60 * 1000; // Once in a day +const ALGEBRA_CLEAN_NOT_EXISTING_POOL_TTL_MS = 3 * 24 * 60 * 60 * 1000; // 3 days +const ALGEBRA_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 24 * 60 * 60 * 1000; // Once in a day const ALGEBRA_EFFICIENCY_FACTOR = 3; const ALGEBRA_TICK_GAS_COST = 24_000; // Ceiled const ALGEBRA_TICK_BASE_OVERHEAD = 75_000; @@ -168,23 +168,24 @@ export class Algebra extends SimpleExchange implements IDex { // Init listening to new pools creation await this.factory.initialize(blockNumber); - //// COMMENTING DEPRECATED LOGIC: as we now invalidate pools on creation this is not needed anymore - // if (!this.dexHelper.config.isSlave) { - // const cleanExpiredNotExistingPoolsKeys = async () => { - // const maxTimestamp = - // Date.now() - ALGEBRA_CLEAN_NOT_EXISTING_POOL_TTL_MS; - // await this.dexHelper.cache.zremrangebyscore( - // this.notExistingPoolSetKey, - // 0, - // maxTimestamp, - // ); - // }; - - // this.intervalTask = setInterval( - // cleanExpiredNotExistingPoolsKeys.bind(this), - // ALGEBRA_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS, - // ); - // } + if (!this.dexHelper.config.isSlave) { + const cleanExpiredNotExistingPoolsKeys = async () => { + const maxTimestamp = + Date.now() - ALGEBRA_CLEAN_NOT_EXISTING_POOL_TTL_MS; + await this.dexHelper.cache.zremrangebyscore( + this.notExistingPoolSetKey, + 0, + maxTimestamp, + ); + }; + + void cleanExpiredNotExistingPoolsKeys(); + + this.intervalTask = setInterval( + cleanExpiredNotExistingPoolsKeys.bind(this), + ALGEBRA_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS, + ); + } } /* From 39c12a68c16c9af780e8271616f39a6721a66b8c Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Thu, 28 Nov 2024 13:28:35 +0200 Subject: [PATCH 4/5] 3.11.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 807bac5d9..63b88ca1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "3.11.4-zk-evm.0", + "version": "3.11.4", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib", From a7efb6bf0f88a5942ec6c3223ae8285a22df5549 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Thu, 28 Nov 2024 13:30:57 +0200 Subject: [PATCH 5/5] 3.11.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63b88ca1a..96133db84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "3.11.4", + "version": "3.11.5", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib",