@paraswap/dex-lib 2.37.2 → 2.37.4-current-fee-ramses-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +19 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/paraswap-dex-lib.iml +9 -0
- package/.idea/vcs.xml +6 -0
- package/build/abi/algebra/AlgebraPool.abi.json +727 -0
- package/build/abi/curve-v1/StableSwapFRXETH.json +889 -0
- package/build/abi/curve-v1/StableSwapWBETH.json +1223 -0
- package/build/abi/dexalot/DexalotMainnetRFQ.json +887 -0
- package/build/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
- package/build/abi/ramses-v2/RamsesV2Pool.abi.json +1580 -0
- package/build/abi/sushiswap-v3/QuoterV2.json +267 -0
- package/build/abi/sushiswap-v3/RouterProcessor3.json +289 -0
- package/build/abi/uniswap-v3/UniswapV3Factory.abi.json +148 -0
- package/build/abi/wBETH.json +1527 -0
- package/build/dex/algebra/algebra-factory.d.ts +25 -0
- package/build/dex/algebra/algebra-factory.js +43 -0
- package/build/dex/algebra/algebra-factory.js.map +1 -0
- package/build/dex/algebra/algebra-pool.d.ts +46 -0
- package/build/dex/algebra/algebra-pool.js +336 -0
- package/build/dex/algebra/algebra-pool.js.map +1 -0
- package/build/dex/algebra/algebra.d.ts +3 -0
- package/build/dex/algebra/algebra.js +27 -5
- package/build/dex/algebra/algebra.js.map +1 -1
- package/build/dex/algebra/config.js +0 -1
- package/build/dex/algebra/config.js.map +1 -1
- package/build/dex/algebra/types.d.ts +1 -1
- package/build/dex/curve-v1/pools/frxETHpool.d.ts +7 -0
- package/build/dex/curve-v1/pools/frxETHpool.js +27 -0
- package/build/dex/curve-v1/pools/frxETHpool.js.map +1 -0
- package/build/dex/curve-v1/pools/wbETHpool.d.ts +29 -0
- package/build/dex/curve-v1/pools/wbETHpool.js +408 -0
- package/build/dex/curve-v1/pools/wbETHpool.js.map +1 -0
- package/build/dex/{test-dex → dexalot}/config.d.ts +1 -1
- package/build/dex/dexalot/config.js +18 -0
- package/build/dex/dexalot/config.js.map +1 -0
- package/build/dex/dexalot/constants.d.ts +15 -0
- package/build/dex/dexalot/constants.js +22 -0
- package/build/dex/dexalot/constants.js.map +1 -0
- package/build/dex/dexalot/dexalot.d.ts +69 -0
- package/build/dex/dexalot/dexalot.js +646 -0
- package/build/dex/dexalot/dexalot.js.map +1 -0
- package/build/dex/dexalot/rate-fetcher.d.ts +28 -0
- package/build/dex/dexalot/rate-fetcher.js +100 -0
- package/build/dex/dexalot/rate-fetcher.js.map +1 -0
- package/build/dex/dexalot/types.d.ts +114 -0
- package/build/dex/dexalot/types.js +12 -0
- package/build/dex/dexalot/types.js.map +1 -0
- package/build/dex/dexalot/validators.d.ts +5 -0
- package/build/dex/dexalot/validators.js +45 -0
- package/build/dex/dexalot/validators.js.map +1 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.d.ts +26 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js +44 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js.map +1 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js +26 -2
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
- package/build/dex/pancakeswap-v3/types.d.ts +14 -0
- package/build/dex/{test-dex → pancakeswap-v3}/types.js.map +1 -1
- package/build/dex/ramses-v2/config.d.ts +4 -0
- package/build/dex/ramses-v2/config.js +28 -0
- package/build/dex/ramses-v2/config.js.map +1 -0
- package/build/dex/ramses-v2/constants.d.ts +28 -0
- package/build/dex/ramses-v2/constants.js +35 -0
- package/build/dex/ramses-v2/constants.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/BitMath.d.ts +4 -0
- package/build/dex/ramses-v2/contract-math/BitMath.js +93 -0
- package/build/dex/ramses-v2/contract-math/BitMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +3 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js +8 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +4 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js +9 -0
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/FullMath.d.ts +4 -0
- package/build/dex/ramses-v2/contract-math/FullMath.js +19 -0
- package/build/dex/ramses-v2/contract-math/FullMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +3 -0
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js +22 -0
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/Oracle.d.ts +10 -0
- package/build/dex/ramses-v2/contract-math/Oracle.js +133 -0
- package/build/dex/ramses-v2/contract-math/Oracle.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +10 -0
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +91 -0
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +8 -0
- package/build/dex/ramses-v2/contract-math/SwapMath.js +70 -0
- package/build/dex/ramses-v2/contract-math/SwapMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/Tick.d.ts +7 -0
- package/build/dex/ramses-v2/contract-math/Tick.js +45 -0
- package/build/dex/ramses-v2/contract-math/Tick.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +8 -0
- package/build/dex/ramses-v2/contract-math/TickBitMap.js +87 -0
- package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/TickMath.d.ts +8 -0
- package/build/dex/ramses-v2/contract-math/TickMath.js +162 -0
- package/build/dex/ramses-v2/contract-math/TickMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +3 -0
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js +10 -0
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +18 -0
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +392 -0
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +1 -0
- package/build/dex/ramses-v2/contract-math/utils.d.ts +3 -0
- package/build/dex/ramses-v2/contract-math/utils.js +16 -0
- package/build/dex/ramses-v2/contract-math/utils.js.map +1 -0
- package/build/dex/ramses-v2/ramses-v2-pool.d.ts +42 -0
- package/build/dex/ramses-v2/ramses-v2-pool.js +307 -0
- package/build/dex/ramses-v2/ramses-v2-pool.js.map +1 -0
- package/build/dex/ramses-v2/ramses-v2.d.ts +61 -0
- package/build/dex/ramses-v2/ramses-v2.js +690 -0
- package/build/dex/ramses-v2/ramses-v2.js.map +1 -0
- package/build/dex/ramses-v2/types.d.ts +154 -0
- package/build/dex/ramses-v2/types.js +9 -0
- package/build/dex/ramses-v2/types.js.map +1 -0
- package/build/dex/ramses-v2/utils.d.ts +6 -0
- package/build/dex/ramses-v2/utils.js +71 -0
- package/build/dex/ramses-v2/utils.js.map +1 -0
- package/build/dex/sushiswap-v3/config.d.ts +4 -0
- package/build/dex/sushiswap-v3/config.js +132 -0
- package/build/dex/sushiswap-v3/config.js.map +1 -0
- package/build/dex/sushiswap-v3/constants.d.ts +4 -0
- package/build/dex/sushiswap-v3/constants.js +32 -0
- package/build/dex/sushiswap-v3/constants.js.map +1 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +56 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-original.js +598 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +1 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +1 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +6 -0
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +1 -0
- package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +21 -0
- package/build/dex/sushiswap-v3/sushiswap-v3.js +58 -0
- package/build/dex/sushiswap-v3/sushiswap-v3.js.map +1 -0
- package/build/dex/sushiswap-v3/token.d.ts +6 -0
- package/build/dex/sushiswap-v3/token.js +23 -0
- package/build/dex/sushiswap-v3/token.js.map +1 -0
- package/build/dex/sushiswap-v3/types.d.ts +15 -0
- package/build/dex/sushiswap-v3/types.js +18 -0
- package/build/dex/sushiswap-v3/types.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +2 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.d.ts +7 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js +87 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js.map +1 -0
- package/build/dex/uniswap-v3/types.d.ts +3 -0
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-factory.d.ts +26 -0
- package/build/dex/uniswap-v3/uniswap-v3-factory.js +44 -0
- package/build/dex/uniswap-v3/uniswap-v3-factory.js.map +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +7 -5
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +3 -0
- package/build/dex/uniswap-v3/uniswap-v3.js +33 -5
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex-helper/dummy-dex-helper.js +3 -0
- package/build/dex-helper/dummy-dex-helper.js.map +1 -1
- package/build/dex-helper/icache.d.ts +1 -0
- package/package.json +1 -1
- package/src/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
- package/src/abi/ramses-v2/RamsesV2Pool.abi.json +1580 -0
- package/src/dex/algebra/algebra-factory.ts +70 -0
- package/src/dex/algebra/algebra.ts +47 -6
- package/src/dex/algebra/config.ts +0 -1
- package/src/dex/algebra/types.ts +2 -1
- package/src/dex/pancakeswap-v3/pancakeswap-v3-factory.ts +73 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +50 -2
- package/src/dex/uniswap-v3/config.ts +2 -0
- package/src/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.ts +104 -0
- package/src/dex/uniswap-v3/types.ts +4 -0
- package/src/dex/uniswap-v3/uniswap-v3-factory.ts +73 -0
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +6 -4
- package/src/dex/uniswap-v3/uniswap-v3.ts +72 -22
- package/src/dex-helper/dummy-dex-helper.ts +4 -0
- package/src/dex-helper/icache.ts +2 -0
- package/build/abi/quickPerps/fast-price-events.json +0 -70
- package/build/abi/quickPerps/fast-price-feed.json +0 -748
- package/build/abi/quickPerps/reader.json +0 -313
- package/build/abi/quickPerps/vault-price-feed.json +0 -477
- package/build/abi/quickPerps/vault.json +0 -1953
- package/build/dex/maverick-v1/scripts/event-sequence.d.ts +0 -1
- package/build/dex/maverick-v1/scripts/event-sequence.js +0 -110
- package/build/dex/maverick-v1/scripts/event-sequence.js.map +0 -1
- package/build/dex/test-dex/config.js +0 -15
- package/build/dex/test-dex/config.js.map +0 -1
- package/build/dex/test-dex/test-dex-pool.d.ts +0 -39
- package/build/dex/test-dex/test-dex-pool.js +0 -63
- package/build/dex/test-dex/test-dex-pool.js.map +0 -1
- package/build/dex/test-dex/test-dex.d.ts +0 -37
- package/build/dex/test-dex/test-dex.js +0 -126
- package/build/dex/test-dex/test-dex.js.map +0 -1
- package/build/dex/test-dex/types.d.ts +0 -6
- package/build/dex/woo-fi-v2/woo-fi-math.d.ts +0 -16
- package/build/dex/woo-fi-v2/woo-fi-math.js +0 -137
- package/build/dex/woo-fi-v2/woo-fi-math.js.map +0 -1
- package/build/workers.d.ts +0 -0
- package/build/workers.js +0 -2
- package/build/workers.js.map +0 -1
- /package/build/dex/{test-dex → pancakeswap-v3}/types.js +0 -0
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
DEFAULT_ID_ERC20_AS_STRING,
|
|
65
65
|
} from '../../lib/tokens/types';
|
|
66
66
|
import { OptimalSwapExchange } from '@paraswap/core';
|
|
67
|
+
import { OnPoolCreatedCallback, UniswapV3Factory } from './uniswap-v3-factory';
|
|
67
68
|
|
|
68
69
|
type PoolPairsInfo = {
|
|
69
70
|
token0: Address;
|
|
@@ -71,14 +72,15 @@ type PoolPairsInfo = {
|
|
|
71
72
|
fee: string;
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS =
|
|
75
|
-
const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS =
|
|
75
|
+
const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS = 3 * 24 * 60 * 60 * 1000; // 3 days
|
|
76
|
+
const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 24 * 60 * 60 * 1000; // Once in a day
|
|
76
77
|
const UNISWAPV3_QUOTE_GASLIMIT = 200_000;
|
|
77
78
|
|
|
78
79
|
export class UniswapV3
|
|
79
80
|
extends SimpleExchange
|
|
80
81
|
implements IDex<UniswapV3Data, UniswapV3Param>
|
|
81
82
|
{
|
|
83
|
+
private readonly factory: UniswapV3Factory;
|
|
82
84
|
readonly isFeeOnTransferSupported: boolean = false;
|
|
83
85
|
readonly eventPools: Record<string, UniswapV3EventPool | null> = {};
|
|
84
86
|
|
|
@@ -139,6 +141,14 @@ export class UniswapV3
|
|
|
139
141
|
|
|
140
142
|
this.notExistingPoolSetKey =
|
|
141
143
|
`${CACHE_PREFIX}_${network}_${dexKey}_not_existings_pool_set`.toLowerCase();
|
|
144
|
+
|
|
145
|
+
this.factory = new UniswapV3Factory(
|
|
146
|
+
dexHelper,
|
|
147
|
+
dexKey,
|
|
148
|
+
this.config.factory,
|
|
149
|
+
this.logger,
|
|
150
|
+
this.onPoolCreatedDeleteFromNonExistingSet,
|
|
151
|
+
);
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
get supportedFees() {
|
|
@@ -155,6 +165,9 @@ export class UniswapV3
|
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
async initializePricing(blockNumber: number) {
|
|
168
|
+
// Init listening to new pools creation
|
|
169
|
+
await this.factory.initialize(blockNumber);
|
|
170
|
+
|
|
158
171
|
// This is only for testing, because cold pool fetching is goes out of
|
|
159
172
|
// FETCH_POOL_INDENTIFIER_TIMEOUT range
|
|
160
173
|
await Promise.all(
|
|
@@ -185,6 +198,38 @@ export class UniswapV3
|
|
|
185
198
|
}
|
|
186
199
|
}
|
|
187
200
|
|
|
201
|
+
/*
|
|
202
|
+
* When a non existing pool is queried, it's blacklisted for an arbitrary long period in order to prevent issuing too many rpc calls
|
|
203
|
+
* Once the pool is created, it gets immediately flagged
|
|
204
|
+
*/
|
|
205
|
+
onPoolCreatedDeleteFromNonExistingSet: OnPoolCreatedCallback = async ({
|
|
206
|
+
token0,
|
|
207
|
+
token1,
|
|
208
|
+
fee,
|
|
209
|
+
}) => {
|
|
210
|
+
const logPrefix = '[UniswapV3.onPoolCreatedDeleteFromNonExistingSet]';
|
|
211
|
+
const [_token0, _token1] = this._sortTokens(token0, token1);
|
|
212
|
+
const poolKey = `${token0}_${token1}_${fee}`.toLowerCase();
|
|
213
|
+
|
|
214
|
+
// consider doing it only from master pool for less calls to distant cache
|
|
215
|
+
|
|
216
|
+
// delete entry locally to let local instance discover the pool
|
|
217
|
+
delete this.eventPools[this.getPoolIdentifier(_token0, _token1, fee)];
|
|
218
|
+
|
|
219
|
+
try {
|
|
220
|
+
this.logger.info(
|
|
221
|
+
`${logPrefix} delete pool from not existing set: ${poolKey}`,
|
|
222
|
+
);
|
|
223
|
+
// delete pool record from set
|
|
224
|
+
await this.dexHelper.cache.zrem(this.notExistingPoolSetKey, [poolKey]);
|
|
225
|
+
} catch (error) {
|
|
226
|
+
this.logger.error(
|
|
227
|
+
`${logPrefix} failed to delete pool from set: ${poolKey}`,
|
|
228
|
+
error,
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
188
233
|
async getPool(
|
|
189
234
|
srcAddress: Address,
|
|
190
235
|
destAddress: Address,
|
|
@@ -242,25 +287,29 @@ export class UniswapV3
|
|
|
242
287
|
}
|
|
243
288
|
|
|
244
289
|
this.logger.trace(`starting to listen to new pool: ${key}`);
|
|
290
|
+
const poolImplementation =
|
|
291
|
+
this.config.eventPoolImplementation !== undefined
|
|
292
|
+
? this.config.eventPoolImplementation
|
|
293
|
+
: UniswapV3EventPool;
|
|
245
294
|
pool =
|
|
246
295
|
pool ||
|
|
247
|
-
new
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
296
|
+
new poolImplementation(
|
|
297
|
+
this.dexHelper,
|
|
298
|
+
this.dexKey,
|
|
299
|
+
this.stateMultiContract,
|
|
300
|
+
this.config.decodeStateMultiCallResultWithRelativeBitmaps,
|
|
301
|
+
this.erc20Interface,
|
|
302
|
+
this.config.factory,
|
|
303
|
+
fee,
|
|
304
|
+
token0,
|
|
305
|
+
token1,
|
|
306
|
+
this.logger,
|
|
307
|
+
this.cacheStateKey,
|
|
308
|
+
this.config.initHash,
|
|
260
309
|
);
|
|
261
310
|
|
|
262
311
|
try {
|
|
263
|
-
await pool
|
|
312
|
+
await pool!.initialize(blockNumber, {
|
|
264
313
|
initCallback: (state: DeepReadonly<PoolState>) => {
|
|
265
314
|
//really hacky, we need to push poolAddress so that we subscribeToLogs in StatefulEventSubscriber
|
|
266
315
|
pool!.addressesSubscribed[0] = state.pool;
|
|
@@ -289,10 +338,10 @@ export class UniswapV3
|
|
|
289
338
|
// on unknown error mark as failed and increase retryCount for retry init strategy
|
|
290
339
|
// note: state would be null by default which allows to fallback
|
|
291
340
|
this.logger.warn(
|
|
292
|
-
`${this.dexKey}: Can not generate pool state for srcAddress=${srcAddress}, destAddress=${destAddress}, fee=${fee} pool fallback to rpc and retry every ${this.config.initRetryFrequency} times, initRetryAttemptCount=${pool
|
|
341
|
+
`${this.dexKey}: Can not generate pool state for srcAddress=${srcAddress}, destAddress=${destAddress}, fee=${fee} pool fallback to rpc and retry every ${this.config.initRetryFrequency} times, initRetryAttemptCount=${pool!.initRetryAttemptCount}`,
|
|
293
342
|
e,
|
|
294
343
|
);
|
|
295
|
-
pool
|
|
344
|
+
pool!.initFailed = true;
|
|
296
345
|
}
|
|
297
346
|
}
|
|
298
347
|
|
|
@@ -309,8 +358,8 @@ export class UniswapV3
|
|
|
309
358
|
}
|
|
310
359
|
|
|
311
360
|
this.eventPools[this.getPoolIdentifier(srcAddress, destAddress, fee)] =
|
|
312
|
-
pool
|
|
313
|
-
return pool
|
|
361
|
+
pool!;
|
|
362
|
+
return pool!;
|
|
314
363
|
}
|
|
315
364
|
|
|
316
365
|
async addMasterPool(poolKey: string, blockNumber: number): Promise<boolean> {
|
|
@@ -491,7 +540,7 @@ export class UniswapV3
|
|
|
491
540
|
{
|
|
492
541
|
tokenIn: from.address,
|
|
493
542
|
tokenOut: to.address,
|
|
494
|
-
fee: pool.feeCodeAsString,
|
|
543
|
+
fee: pool.currentFeeCodeAsString ? pool.currentFeeCodeAsString : pool.feeCodeAsString,
|
|
495
544
|
},
|
|
496
545
|
],
|
|
497
546
|
exchange: pool.poolAddress,
|
|
@@ -685,7 +734,7 @@ export class UniswapV3
|
|
|
685
734
|
{
|
|
686
735
|
tokenIn: _srcAddress,
|
|
687
736
|
tokenOut: _destAddress,
|
|
688
|
-
fee: pool.feeCode.toString(),
|
|
737
|
+
fee: pool.currentFeeCodeAsString ? pool.currentFeeCodeAsString : pool.feeCode.toString(),
|
|
689
738
|
},
|
|
690
739
|
],
|
|
691
740
|
},
|
|
@@ -1066,6 +1115,7 @@ export class UniswapV3
|
|
|
1066
1115
|
initHash: this.config.initHash,
|
|
1067
1116
|
subgraphURL: this.config.subgraphURL,
|
|
1068
1117
|
stateMultiCallAbi: this.config.stateMultiCallAbi,
|
|
1118
|
+
eventPoolImplementation: this.config.eventPoolImplementation,
|
|
1069
1119
|
decodeStateMultiCallResultWithRelativeBitmaps:
|
|
1070
1120
|
this.config.decodeStateMultiCallResultWithRelativeBitmaps,
|
|
1071
1121
|
};
|
|
@@ -115,6 +115,10 @@ class DummyCache implements ICache {
|
|
|
115
115
|
return 0;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
async zrem(key: string, membersKeys: string[]): Promise<number> {
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
async zadd(key: string, bulkItemsToAdd: (number | string)[], option?: 'NX') {
|
|
119
123
|
return 0;
|
|
120
124
|
}
|
package/src/dex-helper/icache.ts
CHANGED
|
@@ -46,6 +46,8 @@ export interface ICache {
|
|
|
46
46
|
|
|
47
47
|
zremrangebyscore(key: string, min: number, max: number): Promise<number>;
|
|
48
48
|
|
|
49
|
+
zrem(key: string, membersKeys: string[]): Promise<number>;
|
|
50
|
+
|
|
49
51
|
zscore(setKey: string, key: string): Promise<string | null>;
|
|
50
52
|
|
|
51
53
|
sismember(setKey: string, key: string): Promise<boolean>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"anonymous": false,
|
|
4
|
-
"inputs": [
|
|
5
|
-
{
|
|
6
|
-
"indexed": false,
|
|
7
|
-
"internalType": "address",
|
|
8
|
-
"name": "token",
|
|
9
|
-
"type": "address"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"indexed": false,
|
|
13
|
-
"internalType": "uint256",
|
|
14
|
-
"name": "price",
|
|
15
|
-
"type": "uint256"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"indexed": false,
|
|
19
|
-
"internalType": "address",
|
|
20
|
-
"name": "priceFeed",
|
|
21
|
-
"type": "address"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"name": "PriceUpdate",
|
|
25
|
-
"type": "event"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"inputs": [
|
|
29
|
-
{ "internalType": "address", "name": "_token", "type": "address" },
|
|
30
|
-
{ "internalType": "uint256", "name": "_price", "type": "uint256" }
|
|
31
|
-
],
|
|
32
|
-
"name": "emitPriceEvent",
|
|
33
|
-
"outputs": [],
|
|
34
|
-
"stateMutability": "nonpayable",
|
|
35
|
-
"type": "function"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"inputs": [],
|
|
39
|
-
"name": "gov",
|
|
40
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
41
|
-
"stateMutability": "view",
|
|
42
|
-
"type": "function"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
46
|
-
"name": "isPriceFeed",
|
|
47
|
-
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
48
|
-
"stateMutability": "view",
|
|
49
|
-
"type": "function"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"inputs": [
|
|
53
|
-
{ "internalType": "address", "name": "_gov", "type": "address" }
|
|
54
|
-
],
|
|
55
|
-
"name": "setGov",
|
|
56
|
-
"outputs": [],
|
|
57
|
-
"stateMutability": "nonpayable",
|
|
58
|
-
"type": "function"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"inputs": [
|
|
62
|
-
{ "internalType": "address", "name": "_priceFeed", "type": "address" },
|
|
63
|
-
{ "internalType": "bool", "name": "_isPriceFeed", "type": "bool" }
|
|
64
|
-
],
|
|
65
|
-
"name": "setIsPriceFeed",
|
|
66
|
-
"outputs": [],
|
|
67
|
-
"stateMutability": "nonpayable",
|
|
68
|
-
"type": "function"
|
|
69
|
-
}
|
|
70
|
-
]
|