From 95ba87e21e98c0f9ec64100275a899139a354124 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 10:51:06 +0200 Subject: [PATCH 1/7] Reapply "feat: lazy generate state on uni-v3 & pancake-swap-v3 pools" This reverts commit 2367230895e6815c774bda38d8a2b44898e745a6. --- src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts | 30 +++++++++++++++++++ src/dex/pancakeswap-v3/pancakeswap-v3.ts | 10 +++++++ src/dex/uniswap-v3/uniswap-v3-pool.ts | 30 +++++++++++++++++++ src/dex/uniswap-v3/uniswap-v3.ts | 11 +++++++ 4 files changed, 81 insertions(+) diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts index fc2fdb9f1..c80c08d54 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts @@ -250,6 +250,36 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER; } + async getOrGenerateState( + blockNumber: number, + ): Promise | null> { + const state = this.getState(blockNumber); + if (state) { + return state; + } + + this.logger.error( + `PancakeV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`, + ); + try { + const newState = await this.generateState(blockNumber); + + if (!newState) { + this.logger.error( + `PancakeV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`, + ); + return null; + } + this.setState(newState, blockNumber); + return newState; + } catch (error) { + this.logger.error( + `PancakeV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`, + ); + return null; + } + } + async generateState(blockNumber: number): Promise> { const callData = this._getStateRequestCallData(); diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3.ts b/src/dex/pancakeswap-v3/pancakeswap-v3.ts index fc267ad0f..17248a00a 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3.ts @@ -613,6 +613,10 @@ export class PancakeswapV3 if (selectedPools.length === 0) return null; + await Promise.all( + selectedPools.map(pool => pool.getOrGenerateState(blockNumber)), + ); + const poolsToUse = selectedPools.reduce( (acc, pool) => { let state = pool.getState(blockNumber); @@ -632,6 +636,12 @@ export class PancakeswapV3 }, ); + poolsToUse.poolWithoutState.forEach(pool => { + this.logger.warn( + `PancakeV3: Pool ${pool.name} on ${this.dexKey} has no state. Fallback to rpc`, + ); + }); + const rpcResultsPromise = this.getPricingFromRpc( _srcToken, _destToken, diff --git a/src/dex/uniswap-v3/uniswap-v3-pool.ts b/src/dex/uniswap-v3/uniswap-v3-pool.ts index 2110470b2..b3b9d2143 100644 --- a/src/dex/uniswap-v3/uniswap-v3-pool.ts +++ b/src/dex/uniswap-v3/uniswap-v3-pool.ts @@ -254,6 +254,36 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER; } + async getOrGenerateState( + blockNumber: number, + ): Promise | null> { + const state = this.getState(blockNumber); + if (state) { + return state; + } + + this.logger.error( + `UniV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`, + ); + try { + const newState = await this.generateState(blockNumber); + + if (!newState) { + this.logger.error( + `UniV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`, + ); + return null; + } + this.setState(newState, blockNumber); + return newState; + } catch (error) { + this.logger.error( + `UniV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`, + ); + return null; + } + } + async generateState(blockNumber: number): Promise> { const callData = this._getStateRequestCallData(); diff --git a/src/dex/uniswap-v3/uniswap-v3.ts b/src/dex/uniswap-v3/uniswap-v3.ts index 40defeeae..e9e05771c 100644 --- a/src/dex/uniswap-v3/uniswap-v3.ts +++ b/src/dex/uniswap-v3/uniswap-v3.ts @@ -715,6 +715,10 @@ export class UniswapV3 if (selectedPools.length === 0) return null; + await Promise.all( + selectedPools.map(pool => pool.getOrGenerateState(blockNumber)), + ); + const poolsToUse = selectedPools.reduce( (acc, pool) => { let state = pool.getState(blockNumber); @@ -722,6 +726,7 @@ export class UniswapV3 this.logger.trace( `${this.dexKey}: State === null. Fallback to rpc ${pool.name}`, ); + // as we generate state (if nullified) in previous Promise.all, here should only be pools with failed initialization acc.poolWithoutState.push(pool); } else { acc.poolWithState.push(pool); @@ -734,6 +739,12 @@ export class UniswapV3 }, ); + poolsToUse.poolWithoutState.forEach(pool => { + this.logger.warn( + `UniV3: Pool ${pool.name} on ${this.dexKey} has no state. Fallback to rpc`, + ); + }); + const states = poolsToUse.poolWithState.map( p => p.getState(blockNumber)!, ); From 1b553bf4e1a073e8f403204af83424561d4bd80a Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:03:00 +0200 Subject: [PATCH 2/7] feat: only check pool state for univ3 on pricing --- src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts | 22 ++++-------------- src/dex/pancakeswap-v3/pancakeswap-v3.ts | 2 +- src/dex/uniswap-v3/uniswap-v3-pool.ts | 23 ++++--------------- src/dex/uniswap-v3/uniswap-v3.ts | 2 +- 4 files changed, 10 insertions(+), 39 deletions(-) diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts index c80c08d54..0159fc798 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts @@ -250,7 +250,7 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER; } - async getOrGenerateState( + async checkState( blockNumber: number, ): Promise | null> { const state = this.getState(blockNumber); @@ -259,25 +259,11 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { } this.logger.error( - `PancakeV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`, + `PancakeV3: No state found for ${this.name} ${this.addressesSubscribed[0]} for bn: ${blockNumber}`, ); - try { - const newState = await this.generateState(blockNumber); + return null; + } - if (!newState) { - this.logger.error( - `PancakeV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`, - ); - return null; - } - this.setState(newState, blockNumber); - return newState; - } catch (error) { - this.logger.error( - `PancakeV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`, - ); - return null; - } } async generateState(blockNumber: number): Promise> { diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3.ts b/src/dex/pancakeswap-v3/pancakeswap-v3.ts index 17248a00a..ccc3ddc26 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3.ts @@ -614,7 +614,7 @@ export class PancakeswapV3 if (selectedPools.length === 0) return null; await Promise.all( - selectedPools.map(pool => pool.getOrGenerateState(blockNumber)), + selectedPools.map(pool => pool.checkState(blockNumber)), ); const poolsToUse = selectedPools.reduce( diff --git a/src/dex/uniswap-v3/uniswap-v3-pool.ts b/src/dex/uniswap-v3/uniswap-v3-pool.ts index b3b9d2143..b8a6725a7 100644 --- a/src/dex/uniswap-v3/uniswap-v3-pool.ts +++ b/src/dex/uniswap-v3/uniswap-v3-pool.ts @@ -254,7 +254,7 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER; } - async getOrGenerateState( + async checkState( blockNumber: number, ): Promise | null> { const state = this.getState(blockNumber); @@ -263,25 +263,10 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { } this.logger.error( - `UniV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`, + `UniV3: No state found for ${this.name} ${this.addressesSubscribed[0]} for bn: ${blockNumber}`, ); - try { - const newState = await this.generateState(blockNumber); - - if (!newState) { - this.logger.error( - `UniV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`, - ); - return null; - } - this.setState(newState, blockNumber); - return newState; - } catch (error) { - this.logger.error( - `UniV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`, - ); - return null; - } + return null; + } } async generateState(blockNumber: number): Promise> { diff --git a/src/dex/uniswap-v3/uniswap-v3.ts b/src/dex/uniswap-v3/uniswap-v3.ts index e9e05771c..91eeb74c0 100644 --- a/src/dex/uniswap-v3/uniswap-v3.ts +++ b/src/dex/uniswap-v3/uniswap-v3.ts @@ -716,7 +716,7 @@ export class UniswapV3 if (selectedPools.length === 0) return null; await Promise.all( - selectedPools.map(pool => pool.getOrGenerateState(blockNumber)), + selectedPools.map(pool => pool.checkState(blockNumber)), ); const poolsToUse = selectedPools.reduce( From 78ab510130ab8d5124f3c1539838a44916c28784 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:07:27 +0200 Subject: [PATCH 3/7] feat: add setState logs on UniV3 & forks --- src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts | 11 ++++++ src/dex/uniswap-v3/uniswap-v3-pool.ts | 12 ++++++ src/stateful-event-subscriber.ts | 38 +++++++++++-------- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts index 0159fc798..3145381b8 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts @@ -264,6 +264,17 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { return null; } + _setState(state: any, blockNumber: number, reason?: string): void { + this.logger.info( + `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for ${ + this.name + } ${ + this.addressesSubscribed[0] + } for bn: '${blockNumber}' due to reason: '${ + reason ?? 'outside_of_event_subscriber' + }'`, + ); + super._setState(state, blockNumber); } async generateState(blockNumber: number): Promise> { diff --git a/src/dex/uniswap-v3/uniswap-v3-pool.ts b/src/dex/uniswap-v3/uniswap-v3-pool.ts index b8a6725a7..91a4e5401 100644 --- a/src/dex/uniswap-v3/uniswap-v3-pool.ts +++ b/src/dex/uniswap-v3/uniswap-v3-pool.ts @@ -267,6 +267,18 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { ); return null; } + + _setState(state: any, blockNumber: number, reason?: string): void { + this.logger.info( + `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for ${ + this.name + } ${ + this.addressesSubscribed[0] + } for bn: '${blockNumber}' due to reason: '${ + reason ?? 'outside_of_event_subscriber' + }'`, + ); + super._setState(state, blockNumber); } async generateState(blockNumber: number): Promise> { diff --git a/src/stateful-event-subscriber.ts b/src/stateful-event-subscriber.ts index f89d6a11a..3705cc3f2 100644 --- a/src/stateful-event-subscriber.ts +++ b/src/stateful-event-subscriber.ts @@ -89,14 +89,14 @@ export abstract class StatefulEventSubscriber ) { let masterBn: undefined | number = undefined; if (options && options.state) { - this.setState(options.state, blockNumber); + this.setState(options.state, blockNumber, 'initialize_1'); } else if (options && options.forceRegenerate) { // ZkEVM forces to always regenerate state when it is old this.logger.debug( `${this.parentName}: ${this.name}: forced to regenerate state`, ); const state = await this.generateState(blockNumber); - this.setState(state, blockNumber); + this.setState(state, blockNumber, 'initialize_2'); } else { if (this.dexHelper.config.isSlave && this.masterPoolNeeded) { let stateAsString = await this.dexHelper.cache.hget( @@ -135,14 +135,14 @@ export abstract class StatefulEventSubscriber } // set state and the according blockNumber. state.bn can be smaller, greater or equal // to blockNumber - this.setState(state.state, blockNumber); + this.setState(state.state, blockNumber, 'initialize_3'); } else { // if no state found in cache generate new state using rpc this.logger.info( `${this.parentName}: ${this.name}: did not found state on cache generating new one`, ); const state = await this.generateState(blockNumber); - this.setState(state, blockNumber); + this.setState(state, blockNumber, 'initialize_4'); // we should publish only if generateState succeeded const data = this.getPoolIdentifierData(); @@ -161,7 +161,7 @@ export abstract class StatefulEventSubscriber `${this.parentName}: ${this.name}: cache generating state`, ); const state = await this.generateState(blockNumber); - this.setState(state, blockNumber); + this.setState(state, blockNumber, 'initialize_5'); } } @@ -235,7 +235,7 @@ export abstract class StatefulEventSubscriber this.logger.info( `StatefulEventSubscriber_1 restart, bn: ${blockNumber}, state_bn: ${this.stateBlockNumber}: ${this.parentName}: ${this.name}`, ); - this._setState(null, blockNumber); + this._setState(null, blockNumber, 'restart'); } } @@ -275,7 +275,7 @@ export abstract class StatefulEventSubscriber } if (!this.state) { const freshState = await this.generateState(blockNumber); - this.setState(freshState, blockNumber); + this.setState(freshState, blockNumber, 'update_1'); } //Find the last state before the blockNumber of the logs let stateBeforeLog: DeepReadonly | undefined; @@ -291,7 +291,7 @@ export abstract class StatefulEventSubscriber logs.slice(index, indexBlockEnd), blockHeader, ); - if (nextState) this.setState(nextState, blockNumber); + if (nextState) this.setState(nextState, blockNumber, 'update_2'); } lastBlockNumber = blockNumber; index = indexBlockEnd; @@ -315,7 +315,7 @@ export abstract class StatefulEventSubscriber ); try { const state = await this.generateState(latestBlockNumber); - this.setState(state, latestBlockNumber); + this.setState(state, latestBlockNumber, 'update_3'); return true; } catch (e) { this.logger.error( @@ -346,12 +346,12 @@ export abstract class StatefulEventSubscriber } if (lastBn) { - this._setState(this.stateHistory[lastBn], lastBn); + this._setState(this.stateHistory[lastBn], lastBn, 'rollback_1'); } else { this.logger.info( `StatefulEventSubscriber_1 rollback, bn: ${blockNumber}: ${this.parentName}: ${this.name}`, ); - this._setState(null, blockNumber); + this._setState(null, blockNumber, 'rollback_2'); } } else { //Keep the current state in this.state and in the history @@ -390,7 +390,11 @@ export abstract class StatefulEventSubscriber return this.state; } - _setState(state: DeepReadonly | null, blockNumber: number) { + _setState( + state: DeepReadonly | null, + blockNumber: number, + reason?: string, + ) { if ( this.dexHelper.config.isSlave && this.masterPoolNeeded && @@ -418,7 +422,7 @@ export abstract class StatefulEventSubscriber `${this.parentName}: received state from a scheduled job`, 'info', ); - this.setState(state.state, state.bn); + this.setState(state.state, state.bn, 'addBatchHGet'); return true; }, ); @@ -481,14 +485,18 @@ export abstract class StatefulEventSubscriber //no longer needed. If the blockNumber is greater than or equal to the //current state, then the current state will be updated and the invalid flag //can be reset. - setState(state: DeepReadonly, blockNumber: number): void { + setState( + state: DeepReadonly, + blockNumber: number, + reason?: string, + ): void { if (!blockNumber) { this.logger.error('setState() with blockNumber', blockNumber); return; } this.stateHistory[blockNumber] = state; if (!this.state || blockNumber >= this.stateBlockNumber) { - this._setState(state, blockNumber); + this._setState(state, blockNumber, reason); this.invalid = false; } const minBlockNumberToKeep = this.stateBlockNumber - MAX_BLOCKS_HISTORY; From 38da789c7cc9195a5bd6a3841ef288c3b60f3616 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:08:24 +0200 Subject: [PATCH 4/7] 3.11.10-univ3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3284f0870..8266257a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "3.11.9", + "version": "3.11.10-univ3.0", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib", From 2f3eeaf76dea626edfeb62d29ed135d19434a3b0 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:23:43 +0200 Subject: [PATCH 5/7] feat: restricting UniV3 & forks setState logs only to UniswapV3 --- src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts | 20 ++++++++++--------- src/dex/uniswap-v3/uniswap-v3-pool.ts | 20 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts index 3145381b8..0709b7d57 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts @@ -265,15 +265,17 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { } _setState(state: any, blockNumber: number, reason?: string): void { - this.logger.info( - `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for ${ - this.name - } ${ - this.addressesSubscribed[0] - } for bn: '${blockNumber}' due to reason: '${ - reason ?? 'outside_of_event_subscriber' - }'`, - ); + if (this.parentName === 'PancakeswapV3') { + this.logger.info( + `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for ${ + this.name + } ${ + this.addressesSubscribed[0] + } for bn: '${blockNumber}' due to reason: '${ + reason ?? 'outside_of_event_subscriber' + }'`, + ); + } super._setState(state, blockNumber); } diff --git a/src/dex/uniswap-v3/uniswap-v3-pool.ts b/src/dex/uniswap-v3/uniswap-v3-pool.ts index 91a4e5401..9adcc630f 100644 --- a/src/dex/uniswap-v3/uniswap-v3-pool.ts +++ b/src/dex/uniswap-v3/uniswap-v3-pool.ts @@ -269,15 +269,17 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { } _setState(state: any, blockNumber: number, reason?: string): void { - this.logger.info( - `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for ${ - this.name - } ${ - this.addressesSubscribed[0] - } for bn: '${blockNumber}' due to reason: '${ - reason ?? 'outside_of_event_subscriber' - }'`, - ); + if (this.parentName === 'UniswapV3') { + this.logger.info( + `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for ${ + this.name + } ${ + this.addressesSubscribed[0] + } for bn: '${blockNumber}' due to reason: '${ + reason ?? 'outside_of_event_subscriber' + }'`, + ); + } super._setState(state, blockNumber); } From 479a55a5153fdaabcc5ea3b8bd6103a44347677d Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:26:52 +0200 Subject: [PATCH 6/7] chore: removed empty field from UniV3 setState logs --- src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts | 6 ++---- src/dex/uniswap-v3/uniswap-v3-pool.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts index 0709b7d57..a97d99297 100644 --- a/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +++ b/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts @@ -267,11 +267,9 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber { _setState(state: any, blockNumber: number, reason?: string): void { if (this.parentName === 'PancakeswapV3') { this.logger.info( - `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for ${ + `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for '${ this.name - } ${ - this.addressesSubscribed[0] - } for bn: '${blockNumber}' due to reason: '${ + }' for bn: '${blockNumber}' due to reason: '${ reason ?? 'outside_of_event_subscriber' }'`, ); diff --git a/src/dex/uniswap-v3/uniswap-v3-pool.ts b/src/dex/uniswap-v3/uniswap-v3-pool.ts index 9adcc630f..c050eb4d7 100644 --- a/src/dex/uniswap-v3/uniswap-v3-pool.ts +++ b/src/dex/uniswap-v3/uniswap-v3-pool.ts @@ -271,11 +271,9 @@ export class UniswapV3EventPool extends StatefulEventSubscriber { _setState(state: any, blockNumber: number, reason?: string): void { if (this.parentName === 'UniswapV3') { this.logger.info( - `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for ${ + `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for '${ this.name - } ${ - this.addressesSubscribed[0] - } for bn: '${blockNumber}' due to reason: '${ + }' for bn: '${blockNumber}' due to reason: '${ reason ?? 'outside_of_event_subscriber' }'`, ); From 377561dbff8ae39719807a2b3c4d73e19fe718a0 Mon Sep 17 00:00:00 2001 From: Danylo Kanievskyi Date: Tue, 10 Dec 2024 11:29:19 +0200 Subject: [PATCH 7/7] 3.11.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8266257a2..507d3aed1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "3.11.10-univ3.0", + "version": "3.11.10", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib",