@paraswap/dex-lib 2.35.7-multiple-dex-base-chain.1 → 2.35.7-worker-pool.0

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 (188) hide show
  1. package/build/abi/quickPerps/fast-price-events.json +70 -0
  2. package/build/abi/quickPerps/fast-price-feed.json +748 -0
  3. package/build/abi/quickPerps/reader.json +313 -0
  4. package/build/abi/quickPerps/vault-price-feed.json +477 -0
  5. package/build/abi/quickPerps/vault.json +1953 -0
  6. package/build/config.js +2 -2
  7. package/build/dex/algebra/algebra.d.ts +4 -2
  8. package/build/dex/algebra/algebra.js +16 -3
  9. package/build/dex/algebra/algebra.js.map +1 -1
  10. package/build/dex/balancer-v2/config.js +1 -9
  11. package/build/dex/balancer-v2/config.js.map +1 -1
  12. package/build/dex/index.js +0 -2
  13. package/build/dex/index.js.map +1 -1
  14. package/build/dex/maverick-v1/config.js +0 -9
  15. package/build/dex/maverick-v1/config.js.map +1 -1
  16. package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
  17. package/build/dex/pancakeswap-v3/config.js +0 -17
  18. package/build/dex/pancakeswap-v3/config.js.map +1 -1
  19. package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -2
  20. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +15 -3
  21. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  22. package/build/dex/solidly/config.js +0 -13
  23. package/build/dex/solidly/config.js.map +1 -1
  24. package/build/dex/solidly/solidly.js +0 -1
  25. package/build/dex/solidly/solidly.js.map +1 -1
  26. package/build/dex/{ramses-v2 → test-dex}/config.d.ts +1 -1
  27. package/build/dex/test-dex/config.js +15 -0
  28. package/build/dex/test-dex/config.js.map +1 -0
  29. package/build/dex/test-dex/test-dex-pool.d.ts +39 -0
  30. package/build/dex/test-dex/test-dex-pool.js +63 -0
  31. package/build/dex/test-dex/test-dex-pool.js.map +1 -0
  32. package/build/dex/test-dex/test-dex.d.ts +37 -0
  33. package/build/dex/test-dex/test-dex.js +126 -0
  34. package/build/dex/test-dex/test-dex.js.map +1 -0
  35. package/build/dex/test-dex/types.d.ts +6 -0
  36. package/build/dex/{pancakeswap-v3 → test-dex}/types.js.map +1 -1
  37. package/build/dex/uniswap-v3/config.js +0 -12
  38. package/build/dex/uniswap-v3/config.js.map +1 -1
  39. package/build/dex/uniswap-v3/uniswap-v3.d.ts +3 -2
  40. package/build/dex/uniswap-v3/uniswap-v3.js +15 -3
  41. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  42. package/build/dex/woo-fi-v2/config.js +0 -13
  43. package/build/dex/woo-fi-v2/config.js.map +1 -1
  44. package/build/dex/woo-fi-v2/woo-fi-math.d.ts +16 -0
  45. package/build/dex/woo-fi-v2/woo-fi-math.js +137 -0
  46. package/build/dex/woo-fi-v2/woo-fi-math.js.map +1 -0
  47. package/build/dex-helper/dummy-dex-helper.d.ts +1 -0
  48. package/build/dex-helper/dummy-dex-helper.js +3 -0
  49. package/build/dex-helper/dummy-dex-helper.js.map +1 -1
  50. package/build/dex-helper/idex-helper.d.ts +1 -0
  51. package/build/workers.d.ts +0 -0
  52. package/build/workers.js +2 -0
  53. package/build/workers.js.map +1 -0
  54. package/package.json +1 -1
  55. package/src/config.ts +2 -2
  56. package/src/dex/algebra/algebra.ts +11 -5
  57. package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +1 -122
  58. package/src/dex/balancer-v2/config.ts +1 -10
  59. package/src/dex/index.ts +0 -2
  60. package/src/dex/maverick-v1/config.ts +0 -10
  61. package/src/dex/maverick-v1/maverick-v1-e2e.test.ts +1 -121
  62. package/src/dex/maverick-v1/maverick-v1.ts +0 -1
  63. package/src/dex/pancakeswap-v3/config.ts +0 -19
  64. package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +0 -120
  65. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +10 -5
  66. package/src/dex/solidly/config.ts +0 -14
  67. package/src/dex/solidly/solidly-e2e.test.ts +0 -24
  68. package/src/dex/solidly/solidly.ts +0 -1
  69. package/src/dex/uniswap-v3/config.ts +0 -13
  70. package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +4 -25
  71. package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +0 -142
  72. package/src/dex/uniswap-v3/uniswap-v3.ts +10 -5
  73. package/src/dex/woo-fi-v2/config.ts +0 -13
  74. package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +0 -64
  75. package/src/dex-helper/dummy-dex-helper.ts +13 -0
  76. package/src/dex-helper/idex-helper.ts +7 -0
  77. package/tests/constants-e2e.ts +0 -30
  78. package/tests/utils-e2e.ts +0 -1
  79. package/.idea/aws.xml +0 -17
  80. package/.idea/codeStyles/Project.xml +0 -19
  81. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  82. package/.idea/misc.xml +0 -6
  83. package/.idea/modules.xml +0 -8
  84. package/.idea/paraswap-dex-lib.iml +0 -9
  85. package/.idea/vcs.xml +0 -6
  86. package/build/abi/aerodrome/aerodrome-pool-factory.json +0 -586
  87. package/build/abi/algebra/AlgebraPool.abi.json +0 -727
  88. package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
  89. package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
  90. package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
  91. package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
  92. package/build/abi/wBETH.json +0 -1527
  93. package/build/dex/algebra/algebra-pool.d.ts +0 -46
  94. package/build/dex/algebra/algebra-pool.js +0 -336
  95. package/build/dex/algebra/algebra-pool.js.map +0 -1
  96. package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
  97. package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
  98. package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
  99. package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
  100. package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
  101. package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
  102. package/build/dex/pancakeswap-v3/types.d.ts +0 -14
  103. package/build/dex/ramses-v2/config.js +0 -28
  104. package/build/dex/ramses-v2/config.js.map +0 -1
  105. package/build/dex/ramses-v2/constants.d.ts +0 -28
  106. package/build/dex/ramses-v2/constants.js +0 -35
  107. package/build/dex/ramses-v2/constants.js.map +0 -1
  108. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
  109. package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
  110. package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
  111. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
  112. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
  113. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
  114. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
  115. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
  116. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
  117. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
  118. package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
  119. package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
  120. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
  121. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
  122. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
  123. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
  124. package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
  125. package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
  126. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
  127. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
  128. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
  129. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
  130. package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
  131. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
  132. package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
  133. package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
  134. package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
  135. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
  136. package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
  137. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
  138. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
  139. package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
  140. package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
  141. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
  142. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
  143. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
  144. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
  145. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
  146. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
  147. package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
  148. package/build/dex/ramses-v2/contract-math/utils.js +0 -16
  149. package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
  150. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
  151. package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
  152. package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
  153. package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
  154. package/build/dex/ramses-v2/ramses-v2.js +0 -690
  155. package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
  156. package/build/dex/ramses-v2/types.d.ts +0 -154
  157. package/build/dex/ramses-v2/types.js +0 -9
  158. package/build/dex/ramses-v2/types.js.map +0 -1
  159. package/build/dex/ramses-v2/utils.d.ts +0 -6
  160. package/build/dex/ramses-v2/utils.js +0 -71
  161. package/build/dex/ramses-v2/utils.js.map +0 -1
  162. package/build/dex/solidly/forks-override/aerodrome.d.ts +0 -14
  163. package/build/dex/solidly/forks-override/aerodrome.js +0 -48
  164. package/build/dex/solidly/forks-override/aerodrome.js.map +0 -1
  165. package/build/dex/sushiswap-v3/config.d.ts +0 -4
  166. package/build/dex/sushiswap-v3/config.js +0 -132
  167. package/build/dex/sushiswap-v3/config.js.map +0 -1
  168. package/build/dex/sushiswap-v3/constants.d.ts +0 -4
  169. package/build/dex/sushiswap-v3/constants.js +0 -32
  170. package/build/dex/sushiswap-v3/constants.js.map +0 -1
  171. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
  172. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
  173. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
  174. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
  175. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
  176. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
  177. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
  178. package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
  179. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
  180. package/build/dex/sushiswap-v3/token.d.ts +0 -6
  181. package/build/dex/sushiswap-v3/token.js +0 -23
  182. package/build/dex/sushiswap-v3/token.js.map +0 -1
  183. package/build/dex/sushiswap-v3/types.d.ts +0 -15
  184. package/build/dex/sushiswap-v3/types.js +0 -18
  185. package/build/dex/sushiswap-v3/types.js.map +0 -1
  186. package/src/abi/aerodrome/aerodrome-pool-factory.json +0 -586
  187. package/src/dex/solidly/forks-override/aerodrome.ts +0 -57
  188. /package/build/dex/{pancakeswap-v3 → test-dex}/types.js +0 -0
@@ -14,12 +14,6 @@ export const MaverickV1Config: DexConfigMap<DexParams> = {
14
14
  routerAddress: '0x4a585e0f7c18e2c414221d6402652d5e0990e5f8',
15
15
  poolInspectorAddress: '0xaA5BF61a664109e959D69C38734d4EA7dF74e456',
16
16
  },
17
- [Network.BASE]: {
18
- subgraphURL:
19
- 'https://api.studio.thegraph.com/query/42519/maverick-base/version/latest',
20
- routerAddress: '0x32AED3Bce901DA12ca8489788F3A99fCe1056e14',
21
- poolInspectorAddress: '0x65A3AD03Be97619284bA7AA1E3Ca05638B9d6364',
22
- },
23
17
  },
24
18
  };
25
19
 
@@ -28,8 +22,4 @@ export const Adapters: Record<number, AdapterMappings> = {
28
22
  [SwapSide.SELL]: [{ name: 'Adapter04', index: 2 }],
29
23
  [SwapSide.BUY]: [{ name: 'BuyAdapter', index: 8 }],
30
24
  },
31
- [Network.BASE]: {
32
- [SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 2 }],
33
- [SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 2 }],
34
- },
35
25
  };
@@ -11,109 +11,10 @@ import { Network, ContractMethod, SwapSide } from '../../constants';
11
11
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
12
12
  import { generateConfig } from '../../config';
13
13
 
14
- function testForNetwork(
15
- network: Network,
16
- dexKey: string,
17
- tokenASymbol: string,
18
- tokenBSymbol: string,
19
- tokenAAmount: string,
20
- tokenBAmount: string,
21
- nativeTokenAmount: string,
22
- slippage?: number | undefined,
23
- ) {
24
- const provider = new StaticJsonRpcProvider(
25
- generateConfig(network).privateHttpProvider,
26
- network,
27
- );
28
- const tokens = Tokens[network];
29
- const holders = Holders[network];
30
- const nativeTokenSymbol = NativeTokenSymbols[network];
31
-
32
- const sideToContractMethods = new Map([
33
- [
34
- SwapSide.SELL,
35
- [
36
- ContractMethod.simpleSwap,
37
- ContractMethod.multiSwap,
38
- ContractMethod.megaSwap,
39
- ],
40
- ],
41
- [
42
- SwapSide.BUY,
43
- [
44
- ContractMethod.simpleBuy,
45
- ContractMethod.buy,
46
- ],
47
- ],
48
- ]);
49
-
50
- describe(`${network}`, () => {
51
- sideToContractMethods.forEach((contractMethods, side) =>
52
- describe(`${side}`, () => {
53
- contractMethods.forEach((contractMethod: ContractMethod) => {
54
- describe(`${contractMethod}`, () => {
55
- it(`${nativeTokenSymbol} -> ${tokenASymbol}`, async () => {
56
- await testE2E(
57
- tokens[nativeTokenSymbol],
58
- tokens[tokenASymbol],
59
- holders[nativeTokenSymbol],
60
- side === SwapSide.SELL ? nativeTokenAmount : tokenAAmount,
61
- side,
62
- dexKey,
63
- contractMethod,
64
- network,
65
- provider,
66
- undefined,
67
- undefined,
68
- undefined,
69
- slippage,
70
- );
71
- });
72
- it(`${tokenASymbol} -> ${nativeTokenSymbol}`, async () => {
73
- await testE2E(
74
- tokens[tokenASymbol],
75
- tokens[nativeTokenSymbol],
76
- holders[tokenASymbol],
77
- side === SwapSide.SELL ? tokenAAmount : nativeTokenAmount,
78
- side,
79
- dexKey,
80
- contractMethod,
81
- network,
82
- provider,
83
- undefined,
84
- undefined,
85
- undefined,
86
- slippage,
87
- );
88
- });
89
- it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
90
- await testE2E(
91
- tokens[tokenASymbol],
92
- tokens[tokenBSymbol],
93
- holders[tokenASymbol],
94
- side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
95
- side,
96
- dexKey,
97
- contractMethod,
98
- network,
99
- provider,
100
- undefined,
101
- undefined,
102
- undefined,
103
- slippage,
104
- );
105
- });
106
- });
107
- });
108
- }),
109
- );
110
- });
111
- }
112
-
113
14
  describe('MaverickV1 E2E', () => {
114
15
  const dexKey = 'MaverickV1';
115
16
 
116
- describe('MAINNET', () => {
17
+ describe('MaverickV1 MAINNET', () => {
117
18
  const network = Network.MAINNET;
118
19
  const tokens = Tokens[network];
119
20
  const holders = Holders[network];
@@ -220,25 +121,4 @@ describe('MaverickV1 E2E', () => {
220
121
  );
221
122
  });
222
123
  });
223
-
224
- describe('BASE', () => {
225
- const network = Network.BASE;
226
-
227
- const tokenASymbol: string = 'USDbC';
228
- const tokenBSymbol: string = 'MAV';
229
-
230
- const tokenAAmount: string = '1111100000';
231
- const tokenBAmount: string = '1100000000000000000';
232
- const nativeTokenAmount = '100000000000000000';
233
-
234
- testForNetwork(
235
- network,
236
- dexKey,
237
- tokenASymbol,
238
- tokenBSymbol,
239
- tokenAAmount,
240
- tokenBAmount,
241
- nativeTokenAmount,
242
- );
243
- });
244
124
  });
@@ -78,7 +78,6 @@ export class MaverickV1
78
78
 
79
79
  async setupEventPools(blockNumber: number) {
80
80
  const pools = await this.fetchAllSubgraphPools();
81
-
82
81
  await Promise.all(
83
82
  pools.map(async (pool: any) => {
84
83
  const eventPool = new MaverickV1EventPool(
@@ -53,21 +53,6 @@ export const PancakeswapV3Config: DexConfigMap<DexParams> = {
53
53
  subgraphURL:
54
54
  'https://api.studio.thegraph.com/query/45376/exchange-v3-arbitrum/version/latest',
55
55
  },
56
- [Network.BASE]: {
57
- factory: '0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865',
58
- deployer: '0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9',
59
- quoter: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997',
60
- router: '0x1b81D678ffb9C0263b24A97847620C99d213eB14',
61
- supportedFees: PANCAKE_SUPPORTED_FEES,
62
- stateMulticall: '0xeBF40A40CA3D4310Bf53048F48e860656e1D7C81',
63
- uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
64
- chunksCount: 10,
65
- initRetryFrequency: 30,
66
- initHash:
67
- '0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2',
68
- subgraphURL:
69
- 'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest',
70
- },
71
56
  },
72
57
  };
73
58
 
@@ -84,8 +69,4 @@ export const Adapters: Record<number, AdapterMappings> = {
84
69
  [SwapSide.SELL]: [{ name: 'ArbitrumAdapter01', index: 3 }],
85
70
  [SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 2 }],
86
71
  },
87
- [Network.BASE]: {
88
- [SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 1 }],
89
- [SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 1 }],
90
- },
91
72
  };
@@ -11,105 +11,6 @@ import { Network, ContractMethod, SwapSide } from '../../constants';
11
11
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
12
12
  import { generateConfig } from '../../config';
13
13
 
14
- function testForNetwork(
15
- network: Network,
16
- dexKey: string,
17
- tokenASymbol: string,
18
- tokenBSymbol: string,
19
- tokenAAmount: string,
20
- tokenBAmount: string,
21
- nativeTokenAmount: string,
22
- slippage?: number | undefined,
23
- ) {
24
- const provider = new StaticJsonRpcProvider(
25
- generateConfig(network).privateHttpProvider,
26
- network,
27
- );
28
- const tokens = Tokens[network];
29
- const holders = Holders[network];
30
- const nativeTokenSymbol = NativeTokenSymbols[network];
31
-
32
- const sideToContractMethods = new Map([
33
- [
34
- SwapSide.SELL,
35
- [
36
- ContractMethod.simpleSwap,
37
- ContractMethod.multiSwap,
38
- ContractMethod.megaSwap,
39
- ],
40
- ],
41
- [
42
- SwapSide.BUY,
43
- [
44
- ContractMethod.simpleBuy,
45
- ContractMethod.buy,
46
- ],
47
- ],
48
- ]);
49
-
50
- describe(`${network}`, () => {
51
- sideToContractMethods.forEach((contractMethods, side) =>
52
- describe(`${side}`, () => {
53
- contractMethods.forEach((contractMethod: ContractMethod) => {
54
- describe(`${contractMethod}`, () => {
55
- it(`${nativeTokenSymbol} -> ${tokenASymbol}`, async () => {
56
- await testE2E(
57
- tokens[nativeTokenSymbol],
58
- tokens[tokenASymbol],
59
- holders[nativeTokenSymbol],
60
- side === SwapSide.SELL ? nativeTokenAmount : tokenAAmount,
61
- side,
62
- dexKey,
63
- contractMethod,
64
- network,
65
- provider,
66
- undefined,
67
- undefined,
68
- undefined,
69
- slippage,
70
- );
71
- });
72
- it(`${tokenASymbol} -> ${nativeTokenSymbol}`, async () => {
73
- await testE2E(
74
- tokens[tokenASymbol],
75
- tokens[nativeTokenSymbol],
76
- holders[tokenASymbol],
77
- side === SwapSide.SELL ? tokenAAmount : nativeTokenAmount,
78
- side,
79
- dexKey,
80
- contractMethod,
81
- network,
82
- provider,
83
- undefined,
84
- undefined,
85
- undefined,
86
- slippage,
87
- );
88
- });
89
- it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
90
- await testE2E(
91
- tokens[tokenASymbol],
92
- tokens[tokenBSymbol],
93
- holders[tokenASymbol],
94
- side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
95
- side,
96
- dexKey,
97
- contractMethod,
98
- network,
99
- provider,
100
- undefined,
101
- undefined,
102
- undefined,
103
- slippage,
104
- );
105
- });
106
- });
107
- });
108
- }),
109
- );
110
- });
111
- }
112
-
113
14
  describe('PancakeswapV3 E2E', () => {
114
15
  const dexKey = 'PancakeswapV3';
115
16
 
@@ -406,25 +307,4 @@ describe('PancakeswapV3 E2E', () => {
406
307
  }),
407
308
  );
408
309
  });
409
-
410
- describe('PancakeswapV3 Base', () => {
411
- const network = Network.BASE;
412
-
413
- const tokenASymbol: string = 'USDbC';
414
- const tokenBSymbol: string = 'DAI';
415
-
416
- const tokenAAmount: string = '11111000000';
417
- const tokenBAmount: string = '210000000000000000';
418
- const nativeTokenAmount = '110000000000000000000';
419
-
420
- testForNetwork(
421
- network,
422
- dexKey,
423
- tokenASymbol,
424
- tokenBSymbol,
425
- tokenAAmount,
426
- tokenBAmount,
427
- nativeTokenAmount,
428
- );
429
- });
430
310
  });
@@ -608,20 +608,25 @@ export class PancakeswapV3
608
608
  const balanceDestToken =
609
609
  _destAddress === pool.token0 ? state.balance0 : state.balance1;
610
610
 
611
- const unitResult = this._getOutputs(
611
+ const unitResult = await this.dexHelper.executeOnWorkerPool<
612
+ ReturnType<typeof this.getOutputs>
613
+ >(this.dexKey, 'getOutputs', [
612
614
  state,
613
615
  [unitAmount],
614
616
  zeroForOne,
615
617
  side,
616
618
  balanceDestToken,
617
- );
618
- const pricesResult = this._getOutputs(
619
+ ]);
620
+
621
+ const pricesResult = await this.dexHelper.executeOnWorkerPool<
622
+ ReturnType<typeof this.getOutputs>
623
+ >(this.dexKey, 'getOutputs', [
619
624
  state,
620
625
  _amounts,
621
626
  zeroForOne,
622
627
  side,
623
628
  balanceDestToken,
624
- );
629
+ ]);
625
630
 
626
631
  if (!pricesResult) {
627
632
  this.logger.debug('Prices or unit is not calculated');
@@ -911,7 +916,7 @@ export class PancakeswapV3
911
916
  return newConfig;
912
917
  }
913
918
 
914
- private _getOutputs(
919
+ getOutputs(
915
920
  state: DeepReadonly<PoolState>,
916
921
  amounts: bigint[],
917
922
  zeroForOne: boolean,
@@ -83,17 +83,6 @@ export const SolidlyConfig: DexConfigMap<DexParams> = {
83
83
  feeCode: 0,
84
84
  },
85
85
  },
86
- Aerodrome: {
87
- [Network.BASE]: {
88
- // There is no subgraph for Aerodrome
89
- factoryAddress: '0x420DD381b31aEf6683db6B902084cB0FFECe40Da',
90
- router: '0xDCf4EE5B700e2a5Fec458e06B763A4a3E3004494',
91
- initCode:
92
- '0x1a8f01f7eab324003d9388f229ea17991eee9c9d14586f429799f3656790eba0',
93
- poolGasCost: 180 * 1000,
94
- feeCode: 0,
95
- },
96
- },
97
86
  Cone: {
98
87
  [Network.BSC]: {
99
88
  subgraphURL: 'https://api.thegraph.com/subgraphs/name/cone-exchange/cone',
@@ -193,7 +182,4 @@ export const Adapters: Record<number, AdapterMappings> = {
193
182
  [Network.ARBITRUM]: {
194
183
  [SwapSide.SELL]: [{ name: 'ArbitrumAdapter02', index: 1 }], // chronos, ramses
195
184
  },
196
- [Network.BASE]: {
197
- [SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 3 }], // aerodrome
198
- }
199
185
  };
@@ -1404,28 +1404,4 @@ describe('Solidly E2E', () => {
1404
1404
  );
1405
1405
  });
1406
1406
  });
1407
-
1408
- describe('Base', () => {
1409
- const network = Network.BASE;
1410
-
1411
- describe('Aerodrome', () => {
1412
- const dexKey = 'Aerodrome';
1413
- const tokenASymbol: string = 'USDbC';
1414
- const tokenBSymbol: string = 'DAI';
1415
-
1416
- const tokenAAmount: string = '1111100000';
1417
- const tokenBAmount: string = '100000000000000000';
1418
- const nativeTokenAmount = '100000000000000000';
1419
-
1420
- testForNetwork(
1421
- network,
1422
- dexKey,
1423
- tokenASymbol,
1424
- tokenBSymbol,
1425
- tokenAAmount,
1426
- tokenBAmount,
1427
- nativeTokenAmount,
1428
- );
1429
- })
1430
- });
1431
1407
  });
@@ -75,7 +75,6 @@ export class Solidly extends UniswapV2 {
75
75
  'Chronos',
76
76
  'Ramses',
77
77
  'Equalizer',
78
- 'Aerodrome',
79
78
  ]),
80
79
  );
81
80
 
@@ -210,19 +210,6 @@ export const UniswapV3Config: DexConfigMap<DexParams> = {
210
210
  subgraphURL:
211
211
  'https://api.thegraph.com/subgraphs/name/sushi-v3/v3-optimism',
212
212
  },
213
- [Network.BASE]: {
214
- factory: '0xc35DADB65012eC5796536bD9864eD8773aBc74C4',
215
- quoter: '0xb1E835Dc2785b52265711e17fCCb0fd018226a6e',
216
- router: '0xCc0e85901f33D375FcdD9a888B05Df9616F68277',
217
- supportedFees: SUPPORTED_FEES,
218
- stateMulticall: '0x7160f736c52e1e78e92FD4eE4D73e21A7Cf4F950',
219
- uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
220
- chunksCount: 10,
221
- initRetryFrequency: 10,
222
- initHash: `0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54`,
223
- subgraphURL:
224
- 'https://api.studio.thegraph.com/query/32073/v3-base/v0.0.1',
225
- },
226
213
  },
227
214
  ChronosV3: {
228
215
  [Network.ARBITRUM]: {
@@ -424,16 +424,16 @@ describe('UniswapV3 E2E', () => {
424
424
  [
425
425
  SwapSide.SELL,
426
426
  [
427
- ContractMethod.simpleSwap,
427
+ // ContractMethod.simpleSwap,
428
428
  ContractMethod.multiSwap,
429
- ContractMethod.megaSwap,
429
+ // ContractMethod.megaSwap,
430
430
  ],
431
431
  ],
432
432
  [
433
433
  SwapSide.BUY,
434
434
  [
435
- ContractMethod.simpleBuy,
436
- ContractMethod.buy
435
+ // ContractMethod.simpleBuy,
436
+ // ContractMethod.buy
437
437
  ],
438
438
  ],
439
439
  ]);
@@ -1094,26 +1094,5 @@ describe('UniswapV3 E2E', () => {
1094
1094
  nativeTokenAmount,
1095
1095
  );
1096
1096
  });
1097
-
1098
- describe('BASE', () => {
1099
- const network = Network.BASE;
1100
-
1101
- const tokenASymbol: string = 'USDbC';
1102
- const tokenBSymbol: string = 'DAI';
1103
-
1104
- const tokenAAmount: string = '111110000';
1105
- const tokenBAmount: string = '110000000000000000';
1106
- const nativeTokenAmount = '1100000000000000000';
1107
-
1108
- testForNetwork(
1109
- network,
1110
- dexKey,
1111
- tokenASymbol,
1112
- tokenBSymbol,
1113
- tokenAAmount,
1114
- tokenBAmount,
1115
- nativeTokenAmount,
1116
- );
1117
- });
1118
1097
  });
1119
1098
  });
@@ -959,146 +959,4 @@ describe('SushiSwapV3', () => {
959
959
  expect(falseChecksCounter).toBeLessThan(poolPrices!.length);
960
960
  });
961
961
  });
962
-
963
- describe('Base', () => {
964
- let blockNumber: number;
965
- let sushiSwapV3: UniswapV3;
966
- let sushiSwapV3Mainnet: UniswapV3;
967
-
968
- const network = Network.BASE;
969
- const dexHelper = new DummyDexHelper(network);
970
- const TokenASymbol = 'USDbC';
971
- const TokenA = Tokens[network][TokenASymbol];
972
-
973
- const TokenBSymbol = 'DAI';
974
- const TokenB = Tokens[network][TokenBSymbol];
975
-
976
- beforeEach(async () => {
977
- blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
978
- sushiSwapV3 = new UniswapV3(network, dexKey, dexHelper);
979
- sushiSwapV3Mainnet = new UniswapV3(Network.MAINNET, dexKey, dexHelper);
980
- });
981
-
982
- it('getPoolIdentifiers and getPricesVolume SELL', async function () {
983
- const amounts = [0n, BI_POWS[6], 2000000n];
984
-
985
- const pools = await sushiSwapV3.getPoolIdentifiers(
986
- TokenA,
987
- TokenB,
988
- SwapSide.SELL,
989
- blockNumber,
990
- );
991
- console.log(
992
- `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
993
- pools,
994
- );
995
-
996
- expect(pools.length).toBeGreaterThan(0);
997
-
998
- const poolPrices = await sushiSwapV3.getPricesVolume(
999
- TokenA,
1000
- TokenB,
1001
- amounts,
1002
- SwapSide.SELL,
1003
- blockNumber,
1004
- pools,
1005
- );
1006
- console.log(
1007
- `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
1008
- poolPrices,
1009
- );
1010
-
1011
- expect(poolPrices).not.toBeNull();
1012
- checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
1013
-
1014
- let falseChecksCounter = 0;
1015
- await Promise.all(
1016
- poolPrices!.map(async price => {
1017
- const fee = sushiSwapV3.eventPools[price.poolIdentifier!]!.feeCode;
1018
- const res = await checkOnChainPricing(
1019
- dexHelper,
1020
- sushiSwapV3,
1021
- 'quoteExactInputSingle',
1022
- blockNumber,
1023
- '0xb1E835Dc2785b52265711e17fCCb0fd018226a6e',
1024
- price.prices,
1025
- TokenA.address,
1026
- TokenB.address,
1027
- fee,
1028
- amounts,
1029
- );
1030
- if (res === false) falseChecksCounter++;
1031
- }),
1032
- );
1033
-
1034
- expect(falseChecksCounter).toBeLessThan(poolPrices!.length);
1035
- });
1036
-
1037
- it('getPoolIdentifiers and getPricesVolume BUY', async function () {
1038
- const amounts = [0n, BI_POWS[6], 2000000n];
1039
-
1040
- const pools = await sushiSwapV3.getPoolIdentifiers(
1041
- TokenA,
1042
- TokenB,
1043
- SwapSide.BUY,
1044
- blockNumber,
1045
- );
1046
- console.log(
1047
- `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
1048
- pools,
1049
- );
1050
-
1051
- expect(pools.length).toBeGreaterThan(0);
1052
-
1053
- const poolPrices = await sushiSwapV3.getPricesVolume(
1054
- TokenA,
1055
- TokenB,
1056
- amounts,
1057
- SwapSide.BUY,
1058
- blockNumber,
1059
- pools,
1060
- );
1061
- console.log(
1062
- `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
1063
- poolPrices,
1064
- );
1065
-
1066
- expect(poolPrices).not.toBeNull();
1067
- checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
1068
-
1069
- let falseChecksCounter = 0;
1070
- await Promise.all(
1071
- poolPrices!.map(async price => {
1072
- const fee = sushiSwapV3.eventPools[price.poolIdentifier!]!.feeCode;
1073
- const res = await checkOnChainPricing(
1074
- dexHelper,
1075
- sushiSwapV3,
1076
- 'quoteExactOutputSingle',
1077
- blockNumber,
1078
- '0xb1E835Dc2785b52265711e17fCCb0fd018226a6e',
1079
- price.prices,
1080
- TokenA.address,
1081
- TokenB.address,
1082
- fee,
1083
- amounts,
1084
- );
1085
- if (res === false) falseChecksCounter++;
1086
- }),
1087
- );
1088
-
1089
- expect(falseChecksCounter).toBeLessThan(poolPrices!.length);
1090
- });
1091
-
1092
- it('getTopPoolsForToken', async function () {
1093
- const poolLiquidity = await sushiSwapV3.getTopPoolsForToken(
1094
- TokenB.address,
1095
- 10,
1096
- );
1097
- console.log(`${TokenASymbol} Top Pools:`, poolLiquidity);
1098
-
1099
- checkPoolsLiquidity(poolLiquidity, TokenB.address, dexKey);
1100
- });
1101
- });
1102
-
1103
962
  });
1104
-
@@ -641,20 +641,25 @@ export class UniswapV3
641
641
  const balanceDestToken =
642
642
  _destAddress === pool.token0 ? state.balance0 : state.balance1;
643
643
 
644
- const unitResult = this._getOutputs(
644
+ const unitResult = await this.dexHelper.executeOnWorkerPool<
645
+ ReturnType<typeof this.getOutputs>
646
+ >(this.dexKey, 'getOutputs', [
645
647
  state,
646
648
  [unitAmount],
647
649
  zeroForOne,
648
650
  side,
649
651
  balanceDestToken,
650
- );
651
- const pricesResult = this._getOutputs(
652
+ ]);
653
+
654
+ const pricesResult = await this.dexHelper.executeOnWorkerPool<
655
+ ReturnType<typeof this.getOutputs>
656
+ >(this.dexKey, 'getOutputs', [
652
657
  state,
653
658
  _amounts,
654
659
  zeroForOne,
655
660
  side,
656
661
  balanceDestToken,
657
- );
662
+ ]);
658
663
 
659
664
  if (!unitResult || !pricesResult) {
660
665
  this.logger.debug('Prices or unit is not calculated');
@@ -1071,7 +1076,7 @@ export class UniswapV3
1071
1076
  return newConfig;
1072
1077
  }
1073
1078
 
1074
- private _getOutputs(
1079
+ getOutputs(
1075
1080
  state: DeepReadonly<PoolState>,
1076
1081
  amounts: bigint[],
1077
1082
  zeroForOne: boolean,