@paraswap/dex-lib 3.4.0 → 3.4.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 (360) hide show
  1. package/.vscode/launch.json +53 -0
  2. package/.vscode/settings.json +2 -0
  3. package/.vscode/tasks.json +15 -0
  4. package/README.md +3 -3
  5. package/abis.txt +92 -0
  6. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
  7. package/build/abi/{integral/relayer.json → wombat/pool.json} +587 -446
  8. package/build/config.js +0 -35
  9. package/build/config.js.map +1 -1
  10. package/build/constants.d.ts +0 -1
  11. package/build/constants.js +0 -1
  12. package/build/constants.js.map +1 -1
  13. package/build/dex/augustus-rfq.js +0 -1
  14. package/build/dex/augustus-rfq.js.map +1 -1
  15. package/build/dex/curve-v1/config.js +1 -57
  16. package/build/dex/curve-v1/config.js.map +1 -1
  17. package/build/dex/curve-v1-factory/config.js +1 -1
  18. package/build/dex/curve-v1-factory/config.js.map +1 -1
  19. package/build/dex/etherfi.js +1 -1
  20. package/build/dex/gmx/gmx.js.map +1 -1
  21. package/build/dex/index.js +0 -14
  22. package/build/dex/index.js.map +1 -1
  23. package/build/dex/nerve/config.js +0 -399
  24. package/build/dex/nerve/config.js.map +1 -1
  25. package/build/dex/paraswap-limit-orders/config.js +0 -7
  26. package/build/dex/paraswap-limit-orders/config.js.map +1 -1
  27. package/build/dex/quick-perps/quick-perps.js.map +1 -1
  28. package/build/dex/quickswap/config.js +0 -8
  29. package/build/dex/quickswap/config.js.map +1 -1
  30. package/build/dex/solidly/config.js +1 -27
  31. package/build/dex/solidly/config.js.map +1 -1
  32. package/build/dex/solidly/solidly.js +0 -2
  33. package/build/dex/solidly/solidly.js.map +1 -1
  34. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +1 -0
  35. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +53 -0
  36. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +1 -0
  37. package/build/dex/stable-pool/stable-pool.js +1 -8
  38. package/build/dex/stable-pool/stable-pool.js.map +1 -1
  39. package/build/dex/stable-pool.js +1 -8
  40. package/build/dex/stable-pool.js.map +1 -1
  41. package/build/dex/uniswap-v2/config.js +0 -152
  42. package/build/dex/uniswap-v2/config.js.map +1 -1
  43. package/build/dex/uniswap-v2/constants.js +0 -1
  44. package/build/dex/uniswap-v2/constants.js.map +1 -1
  45. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +17 -0
  46. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +64 -0
  47. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +1 -0
  48. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +17 -0
  49. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +79 -0
  50. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +1 -0
  51. package/build/dex/weth/config.js +0 -3
  52. package/build/dex/weth/config.js.map +1 -1
  53. package/build/dex/wsteth/wsteth.js.map +1 -1
  54. package/build/types.d.ts +0 -1
  55. package/package.json +1 -1
  56. package/src/config.ts +0 -39
  57. package/src/constants.ts +0 -1
  58. package/src/dex/augustus-rfq.ts +0 -1
  59. package/src/dex/curve-v1/config.ts +1 -57
  60. package/src/dex/curve-v1/curve-v1-e2e.test.ts +0 -51
  61. package/src/dex/curve-v1-factory/config.ts +1 -1
  62. package/src/dex/etherfi.ts +1 -1
  63. package/src/dex/gmx/gmx.ts +1 -4
  64. package/src/dex/index.ts +0 -14
  65. package/src/dex/nerve/config.ts +0 -400
  66. package/src/dex/nerve/nerve-e2e.test.ts +0 -507
  67. package/src/dex/nerve/nerve-events.test.ts +0 -268
  68. package/src/dex/paraswap-limit-orders/config.ts +0 -7
  69. package/src/dex/paraswap-limit-orders/paraswap-limit-orders-e2e.test.ts +2 -2
  70. package/src/dex/paraswap-limit-orders/paraswap-limit-orders-integration.test.ts +1 -1
  71. package/src/dex/quick-perps/quick-perps.ts +1 -4
  72. package/src/dex/quickswap/config.ts +0 -9
  73. package/src/dex/quickswap/quickswap-e2e.test.ts +0 -97
  74. package/src/dex/solidly/config.ts +1 -30
  75. package/src/dex/solidly/solidly-e2e.test.ts +0 -280
  76. package/src/dex/solidly/solidly-integration.test.ts +0 -135
  77. package/src/dex/solidly/solidly.ts +0 -2
  78. package/src/dex/stable-pool/stable-pool.ts +1 -8
  79. package/src/dex/uniswap-v2/config.ts +0 -185
  80. package/src/dex/uniswap-v2/constants.ts +0 -1
  81. package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +0 -272
  82. package/src/dex/uniswap-v2/uniswap-v2-e2e-base.test.ts +0 -6
  83. package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +0 -325
  84. package/src/dex/uniswap-v2/uniswap-v2-e2e-mainnet.test.ts +0 -175
  85. package/src/dex/uniswap-v2/uniswap-v2-e2e-polygon.test.ts +0 -413
  86. package/src/dex/weth/config.ts +0 -3
  87. package/src/dex/wsteth/wsteth.ts +1 -4
  88. package/src/types.ts +0 -1
  89. package/tests/constants-e2e.ts +0 -21
  90. package/tests/generate-new-limit-order.ts +1 -1
  91. package/.idea/aws.xml +0 -17
  92. package/.idea/codeStyles/Project.xml +0 -19
  93. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  94. package/.idea/misc.xml +0 -6
  95. package/.idea/modules.xml +0 -8
  96. package/.idea/paraswap-dex-lib.iml +0 -9
  97. package/.idea/prettier.xml +0 -7
  98. package/.idea/vcs.xml +0 -6
  99. package/build/abi/AugustusV6.abi.json +0 -395
  100. package/build/abi/algebra/AlgebraPool.abi.json +0 -727
  101. package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
  102. package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
  103. package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
  104. package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
  105. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  106. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +0 -285
  107. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +0 -583
  108. package/build/abi/wBETH.json +0 -1527
  109. package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
  110. package/build/abi/woo-fi/WooPP.abi.json +0 -548
  111. package/build/abi/woo-fi/Wooracle.abi.json +0 -260
  112. package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
  113. package/build/dex/aave-v3/tokens/avalanche.json +0 -74
  114. package/build/dex/aave-v3/tokens/fantom.json +0 -62
  115. package/build/dex/aave-v3/tokens/optimism.json +0 -50
  116. package/build/dex/aave-v3/tokens/polygon.json +0 -116
  117. package/build/dex/algebra/algebra-pool.d.ts +0 -114
  118. package/build/dex/algebra/algebra-pool.js +0 -448
  119. package/build/dex/algebra/algebra-pool.js.map +0 -1
  120. package/build/dex/balancer-v2/Gyro3Pool.d.ts +0 -43
  121. package/build/dex/balancer-v2/Gyro3Pool.js +0 -160
  122. package/build/dex/balancer-v2/Gyro3Pool.js.map +0 -1
  123. package/build/dex/balancer-v2/LinearMath.d.ts +0 -88
  124. package/build/dex/balancer-v2/LinearMath.js +0 -285
  125. package/build/dex/balancer-v2/LinearMath.js.map +0 -1
  126. package/build/dex/balancer-v2/LinearPool.d.ts +0 -81
  127. package/build/dex/balancer-v2/LinearPool.js +0 -444
  128. package/build/dex/balancer-v2/LinearPool.js.map +0 -1
  129. package/build/dex/balancer-v2/PhantomStablePool.d.ts +0 -90
  130. package/build/dex/balancer-v2/PhantomStablePool.js +0 -418
  131. package/build/dex/balancer-v2/PhantomStablePool.js.map +0 -1
  132. package/build/dex/balancer-v2/StableMath.d.ts +0 -9
  133. package/build/dex/balancer-v2/StableMath.js +0 -272
  134. package/build/dex/balancer-v2/StableMath.js.map +0 -1
  135. package/build/dex/balancer-v2/balancer-v2-pool.d.ts +0 -140
  136. package/build/dex/balancer-v2/balancer-v2-pool.js +0 -647
  137. package/build/dex/balancer-v2/balancer-v2-pool.js.map +0 -1
  138. package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
  139. package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
  140. package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
  141. package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
  142. package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
  143. package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
  144. package/build/dex/integral/config.d.ts +0 -4
  145. package/build/dex/integral/config.js +0 -18
  146. package/build/dex/integral/config.js.map +0 -1
  147. package/build/dex/integral/integral-pool.d.ts +0 -39
  148. package/build/dex/integral/integral-pool.js +0 -67
  149. package/build/dex/integral/integral-pool.js.map +0 -1
  150. package/build/dex/integral/integral.d.ts +0 -48
  151. package/build/dex/integral/integral.js +0 -402
  152. package/build/dex/integral/integral.js.map +0 -1
  153. package/build/dex/integral/types.d.ts +0 -25
  154. package/build/dex/integral/types.js +0 -9
  155. package/build/dex/integral/types.js.map +0 -1
  156. package/build/dex/lighter-v1/abi/erc20.json +0 -222
  157. package/build/dex/lighter-v1/abi/factory.json +0 -291
  158. package/build/dex/lighter-v1/abi/order_book.json +0 -594
  159. package/build/dex/lighter-v1/abi/order_book_helper.json +0 -176
  160. package/build/dex/lighter-v1/abi/router.json +0 -488
  161. package/build/dex/lighter-v1/config.d.ts +0 -4
  162. package/build/dex/lighter-v1/config.js +0 -17
  163. package/build/dex/lighter-v1/config.js.map +0 -1
  164. package/build/dex/lighter-v1/constants.d.ts +0 -2
  165. package/build/dex/lighter-v1/constants.js +0 -13
  166. package/build/dex/lighter-v1/constants.js.map +0 -1
  167. package/build/dex/lighter-v1/lighter-v1-pool.d.ts +0 -57
  168. package/build/dex/lighter-v1/lighter-v1-pool.js +0 -310
  169. package/build/dex/lighter-v1/lighter-v1-pool.js.map +0 -1
  170. package/build/dex/lighter-v1/lighter-v1.d.ts +0 -45
  171. package/build/dex/lighter-v1/lighter-v1.js +0 -331
  172. package/build/dex/lighter-v1/lighter-v1.js.map +0 -1
  173. package/build/dex/lighter-v1/types.d.ts +0 -40
  174. package/build/dex/lighter-v1/types.js +0 -3
  175. package/build/dex/lighter-v1/types.js.map +0 -1
  176. package/build/dex/pancakeswap-v3/types.d.ts +0 -14
  177. package/build/dex/pancakeswap-v3/types.js +0 -3
  178. package/build/dex/pancakeswap-v3/types.js.map +0 -1
  179. package/build/dex/quickswap/camelot-v3.d.ts +0 -6
  180. package/build/dex/quickswap/camelot-v3.js +0 -19
  181. package/build/dex/quickswap/camelot-v3.js.map +0 -1
  182. package/build/dex/quickswap/zyberswap-v3.d.ts +0 -6
  183. package/build/dex/quickswap/zyberswap-v3.js +0 -19
  184. package/build/dex/quickswap/zyberswap-v3.js.map +0 -1
  185. package/build/dex/quickswap-v3.d.ts +0 -21
  186. package/build/dex/quickswap-v3.js +0 -40
  187. package/build/dex/quickswap-v3.js.map +0 -1
  188. package/build/dex/ramses-v2/config.d.ts +0 -4
  189. package/build/dex/ramses-v2/config.js +0 -28
  190. package/build/dex/ramses-v2/config.js.map +0 -1
  191. package/build/dex/ramses-v2/constants.d.ts +0 -28
  192. package/build/dex/ramses-v2/constants.js +0 -35
  193. package/build/dex/ramses-v2/constants.js.map +0 -1
  194. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
  195. package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
  196. package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
  197. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
  198. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
  199. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
  200. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
  201. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
  202. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
  203. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
  204. package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
  205. package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
  206. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
  207. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
  208. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
  209. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
  210. package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
  211. package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
  212. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
  213. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
  214. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
  215. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
  216. package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
  217. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
  218. package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
  219. package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
  220. package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
  221. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
  222. package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
  223. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
  224. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
  225. package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
  226. package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
  227. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
  228. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
  229. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
  230. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
  231. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
  232. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
  233. package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
  234. package/build/dex/ramses-v2/contract-math/utils.js +0 -16
  235. package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
  236. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
  237. package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
  238. package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
  239. package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
  240. package/build/dex/ramses-v2/ramses-v2.js +0 -690
  241. package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
  242. package/build/dex/ramses-v2/types.d.ts +0 -154
  243. package/build/dex/ramses-v2/types.js +0 -9
  244. package/build/dex/ramses-v2/types.js.map +0 -1
  245. package/build/dex/ramses-v2/utils.d.ts +0 -6
  246. package/build/dex/ramses-v2/utils.js +0 -71
  247. package/build/dex/ramses-v2/utils.js.map +0 -1
  248. package/build/dex/solidly/forks-override/fvm.d.ts +0 -20
  249. package/build/dex/solidly/forks-override/fvm.js +0 -42
  250. package/build/dex/solidly/forks-override/fvm.js.map +0 -1
  251. package/build/dex/sushiswap-v3/config.d.ts +0 -4
  252. package/build/dex/sushiswap-v3/config.js +0 -132
  253. package/build/dex/sushiswap-v3/config.js.map +0 -1
  254. package/build/dex/sushiswap-v3/constants.d.ts +0 -4
  255. package/build/dex/sushiswap-v3/constants.js +0 -32
  256. package/build/dex/sushiswap-v3/constants.js.map +0 -1
  257. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
  258. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
  259. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
  260. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
  261. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
  262. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
  263. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
  264. package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
  265. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
  266. package/build/dex/sushiswap-v3/token.d.ts +0 -6
  267. package/build/dex/sushiswap-v3/token.js +0 -23
  268. package/build/dex/sushiswap-v3/token.js.map +0 -1
  269. package/build/dex/sushiswap-v3/types.d.ts +0 -15
  270. package/build/dex/sushiswap-v3/types.js +0 -18
  271. package/build/dex/sushiswap-v3/types.js.map +0 -1
  272. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +0 -12
  273. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +0 -23
  274. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +0 -1
  275. package/build/dex/woo-fi/config.d.ts +0 -4
  276. package/build/dex/woo-fi/config.js +0 -141
  277. package/build/dex/woo-fi/config.js.map +0 -1
  278. package/build/dex/woo-fi/constants.d.ts +0 -5
  279. package/build/dex/woo-fi/constants.js +0 -20
  280. package/build/dex/woo-fi/constants.js.map +0 -1
  281. package/build/dex/woo-fi/types.d.ts +0 -48
  282. package/build/dex/woo-fi/types.js +0 -3
  283. package/build/dex/woo-fi/types.js.map +0 -1
  284. package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
  285. package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
  286. package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
  287. package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
  288. package/build/dex/woo-fi/woo-fi-math.js +0 -300
  289. package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
  290. package/build/dex/woo-fi/woo-fi.d.ts +0 -65
  291. package/build/dex/woo-fi/woo-fi.js +0 -480
  292. package/build/dex/woo-fi/woo-fi.js.map +0 -1
  293. package/build/executor/IExecutorBytecodeBuilder.d.ts +0 -6
  294. package/build/executor/IExecutorBytecodeBuilder.js +0 -3
  295. package/build/executor/IExecutorBytecodeBuilder.js.map +0 -1
  296. package/src/abi/AaveV1_lending_pool.json +0 -27
  297. package/src/abi/platypus/asset.json +0 -490
  298. package/src/abi/platypus/avax-pool.json +0 -820
  299. package/src/abi/platypus/oracle.json +0 -119
  300. package/src/abi/platypus/pool.json +0 -677
  301. package/src/abi/smardex/all/smardex-router.json +0 -648
  302. package/src/abi/smardex/layer-1/smardex-factory.json +0 -242
  303. package/src/abi/smardex/layer-1/smardex-pool.json +0 -506
  304. package/src/abi/smardex/layer-2/smardex-factory.json +0 -185
  305. package/src/abi/smardex/layer-2/smardex-pool.json +0 -578
  306. package/src/abi/swaap-v1/asset.json +0 -490
  307. package/src/abi/swaap-v1/oracle.json +0 -119
  308. package/src/abi/swaap-v1/pool.json +0 -1346
  309. package/src/dex/aave-v1/aave-v1-e2e.test.ts +0 -105
  310. package/src/dex/aave-v1/aave-v1-integration.test.ts +0 -100
  311. package/src/dex/aave-v1/aave-v1.ts +0 -261
  312. package/src/dex/aave-v1/config.ts +0 -22
  313. package/src/dex/aave-v1/tokens-mainnet.json +0 -134
  314. package/src/dex/aave-v1/tokens.ts +0 -58
  315. package/src/dex/aave-v1/types.ts +0 -24
  316. package/src/dex/platypus/asset.ts +0 -139
  317. package/src/dex/platypus/config.ts +0 -72
  318. package/src/dex/platypus/platypus-e2e.test.ts +0 -168
  319. package/src/dex/platypus/platypus-events.test.ts +0 -167
  320. package/src/dex/platypus/platypus-integration.test.ts +0 -256
  321. package/src/dex/platypus/platypus.ts +0 -639
  322. package/src/dex/platypus/pool-avax.ts +0 -92
  323. package/src/dex/platypus/pool-base.ts +0 -155
  324. package/src/dex/platypus/pool-pure.ts +0 -71
  325. package/src/dex/platypus/pool-subscriber.ts +0 -239
  326. package/src/dex/platypus/pool.ts +0 -99
  327. package/src/dex/platypus/types.ts +0 -104
  328. package/src/dex/quickswap/spiritswap-v3.ts +0 -19
  329. package/src/dex/smardex/config.ts +0 -67
  330. package/src/dex/smardex/constants.ts +0 -35
  331. package/src/dex/smardex/sdk/constants.ts +0 -10
  332. package/src/dex/smardex/sdk/core.ts +0 -832
  333. package/src/dex/smardex/sdk/errors.ts +0 -18
  334. package/src/dex/smardex/sdk/types.ts +0 -68
  335. package/src/dex/smardex/sdk/utils.ts +0 -156
  336. package/src/dex/smardex/smardex-e2e.test.ts +0 -275
  337. package/src/dex/smardex/smardex-event-pool.ts +0 -164
  338. package/src/dex/smardex/smardex-events.test.ts +0 -297
  339. package/src/dex/smardex/smardex-integration.test.ts +0 -258
  340. package/src/dex/smardex/smardex.ts +0 -770
  341. package/src/dex/smardex/types.ts +0 -69
  342. package/src/dex/solidly/forks-override/cone.ts +0 -67
  343. package/src/dex/solidly/forks-override/solisnek.ts +0 -10
  344. package/src/dex/swaap-v1/config.ts +0 -62
  345. package/src/dex/swaap-v1/constants.ts +0 -22
  346. package/src/dex/swaap-v1/libraries/ChainlinkUtils.ts +0 -152
  347. package/src/dex/swaap-v1/libraries/Const.ts +0 -29
  348. package/src/dex/swaap-v1/libraries/GeometricBrownianMotion.ts +0 -433
  349. package/src/dex/swaap-v1/libraries/LogExpMath.ts +0 -511
  350. package/src/dex/swaap-v1/libraries/MathMMM.ts +0 -717
  351. package/src/dex/swaap-v1/libraries/Num.ts +0 -184
  352. package/src/dex/swaap-v1/libraries/PoolQuotations.ts +0 -322
  353. package/src/dex/swaap-v1/libraries/Struct.ts +0 -66
  354. package/src/dex/swaap-v1/swaap-v1-e2e.test.ts +0 -75
  355. package/src/dex/swaap-v1/swaap-v1-events.test.ts +0 -138
  356. package/src/dex/swaap-v1/swaap-v1-integration.test.ts +0 -232
  357. package/src/dex/swaap-v1/swaap-v1-pool.ts +0 -919
  358. package/src/dex/swaap-v1/swaap-v1.ts +0 -668
  359. package/src/dex/swaap-v1/types.ts +0 -124
  360. package/src/dex/uniswap-v2/uniswap-v2-e2e-ropsten.test.ts +0 -481
@@ -1,668 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import {
3
- Token,
4
- Address,
5
- ExchangePrices,
6
- PoolPrices,
7
- AdapterExchangeParam,
8
- SimpleExchangeParam,
9
- PoolLiquidity,
10
- Logger,
11
- MultiCallInput,
12
- NumberAsString,
13
- DexExchangeParam,
14
- } from '../../types';
15
- import { SwapSide, Network, MAX_INT, MAX_UINT } from '../../constants';
16
- import * as CALLDATA_GAS_COST from '../../calldata-gas-cost';
17
- import { getDexKeysWithNetwork, getBigIntPow } from '../../utils';
18
- import { IDex } from '../../dex/idex';
19
- import { IDexHelper } from '../../dex-helper/idex-helper';
20
- import { ChainLinkSubscriber } from '../../lib/chainlink';
21
- import {
22
- DexParams,
23
- SwaapV1Data,
24
- SwaapV1PoolState,
25
- SubgraphPoolBase,
26
- SwaapV1ProxySwapArguments,
27
- SwaapV1PoolSwapArguments,
28
- SwaapV1Swap,
29
- } from './types';
30
- import { SimpleExchange } from '../simple-exchange';
31
- import {
32
- SwaapV1Config,
33
- Adapters,
34
- SUBGRAPH_FETCH_ALL_POOOLS_RQ,
35
- SUBGRAPH_TIMEOUT,
36
- MAX_POOL_CNT,
37
- POOL_CACHE_TTL,
38
- MAX_GAS_COST_ESTIMATION,
39
- RECCURING_POOL_FETCH_INTERVAL_MS,
40
- } from './config';
41
- import { SwaapV1Pool } from './swaap-v1-pool';
42
- import PoolABI from '../../abi/swaap-v1/pool.json';
43
- import { PoolQuotations } from './libraries/PoolQuotations';
44
- import { extractReturnAmountPosition } from '../../executor/utils';
45
-
46
- export class SwaapV1 extends SimpleExchange implements IDex<SwaapV1Data> {
47
- static readonly poolInterface = new Interface(PoolABI);
48
-
49
- protected config: DexParams;
50
- protected subgraphURL: string;
51
- protected exchangeProxy: string;
52
-
53
- protected eventPools: { [poolAddress: string]: SwaapV1Pool } = {};
54
-
55
- readonly hasConstantPriceLargeAmounts = false;
56
- readonly isFeeOnTransferSupported: boolean = false;
57
-
58
- public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
59
- getDexKeysWithNetwork(SwaapV1Config);
60
-
61
- logger: Logger;
62
-
63
- constructor(
64
- readonly network: Network,
65
- readonly dexKey: string,
66
- readonly dexHelper: IDexHelper,
67
- protected adapters = Adapters[network], // TODO: add any additional optional params to support other fork DEXes
68
- ) {
69
- super(dexHelper, dexKey);
70
- this.config = SwaapV1Config[dexKey][network];
71
- this.logger = dexHelper.getLogger(`${dexKey}-${network}`);
72
- this.subgraphURL = this.config.subgraphURL;
73
- this.exchangeProxy = this.config.exchangeProxy;
74
- }
75
-
76
- // Initialize pricing is called once in the start of
77
- // pricing service. It is intended to setup the integration
78
- // for pricing requests. It is optional for a DEX to
79
- // implement this function
80
- async initializePricing(blockNumber: number) {
81
- await this.getPools(blockNumber, true);
82
- setInterval(
83
- () => this.getPools(null, false),
84
- RECCURING_POOL_FETCH_INTERVAL_MS,
85
- );
86
- }
87
-
88
- async getPools(_blockNumber: number | null, init: boolean) {
89
- const blockNumber = _blockNumber
90
- ? _blockNumber
91
- : await this.dexHelper.provider.getBlockNumber();
92
- const allPools = await this.fetchAllSubgraphPools(blockNumber);
93
-
94
- await SwaapV1.initPools(
95
- this.dexHelper,
96
- blockNumber,
97
- Object.values(allPools),
98
- );
99
- if (!allPools)
100
- if (init) {
101
- throw new Error(
102
- 'initializePricing: SwaapV1 cfgInfo still null after init',
103
- );
104
- }
105
- for (const poolConfig of allPools.values()) {
106
- if (
107
- init ||
108
- !Object.values(this.eventPools)
109
- .map(e => e.id)
110
- .includes(poolConfig.id)
111
- ) {
112
- await this.addPool(poolConfig, blockNumber);
113
- }
114
- }
115
- }
116
-
117
- async addPool(poolConfig: SubgraphPoolBase, blockNumber: number) {
118
- const pool = new SwaapV1Pool(
119
- this.dexKey,
120
- this.network,
121
- poolConfig,
122
- this.dexHelper,
123
- );
124
-
125
- await pool.initialize(blockNumber);
126
- this.eventPools[poolConfig.id] = pool;
127
- }
128
-
129
- // Returns estimated gas cost of calldata for this DEX in multiSwap
130
- getCalldataGasCost(poolPrices: PoolPrices<SwaapV1Data>): number | number[] {
131
- // TODO: update if there is any payload in getAdapterParam
132
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
133
- }
134
-
135
- // Returns the list of contract adapters (name and index)
136
- // for a buy/sell. Return null if there are no adapters.
137
- getAdapters(side: SwapSide): { name: string; index: number }[] | null {
138
- return this.adapters[side];
139
- }
140
-
141
- protected findPools(
142
- srcTokenAddress: Address,
143
- destTokenAddress: Address,
144
- ): Address[] {
145
- if (!this.eventPools) return [];
146
- return Object.values(this.eventPools)
147
- .filter(poolConfig => {
148
- return (
149
- poolConfig.tokens.includes(srcTokenAddress) &&
150
- poolConfig.tokens.includes(destTokenAddress)
151
- );
152
- })
153
- .map(p => p.id);
154
- }
155
-
156
- protected getPoolIdentifier(poolAddress: Address): string {
157
- return `${this.dexKey}_${poolAddress}`;
158
- }
159
-
160
- // Returns list of pool identifiers that can be used
161
- // for a given swap. poolIdentifers must be unique
162
- // across DEXes. It is recommended to use
163
- // ${dexKey}_${poolAddress} as a poolIdentifier
164
- async getPoolIdentifiers(
165
- srcToken: Token,
166
- destToken: Token,
167
- side: SwapSide,
168
- blockNumber: number,
169
- ): Promise<string[]> {
170
- return this.findPools(
171
- srcToken.address.toLowerCase(),
172
- destToken.address.toLowerCase(),
173
- ).map(p => this.getPoolIdentifier(p));
174
- }
175
-
176
- // Encode params required by the exchange adapter
177
- // Used for multiSwap, buy & megaSwap
178
- // Hint: abiCoder.encodeParameter() couls be useful
179
- getAdapterParam(
180
- srcToken: string,
181
- destToken: string,
182
- srcAmount: string,
183
- destAmount: string,
184
- data: SwaapV1Data,
185
- side: SwapSide,
186
- ): AdapterExchangeParam {
187
- return {
188
- targetExchange: data.pool,
189
- payload: '0x',
190
- networkFee: '0',
191
- };
192
- }
193
-
194
- private getSwaapV1Param(
195
- srcToken: string,
196
- destToken: string,
197
- srcAmount: string,
198
- destAmount: string,
199
- data: SwaapV1Data,
200
- side: SwapSide,
201
- ): [SwaapV1PoolSwapArguments, string] {
202
- let functionName;
203
- let limitAmount;
204
- let amountIn;
205
- let amountOut;
206
- if (side == SwapSide.SELL) {
207
- functionName = 'swapExactAmountInMMM';
208
- limitAmount = MAX_INT;
209
- amountIn = BigInt(srcAmount);
210
- amountOut = BigInt(0);
211
- } else {
212
- functionName = 'swapExactAmountOutMMM';
213
- limitAmount = MAX_INT;
214
- amountIn = BigInt(MAX_UINT);
215
- amountOut = BigInt(destAmount);
216
- }
217
-
218
- const params: SwaapV1PoolSwapArguments = [
219
- srcToken,
220
- BigInt(amountIn),
221
- destToken,
222
- BigInt(amountOut),
223
- BigInt(MAX_UINT),
224
- ];
225
-
226
- return [params, functionName];
227
- }
228
-
229
- // Encode call data used by simpleSwap like routers
230
- // Used for simpleSwap & simpleBuy
231
- // Hint: this.buildSimpleParamWithoutWETHConversion
232
- // could be useful
233
- async getSimpleParam(
234
- srcToken: string,
235
- destToken: string,
236
- srcAmount: string,
237
- destAmount: string,
238
- data: SwaapV1Data,
239
- side: SwapSide,
240
- ): Promise<SimpleExchangeParam> {
241
- const [params, functionName] = this.getSwaapV1Param(
242
- srcToken,
243
- destToken,
244
- srcAmount,
245
- destAmount,
246
- data,
247
- side,
248
- );
249
- const swapData = SwaapV1.poolInterface.encodeFunctionData(
250
- functionName,
251
- params,
252
- );
253
- return this.buildSimpleParamWithoutWETHConversion(
254
- srcToken,
255
- srcAmount,
256
- destToken,
257
- destAmount,
258
- swapData,
259
- data.pool,
260
- );
261
- }
262
-
263
- getDexParam(
264
- srcToken: Address,
265
- destToken: Address,
266
- srcAmount: NumberAsString,
267
- destAmount: NumberAsString,
268
- recipient: Address,
269
- data: SwaapV1Data,
270
- side: SwapSide,
271
- ): DexExchangeParam {
272
- const [params, functionName] = this.getSwaapV1Param(
273
- srcToken,
274
- destToken,
275
- srcAmount,
276
- destAmount,
277
- data,
278
- side,
279
- );
280
- const swapData = SwaapV1.poolInterface.encodeFunctionData(
281
- functionName,
282
- params,
283
- );
284
-
285
- return {
286
- needWrapNative: this.needWrapNative,
287
- dexFuncHasRecipient: false,
288
- exchangeData: swapData,
289
- targetExchange: data.pool,
290
- returnAmountPos:
291
- side === SwapSide.SELL
292
- ? extractReturnAmountPosition(
293
- SwaapV1.poolInterface,
294
- functionName,
295
- 'tokenAmountOut',
296
- )
297
- : undefined,
298
- };
299
- }
300
-
301
- // // Returns list of top pools based on liquidity. Max
302
- // // limit number pools should be returned.
303
- async getTopPoolsForToken(
304
- tokenAddress: Address,
305
- count: number,
306
- ): Promise<PoolLiquidity[]> {
307
- return this.getTopPoolsForTokens([tokenAddress], count, null).then(
308
- pools =>
309
- pools.map((pool: SubgraphPoolBase) => {
310
- return {
311
- exchange: this.dexKey,
312
- address: pool.id.toLowerCase(),
313
- connectorTokens: pool.tokens.reduce(
314
- (
315
- acc: Token[],
316
- { decimals, address }: { decimals: number; address: string },
317
- ) => {
318
- if (address.toLowerCase() != tokenAddress.toLowerCase()) {
319
- acc.push({ decimals, address: address.toLowerCase() });
320
- }
321
- return acc;
322
- },
323
- [],
324
- ),
325
- liquidityUSD: Number(pool.liquidityUSD),
326
- };
327
- }),
328
- _ => [],
329
- );
330
- }
331
-
332
- // // Returns list of top pools based on liquidity. Max
333
- // // limit number pools should be returned.
334
- async getTopPoolsForTokens(
335
- tokenAddresses: Address[],
336
- count: number,
337
- blockNumber: number | null,
338
- ): Promise<SubgraphPoolBase[]> {
339
- const variables = {
340
- tokens: tokenAddresses,
341
- count,
342
- };
343
- const query = `query ($tokens: [Bytes!], $count: Int) {
344
- pools (first: $count, orderBy: liquidity, orderDirection: desc,
345
- where: {tokensList_contains: $tokens,
346
- finalized: true,
347
- liquidity_gt: 0}) {
348
- id
349
- liquidityUSD: liquidity
350
- tokens {
351
- address
352
- decimals
353
- }
354
- }
355
- }`;
356
- const { data } = await this.dexHelper.httpRequest.post(
357
- this.subgraphURL,
358
- {
359
- query,
360
- variables,
361
- },
362
- SUBGRAPH_TIMEOUT,
363
- );
364
-
365
- if (!(data && data.pools))
366
- throw new Error(
367
- `Error_${this.dexKey}_Subgraph: couldn't fetch the pools from the subgraph`,
368
- );
369
-
370
- return data.pools.map((pool: SubgraphPoolBase) => {
371
- const castedPool = SwaapV1.castSubgraphPoolBase(pool);
372
- if (
373
- blockNumber &&
374
- !Object.values(this.eventPools)
375
- .map(e => e.id)
376
- .includes(castedPool.id)
377
- ) {
378
- this.addPool(castedPool, blockNumber!);
379
- }
380
- return castedPool;
381
- });
382
- }
383
-
384
- static castSubgraphPoolBase(pool: SubgraphPoolBase): SubgraphPoolBase {
385
- return {
386
- ...pool,
387
- liquidityUSD: Number(pool.liquidityUSD),
388
- swapFee: Number(pool.swapFee),
389
- dynamicCoverageFeesZ: Number(pool.dynamicCoverageFeesZ),
390
- dynamicCoverageFeesHorizon: Number(pool.dynamicCoverageFeesHorizon),
391
- priceStatisticsLookbackInSec: Number(pool.priceStatisticsLookbackInSec),
392
- maxPriceUnpegRatio: Number(pool.maxPriceUnpegRatio),
393
- };
394
- }
395
-
396
- async fetchAllSubgraphPools(
397
- blockNumber: number,
398
- ): Promise<Map<string, SubgraphPoolBase>> {
399
- const cacheKey = 'AllSubgraphPools';
400
- const cachedPools = await this.dexHelper.cache.get(
401
- this.dexKey,
402
- this.network,
403
- cacheKey,
404
- );
405
- if (cachedPools) {
406
- const allPools = JSON.parse(cachedPools);
407
- this.logger.info(
408
- `Got ${allPools.length} ${this.dexKey}_${this.network} pools from cache`,
409
- );
410
- return allPools;
411
- }
412
-
413
- this.logger.info(
414
- `Fetching ${this.dexKey}_${this.network} Pools from subgraph`,
415
- );
416
- const variables = {
417
- count: MAX_POOL_CNT,
418
- };
419
- const { data } = await this.dexHelper.httpRequest.post(
420
- this.subgraphURL,
421
- { query: SUBGRAPH_FETCH_ALL_POOOLS_RQ, variables },
422
- SUBGRAPH_TIMEOUT,
423
- );
424
- if (!(data && data.pools))
425
- throw new Error('Unable to fetch pools from the subgraph');
426
-
427
- this.dexHelper.cache.setex(
428
- this.dexKey,
429
- this.network,
430
- cacheKey,
431
- POOL_CACHE_TTL,
432
- JSON.stringify(data.pools),
433
- );
434
- const allPools = await SwaapV1.initPools(
435
- this.dexHelper,
436
- blockNumber,
437
- data.pools,
438
- );
439
-
440
- this.logger.info(
441
- `Got ${allPools.size} ${this.dexKey}_${this.network} pools from subgraph`,
442
- );
443
- return allPools;
444
- }
445
-
446
- static async initPools(
447
- dexHelper: IDexHelper,
448
- blockNumber: number,
449
- allPools: SubgraphPoolBase[],
450
- ): Promise<Map<string, SubgraphPoolBase>> {
451
- // aggregators
452
- let inputs: any = allPools
453
- .map((pool: SubgraphPoolBase) => {
454
- return pool.tokens.map(t =>
455
- ChainLinkSubscriber.getReadAggregatorMultiCallInput(
456
- t.oracleInitialState.proxy,
457
- ),
458
- );
459
- })
460
- .flat();
461
- let returnData = (
462
- await dexHelper.multiContract.methods
463
- .aggregate(inputs)
464
- .call({}, blockNumber)
465
- ).returnData;
466
- let idx: number = 0;
467
- allPools.forEach((pool: SubgraphPoolBase) => {
468
- pool.tokens.forEach(token => {
469
- const aggregator: Address = ChainLinkSubscriber.proxyInterface
470
- .decodeFunctionResult('aggregator', returnData[idx++])[0]
471
- .toLowerCase();
472
- token.oracleInitialState.aggregator = aggregator;
473
- });
474
- });
475
-
476
- return allPools.reduce(
477
- (acc: Map<string, SubgraphPoolBase>, pool: SubgraphPoolBase) => {
478
- return acc.set(pool.id, {
479
- ...SwaapV1.castSubgraphPoolBase(pool),
480
- });
481
- },
482
- new Map<string, SubgraphPoolBase>(),
483
- );
484
- }
485
-
486
- getPricesPool(
487
- from: Address,
488
- to: Address,
489
- unitVolume: bigint,
490
- amounts: bigint[],
491
- side: SwapSide,
492
- state: SwaapV1PoolState,
493
- currentTimestamp: bigint,
494
- ): [bigint, bigint[]] {
495
- if (side === SwapSide.SELL) {
496
- let unitAmountOut: bigint;
497
- try {
498
- unitAmountOut = PoolQuotations.getAmountOutGivenInMMM(
499
- state.liquidities[from],
500
- state.oracles[from],
501
- unitVolume,
502
- state.liquidities[to],
503
- state.oracles[to],
504
- state.parameters,
505
- currentTimestamp,
506
- );
507
- } catch (e) {
508
- this.logger.warn(
509
- `Failed to get historical round data: (unit: ${unitVolume})`,
510
- e,
511
- );
512
- unitAmountOut = 0n;
513
- }
514
-
515
- const amountsOut: bigint[] = amounts.map(amountIn => {
516
- try {
517
- return PoolQuotations.getAmountOutGivenInMMM(
518
- state.liquidities[from],
519
- state.oracles[from],
520
- amountIn,
521
- state.liquidities[to],
522
- state.oracles[to],
523
- state.parameters,
524
- currentTimestamp,
525
- );
526
- } catch (e) {
527
- return 0n;
528
- }
529
- });
530
-
531
- return [unitAmountOut, amountsOut];
532
- } else {
533
- let unitAmountIn;
534
- try {
535
- unitAmountIn = PoolQuotations.getAmountInGivenOutMMM(
536
- state.liquidities[from],
537
- state.oracles[from],
538
- state.liquidities[to],
539
- state.oracles[to],
540
- unitVolume,
541
- state.parameters,
542
- currentTimestamp,
543
- );
544
- } catch (e) {
545
- unitAmountIn = BigInt(MAX_UINT);
546
- }
547
-
548
- const amountsIn = amounts.map(amountOut => {
549
- try {
550
- return PoolQuotations.getAmountInGivenOutMMM(
551
- state.liquidities[from],
552
- state.oracles[from],
553
- state.liquidities[to],
554
- state.oracles[to],
555
- amountOut,
556
- state.parameters,
557
- currentTimestamp,
558
- );
559
- } catch (e) {
560
- return BigInt(MAX_UINT);
561
- }
562
- });
563
- return [unitAmountIn, amountsIn];
564
- }
565
- }
566
-
567
- // Returns pool prices for amounts.
568
- // If limitPools is defined only pools in limitPools
569
- // should be used. If limitPools is undefined then
570
- // any pools can be used.
571
- getPricesVolume(
572
- _from: Token,
573
- _to: Token,
574
- amounts: bigint[],
575
- side: SwapSide,
576
- blockNumber: number,
577
- limitPools?: string[],
578
- ): Promise<null | ExchangePrices<SwaapV1Data>> {
579
- return this.getPricesVolumeLogic(
580
- _from,
581
- _to,
582
- amounts,
583
- side,
584
- blockNumber,
585
- null,
586
- limitPools,
587
- );
588
- }
589
-
590
- async getPricesVolumeLogic(
591
- _from: Token,
592
- _to: Token,
593
- amounts: bigint[],
594
- side: SwapSide,
595
- blockNumber: number,
596
- _currentTimeStamp: bigint | null,
597
- limitPools?: string[],
598
- ): Promise<null | ExchangePrices<SwaapV1Data>> {
599
- const from = this.dexHelper.config.wrapETH(_from);
600
- const to = this.dexHelper.config.wrapETH(_to);
601
-
602
- const srcTokenAddress = from.address.toLowerCase();
603
- const destTokenAddress = to.address.toLowerCase();
604
-
605
- const topPools: Address[] = this.findPools(
606
- srcTokenAddress,
607
- destTokenAddress,
608
- );
609
-
610
- const allowedPools = limitPools
611
- ? topPools.filter((p: Address) =>
612
- limitPools.includes(`${this.dexKey}_${p.toLowerCase()}`),
613
- )
614
- : topPools;
615
-
616
- if (!allowedPools.length) return null;
617
-
618
- const unitVolume = getBigIntPow(
619
- (side === SwapSide.SELL ? from : to).decimals,
620
- );
621
-
622
- if (srcTokenAddress === destTokenAddress) return null;
623
- const currentTimestamp =
624
- _currentTimeStamp || BigInt(Math.floor(Date.now() / 1000)); // the on-chain pricing logic is not too much sensitive to that value
625
- return await Promise.all(
626
- allowedPools.map(async poolAddress => {
627
- let state = this.eventPools[poolAddress].getState(blockNumber);
628
- if (!state) {
629
- state = await this.eventPools[poolAddress].generateState(blockNumber);
630
- }
631
- let [unit, prices] = this.getPricesPool(
632
- from.address,
633
- to.address,
634
- unitVolume,
635
- amounts,
636
- side,
637
- state,
638
- currentTimestamp,
639
- );
640
-
641
- if (unit === 0n) {
642
- // If we didn't fulfill unit amount, scale up the latest amount with a positive price till unit
643
- let i = prices.length - 1;
644
- let largestAmountPositivePrice = prices.slice(i)[0];
645
- while (largestAmountPositivePrice == 0n && i > 0) {
646
- --i;
647
- largestAmountPositivePrice = prices.slice(i)[0];
648
- }
649
- if (largestAmountPositivePrice > 0n) {
650
- unit =
651
- (unitVolume * largestAmountPositivePrice) / amounts.slice(i)[0];
652
- }
653
- }
654
- return {
655
- prices,
656
- unit,
657
- data: {
658
- pool: poolAddress,
659
- },
660
- poolAddresses: [poolAddress],
661
- exchange: this.dexKey,
662
- gasCost: MAX_GAS_COST_ESTIMATION,
663
- poolIdentifier: this.getPoolIdentifier(poolAddress),
664
- };
665
- }),
666
- );
667
- }
668
- }