Skip to content

Commit

Permalink
Merge pull request #842 from paraswap/fix/zk-evm-missing-pools
Browse files Browse the repository at this point in the history
fix/BACK-1773
  • Loading branch information
KanievskyiDanylo authored Nov 28, 2024
2 parents c834699 + a7efb6b commit d60a751
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
39 changes: 20 additions & 19 deletions src/dex/algebra/algebra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -168,23 +168,24 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
// 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,
);
}
}

/*
Expand Down
3 changes: 1 addition & 2 deletions src/dex/algebra/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const AlgebraConfig: DexConfigMap<DexParams> = {
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',
Expand Down
3 changes: 1 addition & 2 deletions src/dex/uniswap-v3/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ export const UniswapV3Config: DexConfigMap<DexParams> = {
chunksCount: 5,
initRetryFrequency: 30,
initHash: `0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54`,
subgraphURL:
'https://api.studio.thegraph.com/query/44554/uniswap-v3/version/latest',
subgraphURL: 'E9PLkFzXVX1a9YFtLLyXmLV93ihAUFCvgrnrdnTrnFeN',
},
},
SpookySwapV3: {
Expand Down

0 comments on commit d60a751

Please sign in to comment.