@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.
Files changed (201) hide show
  1. package/.idea/aws.xml +17 -0
  2. package/.idea/codeStyles/Project.xml +19 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/misc.xml +6 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/paraswap-dex-lib.iml +9 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/build/abi/algebra/AlgebraPool.abi.json +727 -0
  9. package/build/abi/curve-v1/StableSwapFRXETH.json +889 -0
  10. package/build/abi/curve-v1/StableSwapWBETH.json +1223 -0
  11. package/build/abi/dexalot/DexalotMainnetRFQ.json +887 -0
  12. package/build/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
  13. package/build/abi/ramses-v2/RamsesV2Pool.abi.json +1580 -0
  14. package/build/abi/sushiswap-v3/QuoterV2.json +267 -0
  15. package/build/abi/sushiswap-v3/RouterProcessor3.json +289 -0
  16. package/build/abi/uniswap-v3/UniswapV3Factory.abi.json +148 -0
  17. package/build/abi/wBETH.json +1527 -0
  18. package/build/dex/algebra/algebra-factory.d.ts +25 -0
  19. package/build/dex/algebra/algebra-factory.js +43 -0
  20. package/build/dex/algebra/algebra-factory.js.map +1 -0
  21. package/build/dex/algebra/algebra-pool.d.ts +46 -0
  22. package/build/dex/algebra/algebra-pool.js +336 -0
  23. package/build/dex/algebra/algebra-pool.js.map +1 -0
  24. package/build/dex/algebra/algebra.d.ts +3 -0
  25. package/build/dex/algebra/algebra.js +27 -5
  26. package/build/dex/algebra/algebra.js.map +1 -1
  27. package/build/dex/algebra/config.js +0 -1
  28. package/build/dex/algebra/config.js.map +1 -1
  29. package/build/dex/algebra/types.d.ts +1 -1
  30. package/build/dex/curve-v1/pools/frxETHpool.d.ts +7 -0
  31. package/build/dex/curve-v1/pools/frxETHpool.js +27 -0
  32. package/build/dex/curve-v1/pools/frxETHpool.js.map +1 -0
  33. package/build/dex/curve-v1/pools/wbETHpool.d.ts +29 -0
  34. package/build/dex/curve-v1/pools/wbETHpool.js +408 -0
  35. package/build/dex/curve-v1/pools/wbETHpool.js.map +1 -0
  36. package/build/dex/{test-dex → dexalot}/config.d.ts +1 -1
  37. package/build/dex/dexalot/config.js +18 -0
  38. package/build/dex/dexalot/config.js.map +1 -0
  39. package/build/dex/dexalot/constants.d.ts +15 -0
  40. package/build/dex/dexalot/constants.js +22 -0
  41. package/build/dex/dexalot/constants.js.map +1 -0
  42. package/build/dex/dexalot/dexalot.d.ts +69 -0
  43. package/build/dex/dexalot/dexalot.js +646 -0
  44. package/build/dex/dexalot/dexalot.js.map +1 -0
  45. package/build/dex/dexalot/rate-fetcher.d.ts +28 -0
  46. package/build/dex/dexalot/rate-fetcher.js +100 -0
  47. package/build/dex/dexalot/rate-fetcher.js.map +1 -0
  48. package/build/dex/dexalot/types.d.ts +114 -0
  49. package/build/dex/dexalot/types.js +12 -0
  50. package/build/dex/dexalot/types.js.map +1 -0
  51. package/build/dex/dexalot/validators.d.ts +5 -0
  52. package/build/dex/dexalot/validators.js +45 -0
  53. package/build/dex/dexalot/validators.js.map +1 -0
  54. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.d.ts +26 -0
  55. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js +44 -0
  56. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js.map +1 -0
  57. package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -0
  58. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +26 -2
  59. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  60. package/build/dex/pancakeswap-v3/types.d.ts +14 -0
  61. package/build/dex/{test-dex → pancakeswap-v3}/types.js.map +1 -1
  62. package/build/dex/ramses-v2/config.d.ts +4 -0
  63. package/build/dex/ramses-v2/config.js +28 -0
  64. package/build/dex/ramses-v2/config.js.map +1 -0
  65. package/build/dex/ramses-v2/constants.d.ts +28 -0
  66. package/build/dex/ramses-v2/constants.js +35 -0
  67. package/build/dex/ramses-v2/constants.js.map +1 -0
  68. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +4 -0
  69. package/build/dex/ramses-v2/contract-math/BitMath.js +93 -0
  70. package/build/dex/ramses-v2/contract-math/BitMath.js.map +1 -0
  71. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +3 -0
  72. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +8 -0
  73. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +1 -0
  74. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +4 -0
  75. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +9 -0
  76. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +1 -0
  77. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +4 -0
  78. package/build/dex/ramses-v2/contract-math/FullMath.js +19 -0
  79. package/build/dex/ramses-v2/contract-math/FullMath.js.map +1 -0
  80. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +3 -0
  81. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +22 -0
  82. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +1 -0
  83. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +10 -0
  84. package/build/dex/ramses-v2/contract-math/Oracle.js +133 -0
  85. package/build/dex/ramses-v2/contract-math/Oracle.js.map +1 -0
  86. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +10 -0
  87. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +91 -0
  88. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +1 -0
  89. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +8 -0
  90. package/build/dex/ramses-v2/contract-math/SwapMath.js +70 -0
  91. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +1 -0
  92. package/build/dex/ramses-v2/contract-math/Tick.d.ts +7 -0
  93. package/build/dex/ramses-v2/contract-math/Tick.js +45 -0
  94. package/build/dex/ramses-v2/contract-math/Tick.js.map +1 -0
  95. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +8 -0
  96. package/build/dex/ramses-v2/contract-math/TickBitMap.js +87 -0
  97. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +1 -0
  98. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +8 -0
  99. package/build/dex/ramses-v2/contract-math/TickMath.js +162 -0
  100. package/build/dex/ramses-v2/contract-math/TickMath.js.map +1 -0
  101. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +3 -0
  102. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +10 -0
  103. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +1 -0
  104. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +18 -0
  105. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +392 -0
  106. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +1 -0
  107. package/build/dex/ramses-v2/contract-math/utils.d.ts +3 -0
  108. package/build/dex/ramses-v2/contract-math/utils.js +16 -0
  109. package/build/dex/ramses-v2/contract-math/utils.js.map +1 -0
  110. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +42 -0
  111. package/build/dex/ramses-v2/ramses-v2-pool.js +307 -0
  112. package/build/dex/ramses-v2/ramses-v2-pool.js.map +1 -0
  113. package/build/dex/ramses-v2/ramses-v2.d.ts +61 -0
  114. package/build/dex/ramses-v2/ramses-v2.js +690 -0
  115. package/build/dex/ramses-v2/ramses-v2.js.map +1 -0
  116. package/build/dex/ramses-v2/types.d.ts +154 -0
  117. package/build/dex/ramses-v2/types.js +9 -0
  118. package/build/dex/ramses-v2/types.js.map +1 -0
  119. package/build/dex/ramses-v2/utils.d.ts +6 -0
  120. package/build/dex/ramses-v2/utils.js +71 -0
  121. package/build/dex/ramses-v2/utils.js.map +1 -0
  122. package/build/dex/sushiswap-v3/config.d.ts +4 -0
  123. package/build/dex/sushiswap-v3/config.js +132 -0
  124. package/build/dex/sushiswap-v3/config.js.map +1 -0
  125. package/build/dex/sushiswap-v3/constants.d.ts +4 -0
  126. package/build/dex/sushiswap-v3/constants.js +32 -0
  127. package/build/dex/sushiswap-v3/constants.js.map +1 -0
  128. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +56 -0
  129. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +598 -0
  130. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +1 -0
  131. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +1 -0
  132. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +6 -0
  133. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +1 -0
  134. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +21 -0
  135. package/build/dex/sushiswap-v3/sushiswap-v3.js +58 -0
  136. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +1 -0
  137. package/build/dex/sushiswap-v3/token.d.ts +6 -0
  138. package/build/dex/sushiswap-v3/token.js +23 -0
  139. package/build/dex/sushiswap-v3/token.js.map +1 -0
  140. package/build/dex/sushiswap-v3/types.d.ts +15 -0
  141. package/build/dex/sushiswap-v3/types.js +18 -0
  142. package/build/dex/sushiswap-v3/types.js.map +1 -0
  143. package/build/dex/uniswap-v3/config.js +2 -0
  144. package/build/dex/uniswap-v3/config.js.map +1 -1
  145. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.d.ts +7 -0
  146. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js +87 -0
  147. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js.map +1 -0
  148. package/build/dex/uniswap-v3/types.d.ts +3 -0
  149. package/build/dex/uniswap-v3/types.js.map +1 -1
  150. package/build/dex/uniswap-v3/uniswap-v3-factory.d.ts +26 -0
  151. package/build/dex/uniswap-v3/uniswap-v3-factory.js +44 -0
  152. package/build/dex/uniswap-v3/uniswap-v3-factory.js.map +1 -0
  153. package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +7 -5
  154. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  155. package/build/dex/uniswap-v3/uniswap-v3.d.ts +3 -0
  156. package/build/dex/uniswap-v3/uniswap-v3.js +33 -5
  157. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  158. package/build/dex-helper/dummy-dex-helper.js +3 -0
  159. package/build/dex-helper/dummy-dex-helper.js.map +1 -1
  160. package/build/dex-helper/icache.d.ts +1 -0
  161. package/package.json +1 -1
  162. package/src/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
  163. package/src/abi/ramses-v2/RamsesV2Pool.abi.json +1580 -0
  164. package/src/dex/algebra/algebra-factory.ts +70 -0
  165. package/src/dex/algebra/algebra.ts +47 -6
  166. package/src/dex/algebra/config.ts +0 -1
  167. package/src/dex/algebra/types.ts +2 -1
  168. package/src/dex/pancakeswap-v3/pancakeswap-v3-factory.ts +73 -0
  169. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +50 -2
  170. package/src/dex/uniswap-v3/config.ts +2 -0
  171. package/src/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.ts +104 -0
  172. package/src/dex/uniswap-v3/types.ts +4 -0
  173. package/src/dex/uniswap-v3/uniswap-v3-factory.ts +73 -0
  174. package/src/dex/uniswap-v3/uniswap-v3-pool.ts +6 -4
  175. package/src/dex/uniswap-v3/uniswap-v3.ts +72 -22
  176. package/src/dex-helper/dummy-dex-helper.ts +4 -0
  177. package/src/dex-helper/icache.ts +2 -0
  178. package/build/abi/quickPerps/fast-price-events.json +0 -70
  179. package/build/abi/quickPerps/fast-price-feed.json +0 -748
  180. package/build/abi/quickPerps/reader.json +0 -313
  181. package/build/abi/quickPerps/vault-price-feed.json +0 -477
  182. package/build/abi/quickPerps/vault.json +0 -1953
  183. package/build/dex/maverick-v1/scripts/event-sequence.d.ts +0 -1
  184. package/build/dex/maverick-v1/scripts/event-sequence.js +0 -110
  185. package/build/dex/maverick-v1/scripts/event-sequence.js.map +0 -1
  186. package/build/dex/test-dex/config.js +0 -15
  187. package/build/dex/test-dex/config.js.map +0 -1
  188. package/build/dex/test-dex/test-dex-pool.d.ts +0 -39
  189. package/build/dex/test-dex/test-dex-pool.js +0 -63
  190. package/build/dex/test-dex/test-dex-pool.js.map +0 -1
  191. package/build/dex/test-dex/test-dex.d.ts +0 -37
  192. package/build/dex/test-dex/test-dex.js +0 -126
  193. package/build/dex/test-dex/test-dex.js.map +0 -1
  194. package/build/dex/test-dex/types.d.ts +0 -6
  195. package/build/dex/woo-fi-v2/woo-fi-math.d.ts +0 -16
  196. package/build/dex/woo-fi-v2/woo-fi-math.js +0 -137
  197. package/build/dex/woo-fi-v2/woo-fi-math.js.map +0 -1
  198. package/build/workers.d.ts +0 -0
  199. package/build/workers.js +0 -2
  200. package/build/workers.js.map +0 -1
  201. /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 = 60 * 60 * 24 * 1000; // 24 hours
75
- const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 30 * 60 * 1000; // Once in 30 minutes
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 UniswapV3EventPool(
248
- this.dexHelper,
249
- this.dexKey,
250
- this.stateMultiContract,
251
- this.config.decodeStateMultiCallResultWithRelativeBitmaps,
252
- this.erc20Interface,
253
- this.config.factory,
254
- fee,
255
- token0,
256
- token1,
257
- this.logger,
258
- this.cacheStateKey,
259
- this.config.initHash,
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.initialize(blockNumber, {
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.initRetryAttemptCount}`,
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.initFailed = true;
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
  }
@@ -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
- ]