@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,331 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.LighterV1 = void 0;
30
- const constants_1 = require("../../constants");
31
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
32
- const utils_1 = require("../../utils");
33
- const simple_exchange_1 = require("../simple-exchange");
34
- const config_1 = require("./config");
35
- const lighter_v1_pool_1 = require("./lighter-v1-pool");
36
- const utils_2 = require("ethers/lib/utils");
37
- const order_book_helper_json_1 = __importDefault(require("./abi/order_book_helper.json"));
38
- const factory_json_1 = __importDefault(require("./abi/factory.json"));
39
- const router_json_1 = __importDefault(require("./abi/router.json"));
40
- const erc20_json_1 = __importDefault(require("./abi/erc20.json"));
41
- const ethers_1 = require("ethers");
42
- class LighterV1 extends simple_exchange_1.SimpleExchange {
43
- constructor(network, dexKey, dexHelper, config = config_1.LighterV1Config[dexKey][network], adapters = config_1.Adapters[network] || {}) {
44
- super(dexHelper, dexKey);
45
- this.network = network;
46
- this.dexKey = dexKey;
47
- this.dexHelper = dexHelper;
48
- this.config = config;
49
- this.adapters = adapters;
50
- // protected eventPools: LighterV1EventPool;
51
- this.hasConstantPriceLargeAmounts = false;
52
- // TODO: set true here if protocols works only with wrapped asset
53
- this.needWrapNative = true;
54
- this.isFeeOnTransferSupported = false;
55
- this.factoryIface = new utils_2.Interface(factory_json_1.default);
56
- this.routerIface = new utils_2.Interface(router_json_1.default);
57
- this.orderBookHelperIface = new utils_2.Interface(order_book_helper_json_1.default);
58
- this.allSupportedOrderBooks = new Map();
59
- this.orderBooks = new Map();
60
- this.logger = dexHelper.getLogger(dexKey);
61
- }
62
- // Initialize pricing is called once in the start of
63
- // pricing service. It is intended to setup the integration
64
- // for pricing requests. It is optional for a DEX to
65
- // implement this function
66
- async initializePricing(blockNumber) {
67
- await this.updatePoolState(blockNumber);
68
- }
69
- // Returns the list of contract adapters (name and index)
70
- // for a buy/sell. Return null if there are no adapters.
71
- getAdapters(side) {
72
- return this.adapters[side] ? this.adapters[side] : null;
73
- }
74
- // Returns list of pool identifiers that can be used
75
- // for a given swap. poolIdentifiers must be unique
76
- // across DEXes. It is recommended to use
77
- // ${dexKey}_${poolAddress} as a poolIdentifier
78
- async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
79
- if (side == constants_1.SwapSide.BUY) {
80
- return [];
81
- }
82
- const _srcToken = this.dexHelper.config.wrapETH(srcToken);
83
- const _destToken = this.dexHelper.config.wrapETH(destToken);
84
- const keyForAsk = `${_srcToken.address}-${_destToken.address}`;
85
- const keyForBid = `${_destToken.address}-${_srcToken.address}`;
86
- const orderBookForAsk = this.allSupportedOrderBooks.get(keyForAsk);
87
- if (orderBookForAsk) {
88
- return [`${this.dexKey}_${keyForAsk}`];
89
- }
90
- const orderBookForBid = this.allSupportedOrderBooks.get(keyForBid);
91
- if (orderBookForBid) {
92
- return [`${this.dexKey}_${keyForBid}}`];
93
- }
94
- return [];
95
- }
96
- // Returns pool prices for amounts.
97
- // If limitPools is defined only pools in limitPools
98
- // should be used. If limitPools is undefined then
99
- // any pools can be used.
100
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
101
- const poolIdentifier = await this.getPoolIdentifiers(srcToken, destToken, side, blockNumber);
102
- if (poolIdentifier.length == 0) {
103
- return null;
104
- }
105
- // LighterV1_0x82aF49447D8a07e3bd95BD0d56f35241523fBab1_0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8
106
- // omit LighterV1 from this string, split
107
- const key = poolIdentifier[0].split('_')[1];
108
- const orderBookType = this.allSupportedOrderBooks.get(key);
109
- if (!orderBookType) {
110
- return null;
111
- }
112
- const pool = this.orderBooks.get(orderBookType.orderBookId);
113
- if (!pool) {
114
- return null;
115
- }
116
- let state = pool.getState(blockNumber);
117
- if (!state) {
118
- state = await pool.generateState(blockNumber);
119
- }
120
- const orderBookData = state.orderBook;
121
- const limitOrders = orderBookType.isAsk
122
- ? orderBookData.sortedBids
123
- : orderBookData.sortedAsks;
124
- const outAmounts = await this.getOutAmount(amounts, orderBookType.isAsk, limitOrders, state.sizeTick);
125
- return [
126
- {
127
- prices: outAmounts,
128
- unit: (0, utils_1.bigIntify)(0),
129
- data: { exchange: this.dexKey },
130
- poolIdentifier: poolIdentifier[0],
131
- exchange: this.dexKey,
132
- gasCost: CALLDATA_GAS_COST.DEX_NO_PAYLOAD,
133
- poolAddresses: [pool.orderBookAddress],
134
- },
135
- ];
136
- }
137
- async getOutAmount(amountIns, isAsk, limitOrders, sizeTick) {
138
- return amountIns.map(amountIn => {
139
- // This is important, reviewer should check this
140
- // there is a size tick in the order book and we need to round the amountIn
141
- if (isAsk) {
142
- amountIn -= amountIn % BigInt(sizeTick);
143
- }
144
- let remainingAmountIn = amountIn;
145
- let runningAmountOut = BigInt(0);
146
- let partialAmountOut = BigInt(0);
147
- let orderAmountIn = BigInt(0);
148
- let orderAmountOut = BigInt(0);
149
- for (let i = 0; i < limitOrders.length && remainingAmountIn > BigInt(0); i++) {
150
- if (isAsk != limitOrders[i].isAsk) {
151
- orderAmountIn = limitOrders[i].amount0;
152
- orderAmountOut = limitOrders[i].amount1;
153
- if (remainingAmountIn >= orderAmountIn) {
154
- runningAmountOut += orderAmountOut;
155
- remainingAmountIn -= orderAmountIn;
156
- }
157
- else {
158
- partialAmountOut =
159
- (remainingAmountIn * orderAmountOut) / orderAmountIn;
160
- if (!isAsk) {
161
- partialAmountOut -= partialAmountOut % BigInt(sizeTick);
162
- }
163
- runningAmountOut += partialAmountOut;
164
- remainingAmountIn -=
165
- (partialAmountOut * orderAmountIn) / orderAmountOut;
166
- break;
167
- }
168
- }
169
- }
170
- return runningAmountOut;
171
- });
172
- }
173
- // Returns estimated gas cost of calldata for this DEX in multiSwap
174
- getCalldataGasCost(poolPrices) {
175
- // TODO: update if there is any payload in getAdapterParam
176
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
177
- }
178
- // Encode params required by the exchange adapter
179
- // Used for multiSwap, buy & megaSwap
180
- // Hint: abiCoder.encodeParameter() could be useful
181
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
182
- const { exchange } = data;
183
- // Encode here the payload for adapter
184
- const payload = '';
185
- return {
186
- targetExchange: exchange,
187
- payload,
188
- networkFee: '0',
189
- };
190
- }
191
- // Encode call data used by simpleSwap like routers
192
- // Used for simpleSwap & simpleBuy
193
- // Hint: this.buildSimpleParamWithoutWETHConversion
194
- // could be useful
195
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
196
- if (side == constants_1.SwapSide.BUY) {
197
- throw new Error('Buy not supported');
198
- }
199
- const poolIdentifier = await this.getPoolIdentifiers({ address: srcToken, decimals: 0 }, { address: destToken, decimals: 0 }, constants_1.SwapSide.SELL, 0);
200
- if (poolIdentifier.length == 0) {
201
- throw new Error('Pool identifier not found');
202
- }
203
- const key = poolIdentifier[0].split('_')[1];
204
- const orderBookType = this.allSupportedOrderBooks.get(key);
205
- if (!orderBookType) {
206
- throw new Error('Order book type not found');
207
- }
208
- // Encode here the transaction arguments
209
- const helper = new ethers_1.ethers.Contract(this.config.orderBookHelper, this.orderBookHelperIface);
210
- const payload = helper.interface.encodeFunctionData('swapExactInput', [
211
- orderBookType.orderBookId,
212
- orderBookType.isAsk,
213
- srcAmount,
214
- destAmount,
215
- ]);
216
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, payload, helper.address);
217
- }
218
- async getQuoteFromHelper(blockNumber, orderBookId, amountIn, isAsk) {
219
- const helper = new ethers_1.ethers.Contract(this.config.orderBookHelper, this.orderBookHelperIface);
220
- const data = await this.dexHelper.provider.call({
221
- to: helper.address,
222
- data: helper.interface.encodeFunctionData('quoteExactInput', [
223
- orderBookId,
224
- isAsk,
225
- amountIn,
226
- ]),
227
- }, blockNumber);
228
- const [amountInResult, amountOut] = helper.interface.decodeFunctionResult('quoteExactInput', data);
229
- return amountOut;
230
- }
231
- // This is called once before getTopPoolsForToken is
232
- // called for multiple tokens. This can be helpful to
233
- // update common state required for calculating
234
- // getTopPoolsForToken. It is optional for a DEX
235
- // to implement this
236
- async updatePoolState(blockNumber) {
237
- const helper = new ethers_1.ethers.Contract(this.config.orderBookHelper, this.orderBookHelperIface);
238
- const block = blockNumber
239
- ? blockNumber
240
- : await this.dexHelper.provider.getBlockNumber();
241
- const data = await this.dexHelper.provider.call({
242
- to: helper.address,
243
- data: helper.interface.encodeFunctionData('getAllOrderBooks', []),
244
- }, block);
245
- const [orderBookIds, orderBookAddresses, token0s, token1s, sizeTicks, _] = helper.interface.decodeFunctionResult('getAllOrderBooks', data);
246
- for (let i = 0; i < orderBookIds.length; i++) {
247
- // Generate keys for both sides of each order book
248
- const keyForAsk = `${token0s[i]}-${token1s[i]}`;
249
- const keyForBid = `${token1s[i]}-${token0s[i]}`;
250
- if (!this.allSupportedOrderBooks.has(keyForAsk)) {
251
- // Construct the OrderBookType objects
252
- const orderBookForAsk = { orderBookId: orderBookIds[i], isAsk: true };
253
- const orderBookForBid = { orderBookId: orderBookIds[i], isAsk: false };
254
- // Add the order books to the map
255
- this.allSupportedOrderBooks.set(keyForAsk, orderBookForAsk);
256
- this.allSupportedOrderBooks.set(keyForBid, orderBookForBid);
257
- }
258
- let pool;
259
- if (!this.orderBooks.has(orderBookIds[i])) {
260
- const token0 = new ethers_1.ethers.Contract(token0s[i], erc20_json_1.default, this.dexHelper.provider);
261
- const token1 = new ethers_1.ethers.Contract(token1s[i], erc20_json_1.default, this.dexHelper.provider);
262
- // get token symbol
263
- const token0Symbol = await token0.symbol();
264
- const token1Symbol = await token1.symbol();
265
- // get token decimals
266
- const token0Decimals = await token0.decimals();
267
- const token1Decimals = await token1.decimals();
268
- const baseToken = {
269
- address: token0s[i],
270
- decimals: token0Decimals,
271
- symbol: token0Symbol,
272
- };
273
- const quoteToken = {
274
- address: token1s[i],
275
- decimals: token1Decimals,
276
- symbol: token1Symbol,
277
- };
278
- // create pool
279
- pool = new lighter_v1_pool_1.LighterV1EventPool(this.dexKey, this.network, this.dexHelper, this.logger, this.config.factory, this.config.router, orderBookIds[i], orderBookAddresses[i], baseToken, quoteToken, sizeTicks[i]);
280
- this.orderBooks.set(orderBookIds[i], pool);
281
- }
282
- pool = this.orderBooks.get(orderBookIds[i]);
283
- const state = await pool.generateState(block);
284
- pool.setState(state, block);
285
- }
286
- }
287
- // Returns list of top pools based on liquidity. Max
288
- // limit number pools should be returned.
289
- async getTopPoolsForToken(tokenAddress, limit) {
290
- const pools = [];
291
- // find the pools that have the token in allSupportedOrderBooks keys
292
- for (const [key, orderBookType] of this.allSupportedOrderBooks) {
293
- if (pools.length >= limit) {
294
- break;
295
- }
296
- const [token0, token1] = key.split('-');
297
- // if one of these tokens is given token
298
- if (token0 == tokenAddress) {
299
- const pool = this.orderBooks.get(orderBookType.orderBookId);
300
- if (!pool) {
301
- continue;
302
- }
303
- const state = pool.getState(pool.getStateBlockNumber());
304
- if (!state) {
305
- continue;
306
- }
307
- const liq = await pool.calculateLiquidity();
308
- // find the connector token,
309
- // if token0 is the given token, then token1 is the connector token
310
- const connectorToken = tokenAddress == state.baseToken.address
311
- ? state.quoteToken
312
- : state.baseToken;
313
- pools.push({
314
- exchange: this.dexKey,
315
- address: this.config.orderBookHelper,
316
- connectorTokens: [connectorToken],
317
- liquidityUSD: liq,
318
- });
319
- }
320
- }
321
- return pools;
322
- }
323
- // This is optional function in case if your implementation has acquired any resources
324
- // you need to release for graceful shutdown. For example, it may be any interval timer
325
- releaseResources() {
326
- // TODO: complete me!
327
- }
328
- }
329
- exports.LighterV1 = LighterV1;
330
- LighterV1.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.LighterV1Config);
331
- //# sourceMappingURL=lighter-v1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lighter-v1.js","sourceRoot":"","sources":["../../../src/dex/lighter-v1/lighter-v1.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAA+D;AAU/D,wDAAoD;AACpD,qCAAqD;AACrD,uDAAuD;AACvD,4CAA6C;AAE7C,0FAAyE;AACzE,sEAAuD;AACvD,oEAAqD;AACrD,kEAA0C;AAC1C,mCAAgC;AAEhC,MAAa,SAAU,SAAQ,gCAAc;IA8B3C,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACvB,SAAS,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EACtC,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACvB,WAAM,GAAN,MAAM,CAAmC;QACtC,aAAQ,GAAR,QAA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AmE;gBAEnE,MAAM,cAAc,GAClB,YAAY,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO;oBACrC,CAAC,CAAC,KAAK,CAAC,UAAU;oBAClB,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAEtB,KAAK,CAAC,IAAI,CAAC;oBACT,QAAQ,EAAE,IAAI,CAAC,MAAM;oBACrB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe;oBACpC,eAAe,EAAE,CAAC,cAAc,CAAC;oBACjC,YAAY,EAAE,GAAG;iBAClB,CAAC,CAAC;aACJ;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,sFAAsF;IACtF,uFAAuF;IACvF,gBAAgB;QACd,qBAAqB;IACvB,CAAC;;AA9dH,8BA+dC;AAtde,4BAAkB,GAC9B,IAAA,6BAAqB,EAAC,wBAAe,CAAC,CAAC"}
@@ -1,40 +0,0 @@
1
- import { Address, Token } from '../../types';
2
- export declare type PoolState = {
3
- pool: Address;
4
- baseToken: Token;
5
- quoteToken: Token;
6
- orderBook: OrderBook;
7
- sizeTick: bigint;
8
- };
9
- export declare type OrderBook = {
10
- sortedAsks: LimitOrder[];
11
- sortedBids: LimitOrder[];
12
- };
13
- export declare type LighterV1Data = {
14
- exchange: Address;
15
- };
16
- export declare type DexParams = {
17
- factory: Address;
18
- router: Address;
19
- orderBookHelper: Address;
20
- };
21
- export declare type OrderBookDetails = {
22
- orderBookId: number;
23
- orderBookAddress: string;
24
- token0Address: string;
25
- token1Address: string;
26
- sizeTick: number;
27
- priceTick: number;
28
- };
29
- export declare type LimitOrder = {
30
- id: number;
31
- amount0: bigint;
32
- amount1: bigint;
33
- isAsk: boolean;
34
- price: number;
35
- };
36
- export declare type OrderBookType = {
37
- orderBookId: number;
38
- isAsk: boolean;
39
- };
40
- export declare type AllOrderBooks = Map<string, OrderBookType>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/lighter-v1/types.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import { Address } from '../../types';
2
- export declare type DexParams = {
3
- router: Address;
4
- quoter: Address;
5
- factory: Address;
6
- stateMulticall: Address;
7
- uniswapMulticall: Address;
8
- supportedFees: bigint[];
9
- feeProtocols: bigint[];
10
- chunksCount: number;
11
- deployer?: Address;
12
- subgraphURL: string;
13
- initHash: string;
14
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/pancakeswap-v3/types.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { IDexHelper } from '../../dex-helper';
2
- import { QuickSwapV3 } from './quickswap-v3';
3
- export declare class CamelotV3 extends QuickSwapV3 {
4
- static dexKeys: string[];
5
- constructor(dexHelper: IDexHelper);
6
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CamelotV3 = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const config_1 = require("./config");
9
- const quickswap_v3_1 = require("./quickswap-v3");
10
- const config = lodash_1.default.pick(config_1.QuickSwapConfig, ['CamelotV3']).CamelotV3;
11
- class CamelotV3 extends quickswap_v3_1.QuickSwapV3 {
12
- // public static dexKeysWithNetwork
13
- constructor(dexHelper) {
14
- super(dexHelper, 'camelotv3', config[dexHelper.config.data.network].router);
15
- }
16
- }
17
- exports.CamelotV3 = CamelotV3;
18
- CamelotV3.dexKeys = ['camelotv3'];
19
- //# sourceMappingURL=camelot-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"camelot-v3.js","sourceRoot":"","sources":["../../../src/dex/quickswap/camelot-v3.ts"],"names":[],"mappings":";;;;;;AACA,oDAAuB;AACvB,qCAA2C;AAC3C,iDAA6C;AAE7C,MAAM,MAAM,GAAG,gBAAC,CAAC,IAAI,CAAC,wBAAe,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AAEhE,MAAa,SAAU,SAAQ,0BAAW;IAGxC,mCAAmC;IACnC,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;;AANH,8BAOC;AANQ,iBAAO,GAAG,CAAC,WAAW,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { IDexHelper } from '../../dex-helper';
2
- import { QuickSwapV3 } from './quickswap-v3';
3
- export declare class ZyberSwapV3 extends QuickSwapV3 {
4
- static dexKeys: string[];
5
- constructor(dexHelper: IDexHelper);
6
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ZyberSwapV3 = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const config_1 = require("./config");
9
- const quickswap_v3_1 = require("./quickswap-v3");
10
- const config = lodash_1.default.pick(config_1.QuickSwapConfig, ['ZyberSwapV3']).ZyberSwapV3;
11
- class ZyberSwapV3 extends quickswap_v3_1.QuickSwapV3 {
12
- // public static dexKeysWithNetwork
13
- constructor(dexHelper) {
14
- super(dexHelper, 'zyberswapv3', config[dexHelper.config.data.network].router);
15
- }
16
- }
17
- exports.ZyberSwapV3 = ZyberSwapV3;
18
- ZyberSwapV3.dexKeys = ['zyberswapv3'];
19
- //# sourceMappingURL=zyberswap-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zyberswap-v3.js","sourceRoot":"","sources":["../../../src/dex/quickswap/zyberswap-v3.ts"],"names":[],"mappings":";;;;;;AACA,oDAAuB;AACvB,qCAA2C;AAC3C,iDAA6C;AAE7C,MAAM,MAAM,GAAG,gBAAC,CAAC,IAAI,CAAC,wBAAe,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;AAEpE,MAAa,WAAY,SAAQ,0BAAW;IAG1C,mCAAmC;IACnC,YAAY,SAAqB;QAC/B,KAAK,CACH,SAAS,EACT,aAAa,EACb,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAC7C,CAAC;IACJ,CAAC;;AAVH,kCAWC;AAVQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { SwapSide } from '../constants';
2
- import { Address } from '../types';
3
- import { IDexTxBuilder } from './idex';
4
- import { UniswapV3, UniswapV3Param } from './uniswap-v3';
5
- import { IDexHelper } from '../dex-helper';
6
- export declare type QuickSwapV3Data = {
7
- deadline?: number;
8
- path: {
9
- tokenIn: Address;
10
- tokenOut: Address;
11
- }[];
12
- };
13
- export declare class QuickSwapV3 extends UniswapV3 implements IDexTxBuilder<QuickSwapV3Data, UniswapV3Param> {
14
- static dexKeys: string[];
15
- constructor(dexHelper: IDexHelper);
16
- protected encodePath(path: {
17
- tokenIn: Address;
18
- tokenOut: Address;
19
- fee: number;
20
- }[], side: SwapSide): string;
21
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuickSwapV3 = void 0;
4
- const constants_1 = require("../constants");
5
- const uniswap_v3_1 = require("./uniswap-v3");
6
- const solidity_1 = require("@ethersproject/solidity");
7
- const QUICKSWAP_V3_ROUTER_ADDRESSES = {
8
- [constants_1.Network.POLYGON]: '0xf5b509bb0909a69b1c207e495f687a596c168e12',
9
- };
10
- class QuickSwapV3 extends uniswap_v3_1.UniswapV3 {
11
- constructor(dexHelper) {
12
- super(dexHelper, 'quickswapv3', QUICKSWAP_V3_ROUTER_ADDRESSES[dexHelper.config.data.network]);
13
- }
14
- // override parent as QuickSwapV3 handles fees dynamically.
15
- encodePath(path, side) {
16
- if (path.length === 0) {
17
- return '0x';
18
- }
19
- const { _path, types } = path.reduce(({ _path, types }, curr, index) => {
20
- if (index === 0) {
21
- return {
22
- types: ['address', 'address'],
23
- _path: [curr.tokenIn, curr.tokenOut],
24
- };
25
- }
26
- else {
27
- return {
28
- types: [...types, 'address'],
29
- _path: [..._path, curr.tokenOut],
30
- };
31
- }
32
- }, { _path: [], types: [] });
33
- return side === constants_1.SwapSide.BUY
34
- ? (0, solidity_1.pack)(types.reverse(), _path.reverse())
35
- : (0, solidity_1.pack)(types, _path);
36
- }
37
- }
38
- exports.QuickSwapV3 = QuickSwapV3;
39
- QuickSwapV3.dexKeys = ['quickswapv3'];
40
- //# sourceMappingURL=quickswap-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickswap-v3.js","sourceRoot":"","sources":["../../src/dex/quickswap-v3.ts"],"names":[],"mappings":";;;AAAA,4CAAiD;AAIjD,6CAAyD;AACzD,sDAA+C;AAG/C,MAAM,6BAA6B,GAAmC;IACpE,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE,4CAA4C;CAChE,CAAC;AAWF,MAAa,WACX,SAAQ,sBAAS;IAKjB,YAAY,SAAqB;QAC/B,KAAK,CACH,SAAS,EACT,aAAa,EACb,6BAA6B,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAC7D,CAAC;IACJ,CAAC;IAED,2DAA2D;IACjD,UAAU,CAClB,IAIG,EACH,IAAc;QAEd,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;QAED,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAClC,CACE,EAAE,KAAK,EAAE,KAAK,EAAwC,EACtD,IAAI,EACJ,KAAK,EACiC,EAAE;YACxC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO;oBACL,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;oBAC7B,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;iBACrC,CAAC;aACH;iBAAM;gBACL,OAAO;oBACL,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC;oBAC5B,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;iBACjC,CAAC;aACH;QACH,CAAC,EACD,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CACzB,CAAC;QAEF,OAAO,IAAI,KAAK,oBAAQ,CAAC,GAAG;YAC1B,CAAC,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YACxC,CAAC,CAAC,IAAA,eAAI,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;;AAnDH,kCAoDC;AAhDQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap, AdapterMappings } from '../../types';
3
- export declare const RamsesV2Config: DexConfigMap<DexParams>;
4
- export declare const Adapters: Record<number, AdapterMappings>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Adapters = exports.RamsesV2Config = void 0;
4
- const constants_1 = require("../../constants");
5
- const RAMSES_SUPPORTED_FEES = [10000n, 2500n, 500n, 100n];
6
- exports.RamsesV2Config = {
7
- RamsesV2: {
8
- [constants_1.Network.ARBITRUM]: {
9
- factory: '0xAA2cd7477c451E703f3B9Ba5663334914763edF8',
10
- deployer: '0xb3e423ab9cE6C03D98326A3A2a0D7D96b0829f22',
11
- quoter: '0xAA20EFF7ad2F523590dE6c04918DaAE0904E3b20',
12
- router: '0xAA23611badAFB62D37E7295A682D21960ac85A90',
13
- supportedFees: RAMSES_SUPPORTED_FEES,
14
- stateMulticall: '0x50EE4112Cab9c79812F23bE079aB3911395ACc8e',
15
- uniswapMulticall: '0x1F98415757620B543A52E61c46B32eB19261F984',
16
- chunksCount: 10,
17
- initHash: '0x1565b129f2d1790f12d45301b9b084335626f0c92410bc43130763b69971135d',
18
- subgraphURL: 'https://api.thegraph.com/subgraphs/name/ramsesexchange/concentrated-liquidity-graph',
19
- },
20
- },
21
- };
22
- exports.Adapters = {
23
- [constants_1.Network.ARBITRUM]: {
24
- [constants_1.SwapSide.SELL]: [{ name: 'ArbitrumAdapter01', index: 3 }],
25
- [constants_1.SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 2 }],
26
- },
27
- };
28
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/ramses-v2/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEpD,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE7C,QAAA,cAAc,GAA4B;IACrD,QAAQ,EAAE;QACR,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,OAAO,EAAE,4CAA4C;YACrD,QAAQ,EAAE,4CAA4C;YACtD,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,aAAa,EAAE,qBAAqB;YACpC,cAAc,EAAE,4CAA4C;YAC5D,gBAAgB,EAAE,4CAA4C;YAC9D,WAAW,EAAE,EAAE;YACf,QAAQ,EACN,oEAAoE;YACtE,WAAW,EACT,qFAAqF;SACxF;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;QAClB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,oBAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3D;CACF,CAAC"}
@@ -1,28 +0,0 @@
1
- export declare const UNISWAPV3_TICK_GAS_COST = 24000;
2
- export declare const UNISWAPV3_TICK_BASE_OVERHEAD = 75000;
3
- export declare const UNISWAPV3_POOL_SEARCH_OVERHEAD = 10000;
4
- export declare const TICK_BITMAP_TO_USE = 4n;
5
- export declare const TICK_BITMAP_BUFFER = 8n;
6
- export declare const MAX_PRICING_COMPUTATION_STEPS_ALLOWED = 128;
7
- export declare const UNISWAPV3_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/ramsesexchange/concentrated-liquidity-graph";
8
- export declare const UNISWAPV3_EFFICIENCY_FACTOR = 3;
9
- export declare const ZERO_TICK_INFO: {
10
- liquidityGross: bigint;
11
- liquidityNet: bigint;
12
- tickCumulativeOutside: bigint;
13
- secondsPerLiquidityOutsideX128: bigint;
14
- secondsOutside: bigint;
15
- initialized: boolean;
16
- };
17
- export declare const ZERO_ORACLE_OBSERVATION: {
18
- blockTimestamp: bigint;
19
- tickCumulative: bigint;
20
- secondsPerLiquidityCumulativeX128: bigint;
21
- initialized: boolean;
22
- };
23
- export declare const OUT_OF_RANGE_ERROR_POSTFIX = "INVALID_TICK_BIT_MAP_RANGES";
24
- export declare const DEFAULT_POOL_INIT_CODE_HASH = "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";
25
- export declare enum DirectMethods {
26
- directSell = "directUniV3Swap",
27
- directBuy = "directUniV3Buy"
28
- }