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

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 (190) 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 +4 -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 +2 -11
  17. package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
  18. package/build/dex/pancakeswap-v3/config.js +0 -17
  19. package/build/dex/pancakeswap-v3/config.js.map +1 -1
  20. package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -2
  21. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +3 -3
  22. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  23. package/build/dex/solidly/config.js +1 -22
  24. package/build/dex/solidly/config.js.map +1 -1
  25. package/build/dex/solidly/solidly.js +0 -1
  26. package/build/dex/solidly/solidly.js.map +1 -1
  27. package/build/dex/{ramses-v2 → test-dex}/config.d.ts +1 -1
  28. package/build/dex/test-dex/config.js +15 -0
  29. package/build/dex/test-dex/config.js.map +1 -0
  30. package/build/dex/test-dex/test-dex-pool.d.ts +39 -0
  31. package/build/dex/test-dex/test-dex-pool.js +63 -0
  32. package/build/dex/test-dex/test-dex-pool.js.map +1 -0
  33. package/build/dex/test-dex/test-dex.d.ts +37 -0
  34. package/build/dex/test-dex/test-dex.js +126 -0
  35. package/build/dex/test-dex/test-dex.js.map +1 -0
  36. package/build/dex/test-dex/types.d.ts +6 -0
  37. package/build/dex/{pancakeswap-v3 → test-dex}/types.js.map +1 -1
  38. package/build/dex/uniswap-v3/config.js +0 -12
  39. package/build/dex/uniswap-v3/config.js.map +1 -1
  40. package/build/dex/uniswap-v3/uniswap-v3.d.ts +3 -2
  41. package/build/dex/uniswap-v3/uniswap-v3.js +3 -3
  42. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  43. package/build/dex/woo-fi-v2/config.js +0 -13
  44. package/build/dex/woo-fi-v2/config.js.map +1 -1
  45. package/build/dex/woo-fi-v2/woo-fi-math.d.ts +16 -0
  46. package/build/dex/woo-fi-v2/woo-fi-math.js +137 -0
  47. package/build/dex/woo-fi-v2/woo-fi-math.js.map +1 -0
  48. package/build/dex-helper/dummy-dex-helper.d.ts +1 -0
  49. package/build/dex-helper/dummy-dex-helper.js +3 -0
  50. package/build/dex-helper/dummy-dex-helper.js.map +1 -1
  51. package/build/dex-helper/idex-helper.d.ts +1 -0
  52. package/build/workers.d.ts +0 -0
  53. package/build/workers.js +2 -0
  54. package/build/workers.js.map +1 -0
  55. package/package.json +1 -1
  56. package/src/config.ts +2 -2
  57. package/src/dex/algebra/algebra.ts +13 -15
  58. package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +1 -122
  59. package/src/dex/balancer-v2/config.ts +1 -10
  60. package/src/dex/index.ts +0 -2
  61. package/src/dex/maverick-v1/config.ts +0 -10
  62. package/src/dex/maverick-v1/maverick-v1-e2e.test.ts +1 -121
  63. package/src/dex/maverick-v1/maverick-v1.ts +2 -12
  64. package/src/dex/pancakeswap-v3/config.ts +0 -19
  65. package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +0 -120
  66. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +12 -16
  67. package/src/dex/solidly/config.ts +1 -24
  68. package/src/dex/solidly/solidly-e2e.test.ts +0 -88
  69. package/src/dex/solidly/solidly-integration.test.ts +0 -66
  70. package/src/dex/solidly/solidly.ts +0 -1
  71. package/src/dex/uniswap-v3/config.ts +0 -13
  72. package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +4 -25
  73. package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +0 -142
  74. package/src/dex/uniswap-v3/uniswap-v3.ts +12 -15
  75. package/src/dex/woo-fi-v2/config.ts +0 -13
  76. package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +0 -64
  77. package/src/dex-helper/dummy-dex-helper.ts +13 -0
  78. package/src/dex-helper/idex-helper.ts +7 -0
  79. package/tests/constants-e2e.ts +0 -30
  80. package/tests/utils-e2e.ts +0 -1
  81. package/.idea/aws.xml +0 -17
  82. package/.idea/codeStyles/Project.xml +0 -19
  83. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  84. package/.idea/misc.xml +0 -6
  85. package/.idea/modules.xml +0 -8
  86. package/.idea/paraswap-dex-lib.iml +0 -9
  87. package/.idea/vcs.xml +0 -6
  88. package/build/abi/aerodrome/aerodrome-pool-factory.json +0 -586
  89. package/build/abi/algebra/AlgebraPool.abi.json +0 -727
  90. package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
  91. package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
  92. package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
  93. package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
  94. package/build/abi/wBETH.json +0 -1527
  95. package/build/dex/algebra/algebra-pool.d.ts +0 -46
  96. package/build/dex/algebra/algebra-pool.js +0 -336
  97. package/build/dex/algebra/algebra-pool.js.map +0 -1
  98. package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
  99. package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
  100. package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
  101. package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
  102. package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
  103. package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
  104. package/build/dex/pancakeswap-v3/types.d.ts +0 -14
  105. package/build/dex/ramses-v2/config.js +0 -28
  106. package/build/dex/ramses-v2/config.js.map +0 -1
  107. package/build/dex/ramses-v2/constants.d.ts +0 -28
  108. package/build/dex/ramses-v2/constants.js +0 -35
  109. package/build/dex/ramses-v2/constants.js.map +0 -1
  110. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
  111. package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
  112. package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
  113. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
  114. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
  115. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
  116. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
  117. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
  118. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
  119. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
  120. package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
  121. package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
  122. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
  123. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
  124. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
  125. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
  126. package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
  127. package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
  128. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
  129. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
  130. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
  131. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
  132. package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
  133. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
  134. package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
  135. package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
  136. package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
  137. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
  138. package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
  139. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
  140. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
  141. package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
  142. package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
  143. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
  144. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
  145. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
  146. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
  147. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
  148. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
  149. package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
  150. package/build/dex/ramses-v2/contract-math/utils.js +0 -16
  151. package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
  152. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
  153. package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
  154. package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
  155. package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
  156. package/build/dex/ramses-v2/ramses-v2.js +0 -690
  157. package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
  158. package/build/dex/ramses-v2/types.d.ts +0 -154
  159. package/build/dex/ramses-v2/types.js +0 -9
  160. package/build/dex/ramses-v2/types.js.map +0 -1
  161. package/build/dex/ramses-v2/utils.d.ts +0 -6
  162. package/build/dex/ramses-v2/utils.js +0 -71
  163. package/build/dex/ramses-v2/utils.js.map +0 -1
  164. package/build/dex/solidly/forks-override/aerodrome.d.ts +0 -14
  165. package/build/dex/solidly/forks-override/aerodrome.js +0 -48
  166. package/build/dex/solidly/forks-override/aerodrome.js.map +0 -1
  167. package/build/dex/sushiswap-v3/config.d.ts +0 -4
  168. package/build/dex/sushiswap-v3/config.js +0 -132
  169. package/build/dex/sushiswap-v3/config.js.map +0 -1
  170. package/build/dex/sushiswap-v3/constants.d.ts +0 -4
  171. package/build/dex/sushiswap-v3/constants.js +0 -32
  172. package/build/dex/sushiswap-v3/constants.js.map +0 -1
  173. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
  174. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
  175. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
  176. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
  177. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
  178. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
  179. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
  180. package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
  181. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
  182. package/build/dex/sushiswap-v3/token.d.ts +0 -6
  183. package/build/dex/sushiswap-v3/token.js +0 -23
  184. package/build/dex/sushiswap-v3/token.js.map +0 -1
  185. package/build/dex/sushiswap-v3/types.d.ts +0 -15
  186. package/build/dex/sushiswap-v3/types.js +0 -18
  187. package/build/dex/sushiswap-v3/types.js.map +0 -1
  188. package/src/abi/aerodrome/aerodrome-pool-factory.json +0 -586
  189. package/src/dex/solidly/forks-override/aerodrome.ts +0 -57
  190. /package/build/dex/{pancakeswap-v3 → test-dex}/types.js +0 -0
@@ -1,586 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "address",
6
- "name": "_implementation",
7
- "type": "address"
8
- }
9
- ],
10
- "stateMutability": "nonpayable",
11
- "type": "constructor"
12
- },
13
- {
14
- "inputs": [],
15
- "name": "FeeInvalid",
16
- "type": "error"
17
- },
18
- {
19
- "inputs": [],
20
- "name": "FeeTooHigh",
21
- "type": "error"
22
- },
23
- {
24
- "inputs": [],
25
- "name": "InvalidPool",
26
- "type": "error"
27
- },
28
- {
29
- "inputs": [],
30
- "name": "NotFeeManager",
31
- "type": "error"
32
- },
33
- {
34
- "inputs": [],
35
- "name": "NotPauser",
36
- "type": "error"
37
- },
38
- {
39
- "inputs": [],
40
- "name": "NotVoter",
41
- "type": "error"
42
- },
43
- {
44
- "inputs": [],
45
- "name": "PoolAlreadyExists",
46
- "type": "error"
47
- },
48
- {
49
- "inputs": [],
50
- "name": "SameAddress",
51
- "type": "error"
52
- },
53
- {
54
- "inputs": [],
55
- "name": "ZeroAddress",
56
- "type": "error"
57
- },
58
- {
59
- "inputs": [],
60
- "name": "ZeroFee",
61
- "type": "error"
62
- },
63
- {
64
- "anonymous": false,
65
- "inputs": [
66
- {
67
- "indexed": true,
68
- "internalType": "address",
69
- "name": "token0",
70
- "type": "address"
71
- },
72
- {
73
- "indexed": true,
74
- "internalType": "address",
75
- "name": "token1",
76
- "type": "address"
77
- },
78
- {
79
- "indexed": true,
80
- "internalType": "bool",
81
- "name": "stable",
82
- "type": "bool"
83
- },
84
- {
85
- "indexed": false,
86
- "internalType": "address",
87
- "name": "pool",
88
- "type": "address"
89
- },
90
- {
91
- "indexed": false,
92
- "internalType": "uint256",
93
- "name": "",
94
- "type": "uint256"
95
- }
96
- ],
97
- "name": "PoolCreated",
98
- "type": "event"
99
- },
100
- {
101
- "anonymous": false,
102
- "inputs": [
103
- {
104
- "indexed": true,
105
- "internalType": "address",
106
- "name": "pool",
107
- "type": "address"
108
- },
109
- {
110
- "indexed": false,
111
- "internalType": "uint256",
112
- "name": "fee",
113
- "type": "uint256"
114
- }
115
- ],
116
- "name": "SetCustomFee",
117
- "type": "event"
118
- },
119
- {
120
- "anonymous": false,
121
- "inputs": [
122
- {
123
- "indexed": false,
124
- "internalType": "address",
125
- "name": "feeManager",
126
- "type": "address"
127
- }
128
- ],
129
- "name": "SetFeeManager",
130
- "type": "event"
131
- },
132
- {
133
- "anonymous": false,
134
- "inputs": [
135
- {
136
- "indexed": false,
137
- "internalType": "bool",
138
- "name": "state",
139
- "type": "bool"
140
- }
141
- ],
142
- "name": "SetPauseState",
143
- "type": "event"
144
- },
145
- {
146
- "anonymous": false,
147
- "inputs": [
148
- {
149
- "indexed": false,
150
- "internalType": "address",
151
- "name": "pauser",
152
- "type": "address"
153
- }
154
- ],
155
- "name": "SetPauser",
156
- "type": "event"
157
- },
158
- {
159
- "anonymous": false,
160
- "inputs": [
161
- {
162
- "indexed": false,
163
- "internalType": "address",
164
- "name": "voter",
165
- "type": "address"
166
- }
167
- ],
168
- "name": "SetVoter",
169
- "type": "event"
170
- },
171
- {
172
- "inputs": [],
173
- "name": "MAX_FEE",
174
- "outputs": [
175
- {
176
- "internalType": "uint256",
177
- "name": "",
178
- "type": "uint256"
179
- }
180
- ],
181
- "stateMutability": "view",
182
- "type": "function"
183
- },
184
- {
185
- "inputs": [],
186
- "name": "ZERO_FEE_INDICATOR",
187
- "outputs": [
188
- {
189
- "internalType": "uint256",
190
- "name": "",
191
- "type": "uint256"
192
- }
193
- ],
194
- "stateMutability": "view",
195
- "type": "function"
196
- },
197
- {
198
- "inputs": [
199
- {
200
- "internalType": "uint256",
201
- "name": "",
202
- "type": "uint256"
203
- }
204
- ],
205
- "name": "allPools",
206
- "outputs": [
207
- {
208
- "internalType": "address",
209
- "name": "",
210
- "type": "address"
211
- }
212
- ],
213
- "stateMutability": "view",
214
- "type": "function"
215
- },
216
- {
217
- "inputs": [],
218
- "name": "allPoolsLength",
219
- "outputs": [
220
- {
221
- "internalType": "uint256",
222
- "name": "",
223
- "type": "uint256"
224
- }
225
- ],
226
- "stateMutability": "view",
227
- "type": "function"
228
- },
229
- {
230
- "inputs": [
231
- {
232
- "internalType": "address",
233
- "name": "tokenA",
234
- "type": "address"
235
- },
236
- {
237
- "internalType": "address",
238
- "name": "tokenB",
239
- "type": "address"
240
- },
241
- {
242
- "internalType": "bool",
243
- "name": "stable",
244
- "type": "bool"
245
- }
246
- ],
247
- "name": "createPool",
248
- "outputs": [
249
- {
250
- "internalType": "address",
251
- "name": "pool",
252
- "type": "address"
253
- }
254
- ],
255
- "stateMutability": "nonpayable",
256
- "type": "function"
257
- },
258
- {
259
- "inputs": [
260
- {
261
- "internalType": "address",
262
- "name": "tokenA",
263
- "type": "address"
264
- },
265
- {
266
- "internalType": "address",
267
- "name": "tokenB",
268
- "type": "address"
269
- },
270
- {
271
- "internalType": "uint24",
272
- "name": "fee",
273
- "type": "uint24"
274
- }
275
- ],
276
- "name": "createPool",
277
- "outputs": [
278
- {
279
- "internalType": "address",
280
- "name": "pool",
281
- "type": "address"
282
- }
283
- ],
284
- "stateMutability": "nonpayable",
285
- "type": "function"
286
- },
287
- {
288
- "inputs": [
289
- {
290
- "internalType": "address",
291
- "name": "",
292
- "type": "address"
293
- }
294
- ],
295
- "name": "customFee",
296
- "outputs": [
297
- {
298
- "internalType": "uint256",
299
- "name": "",
300
- "type": "uint256"
301
- }
302
- ],
303
- "stateMutability": "view",
304
- "type": "function"
305
- },
306
- {
307
- "inputs": [],
308
- "name": "feeManager",
309
- "outputs": [
310
- {
311
- "internalType": "address",
312
- "name": "",
313
- "type": "address"
314
- }
315
- ],
316
- "stateMutability": "view",
317
- "type": "function"
318
- },
319
- {
320
- "inputs": [
321
- {
322
- "internalType": "address",
323
- "name": "pool",
324
- "type": "address"
325
- },
326
- {
327
- "internalType": "bool",
328
- "name": "_stable",
329
- "type": "bool"
330
- }
331
- ],
332
- "name": "getFee",
333
- "outputs": [
334
- {
335
- "internalType": "uint256",
336
- "name": "",
337
- "type": "uint256"
338
- }
339
- ],
340
- "stateMutability": "view",
341
- "type": "function"
342
- },
343
- {
344
- "inputs": [
345
- {
346
- "internalType": "address",
347
- "name": "tokenA",
348
- "type": "address"
349
- },
350
- {
351
- "internalType": "address",
352
- "name": "tokenB",
353
- "type": "address"
354
- },
355
- {
356
- "internalType": "uint24",
357
- "name": "fee",
358
- "type": "uint24"
359
- }
360
- ],
361
- "name": "getPool",
362
- "outputs": [
363
- {
364
- "internalType": "address",
365
- "name": "",
366
- "type": "address"
367
- }
368
- ],
369
- "stateMutability": "view",
370
- "type": "function"
371
- },
372
- {
373
- "inputs": [
374
- {
375
- "internalType": "address",
376
- "name": "tokenA",
377
- "type": "address"
378
- },
379
- {
380
- "internalType": "address",
381
- "name": "tokenB",
382
- "type": "address"
383
- },
384
- {
385
- "internalType": "bool",
386
- "name": "stable",
387
- "type": "bool"
388
- }
389
- ],
390
- "name": "getPool",
391
- "outputs": [
392
- {
393
- "internalType": "address",
394
- "name": "",
395
- "type": "address"
396
- }
397
- ],
398
- "stateMutability": "view",
399
- "type": "function"
400
- },
401
- {
402
- "inputs": [],
403
- "name": "implementation",
404
- "outputs": [
405
- {
406
- "internalType": "address",
407
- "name": "",
408
- "type": "address"
409
- }
410
- ],
411
- "stateMutability": "view",
412
- "type": "function"
413
- },
414
- {
415
- "inputs": [],
416
- "name": "isPaused",
417
- "outputs": [
418
- {
419
- "internalType": "bool",
420
- "name": "",
421
- "type": "bool"
422
- }
423
- ],
424
- "stateMutability": "view",
425
- "type": "function"
426
- },
427
- {
428
- "inputs": [
429
- {
430
- "internalType": "address",
431
- "name": "pool",
432
- "type": "address"
433
- }
434
- ],
435
- "name": "isPool",
436
- "outputs": [
437
- {
438
- "internalType": "bool",
439
- "name": "",
440
- "type": "bool"
441
- }
442
- ],
443
- "stateMutability": "view",
444
- "type": "function"
445
- },
446
- {
447
- "inputs": [],
448
- "name": "pauser",
449
- "outputs": [
450
- {
451
- "internalType": "address",
452
- "name": "",
453
- "type": "address"
454
- }
455
- ],
456
- "stateMutability": "view",
457
- "type": "function"
458
- },
459
- {
460
- "inputs": [
461
- {
462
- "internalType": "address",
463
- "name": "pool",
464
- "type": "address"
465
- },
466
- {
467
- "internalType": "uint256",
468
- "name": "fee",
469
- "type": "uint256"
470
- }
471
- ],
472
- "name": "setCustomFee",
473
- "outputs": [],
474
- "stateMutability": "nonpayable",
475
- "type": "function"
476
- },
477
- {
478
- "inputs": [
479
- {
480
- "internalType": "bool",
481
- "name": "_stable",
482
- "type": "bool"
483
- },
484
- {
485
- "internalType": "uint256",
486
- "name": "_fee",
487
- "type": "uint256"
488
- }
489
- ],
490
- "name": "setFee",
491
- "outputs": [],
492
- "stateMutability": "nonpayable",
493
- "type": "function"
494
- },
495
- {
496
- "inputs": [
497
- {
498
- "internalType": "address",
499
- "name": "_feeManager",
500
- "type": "address"
501
- }
502
- ],
503
- "name": "setFeeManager",
504
- "outputs": [],
505
- "stateMutability": "nonpayable",
506
- "type": "function"
507
- },
508
- {
509
- "inputs": [
510
- {
511
- "internalType": "bool",
512
- "name": "_state",
513
- "type": "bool"
514
- }
515
- ],
516
- "name": "setPauseState",
517
- "outputs": [],
518
- "stateMutability": "nonpayable",
519
- "type": "function"
520
- },
521
- {
522
- "inputs": [
523
- {
524
- "internalType": "address",
525
- "name": "_pauser",
526
- "type": "address"
527
- }
528
- ],
529
- "name": "setPauser",
530
- "outputs": [],
531
- "stateMutability": "nonpayable",
532
- "type": "function"
533
- },
534
- {
535
- "inputs": [
536
- {
537
- "internalType": "address",
538
- "name": "_voter",
539
- "type": "address"
540
- }
541
- ],
542
- "name": "setVoter",
543
- "outputs": [],
544
- "stateMutability": "nonpayable",
545
- "type": "function"
546
- },
547
- {
548
- "inputs": [],
549
- "name": "stableFee",
550
- "outputs": [
551
- {
552
- "internalType": "uint256",
553
- "name": "",
554
- "type": "uint256"
555
- }
556
- ],
557
- "stateMutability": "view",
558
- "type": "function"
559
- },
560
- {
561
- "inputs": [],
562
- "name": "volatileFee",
563
- "outputs": [
564
- {
565
- "internalType": "uint256",
566
- "name": "",
567
- "type": "uint256"
568
- }
569
- ],
570
- "stateMutability": "view",
571
- "type": "function"
572
- },
573
- {
574
- "inputs": [],
575
- "name": "voter",
576
- "outputs": [
577
- {
578
- "internalType": "address",
579
- "name": "",
580
- "type": "address"
581
- }
582
- ],
583
- "stateMutability": "view",
584
- "type": "function"
585
- }
586
- ]
@@ -1,57 +0,0 @@
1
- import { VelodromeV2 } from './velodromeV2';
2
- import { Network, NULL_ADDRESS } from '../../../constants';
3
- import { getDexKeysWithNetwork } from '../../../utils';
4
- import _ from 'lodash';
5
- import { SolidlyConfig } from '../config';
6
- import { Token } from '../../../types';
7
- import { IDexHelper } from '../../../dex-helper';
8
- import AerodromeFactoryABI from '../../../abi/aerodrome/aerodrome-pool-factory.json';
9
-
10
- export class Aerodrome extends VelodromeV2 {
11
- public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
12
- getDexKeysWithNetwork(_.pick(SolidlyConfig, ['Aerodrome']));
13
-
14
- constructor(
15
- protected network: Network,
16
- dexKey: string,
17
- protected dexHelper: IDexHelper,
18
- ) {
19
- super(
20
- network,
21
- dexKey,
22
- dexHelper,
23
- );
24
-
25
- this.factory = new dexHelper.web3Provider.eth.Contract(
26
- AerodromeFactoryABI as any,
27
- SolidlyConfig[dexKey][network].factoryAddress,
28
- );
29
- }
30
-
31
- async findSolidlyPair(from: Token, to: Token, stable: boolean) {
32
- if (from.address.toLowerCase() === to.address.toLowerCase()) return null;
33
- const [token0, token1] =
34
- from.address.toLowerCase() < to.address.toLowerCase()
35
- ? [from, to]
36
- : [to, from];
37
-
38
- const typePostfix = this.poolPostfix(stable);
39
- const key = `${token0.address.toLowerCase()}-${token1.address.toLowerCase()}-${typePostfix}`;
40
- let pair = this.pairs[key];
41
- if (pair) return pair;
42
-
43
- let exchange = await this.factory.methods
44
- // Solidly has additional boolean parameter "StablePool"
45
- // At first we look for uniswap-like volatile pool
46
- .getPool(token0.address, token1.address, stable)
47
- .call();
48
-
49
- if (exchange === NULL_ADDRESS) {
50
- pair = { token0, token1, stable };
51
- } else {
52
- pair = { token0, token1, exchange, stable };
53
- }
54
- this.pairs[key] = pair;
55
- return pair;
56
- }
57
- }
File without changes