@paraswap/dex-lib 3.8.22 → 3.8.23-remove-logs-oswap

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 (375) hide show
  1. package/.vscode/launch.json +16 -0
  2. package/.vscode/settings.json +3 -0
  3. package/build/abi/AaveV1_lending_pool.json +27 -0
  4. package/build/abi/Uncompressor.json +250 -0
  5. package/build/abi/infusion/InfusionFactory.json +147 -0
  6. package/build/abi/infusion/InfusionPair.json +658 -0
  7. package/build/abi/infusion/InfusionRouter.json +442 -0
  8. package/build/abi/integral/factory.json +333 -0
  9. package/build/abi/integral/oracle.json +501 -0
  10. package/build/abi/integral/pool.json +1041 -0
  11. package/build/abi/integral/relayer.json +1536 -0
  12. package/build/abi/oswap/oswap.abi.json +452 -0
  13. package/build/abi/platypus/asset.json +490 -0
  14. package/build/abi/platypus/avax-pool.json +820 -0
  15. package/build/abi/platypus/oracle.json +119 -0
  16. package/build/abi/platypus/pool.json +677 -0
  17. package/build/abi/smardex/all/smardex-router.json +648 -0
  18. package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
  19. package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
  20. package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
  21. package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
  22. package/build/abi/swaap-v1/pool.json +1346 -0
  23. package/build/dex/aave-v1/aave-v1.d.ts +33 -0
  24. package/build/dex/aave-v1/aave-v1.js +158 -0
  25. package/build/dex/aave-v1/aave-v1.js.map +1 -0
  26. package/build/dex/aave-v1/config.d.ts +11 -0
  27. package/build/dex/aave-v1/config.js +20 -0
  28. package/build/dex/aave-v1/config.js.map +1 -0
  29. package/build/dex/aave-v1/tokens-mainnet.json +134 -0
  30. package/build/dex/aave-v1/tokens.d.ts +3 -0
  31. package/build/dex/aave-v1/tokens.js +50 -0
  32. package/build/dex/aave-v1/tokens.js.map +1 -0
  33. package/build/dex/aave-v1/types.d.ts +12 -0
  34. package/build/dex/aave-v1/types.js +3 -0
  35. package/build/dex/aave-v1/types.js.map +1 -0
  36. package/build/dex/bProtocol.d.ts +18 -0
  37. package/build/dex/bProtocol.js +39 -0
  38. package/build/dex/bProtocol.js.map +1 -0
  39. package/build/dex/bancor.d.ts +26 -0
  40. package/build/dex/bancor.js +58 -0
  41. package/build/dex/bancor.js.map +1 -0
  42. package/build/dex/compound.d.ts +18 -0
  43. package/build/dex/compound.js +46 -0
  44. package/build/dex/compound.js.map +1 -0
  45. package/build/dex/curve-v2.d.ts +58 -0
  46. package/build/dex/curve-v2.js +180 -0
  47. package/build/dex/curve-v2.js.map +1 -0
  48. package/build/dex/dodo-v1.d.ts +33 -0
  49. package/build/dex/dodo-v1.js +63 -0
  50. package/build/dex/dodo-v1.js.map +1 -0
  51. package/build/dex/etherfi/etherfi.d.ts +26 -0
  52. package/build/dex/etherfi/etherfi.js +96 -0
  53. package/build/dex/etherfi/etherfi.js.map +1 -0
  54. package/build/dex/generic-rfq/rate-fetcher.js +1 -1
  55. package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
  56. package/build/dex/index.js +4 -0
  57. package/build/dex/index.js.map +1 -1
  58. package/build/dex/infusion/config.d.ts +3 -0
  59. package/build/dex/infusion/config.js +20 -0
  60. package/build/dex/infusion/config.js.map +1 -0
  61. package/build/dex/infusion/infusion-stable-pool.d.ts +4 -0
  62. package/build/dex/infusion/infusion-stable-pool.js +74 -0
  63. package/build/dex/infusion/infusion-stable-pool.js.map +1 -0
  64. package/build/dex/infusion/infusion.d.ts +51 -0
  65. package/build/dex/infusion/infusion.js +457 -0
  66. package/build/dex/infusion/infusion.js.map +1 -0
  67. package/build/dex/infusion/types.d.ts +45 -0
  68. package/build/dex/infusion/types.js +3 -0
  69. package/build/dex/infusion/types.js.map +1 -0
  70. package/build/dex/infusion/utils/isStablePair.d.ts +2 -0
  71. package/build/dex/infusion/utils/isStablePair.js +18 -0
  72. package/build/dex/infusion/utils/isStablePair.js.map +1 -0
  73. package/build/dex/integral/config.d.ts +4 -0
  74. package/build/dex/integral/config.js +20 -0
  75. package/build/dex/integral/config.js.map +1 -0
  76. package/build/dex/integral/context.d.ts +40 -0
  77. package/build/dex/integral/context.js +158 -0
  78. package/build/dex/integral/context.js.map +1 -0
  79. package/build/dex/integral/helpers.d.ts +17 -0
  80. package/build/dex/integral/helpers.js +157 -0
  81. package/build/dex/integral/helpers.js.map +1 -0
  82. package/build/dex/integral/integral-factory.d.ts +24 -0
  83. package/build/dex/integral/integral-factory.js +95 -0
  84. package/build/dex/integral/integral-factory.js.map +1 -0
  85. package/build/dex/integral/integral-pool.d.ts +50 -0
  86. package/build/dex/integral/integral-pool.js +149 -0
  87. package/build/dex/integral/integral-pool.js.map +1 -0
  88. package/build/dex/integral/integral-pricing.d.ts +18 -0
  89. package/build/dex/integral/integral-pricing.js +114 -0
  90. package/build/dex/integral/integral-pricing.js.map +1 -0
  91. package/build/dex/integral/integral-relayer.d.ts +42 -0
  92. package/build/dex/integral/integral-relayer.js +192 -0
  93. package/build/dex/integral/integral-relayer.js.map +1 -0
  94. package/build/dex/integral/integral-token.d.ts +27 -0
  95. package/build/dex/integral/integral-token.js +59 -0
  96. package/build/dex/integral/integral-token.js.map +1 -0
  97. package/build/dex/integral/integral.d.ts +41 -0
  98. package/build/dex/integral/integral.js +376 -0
  99. package/build/dex/integral/integral.js.map +1 -0
  100. package/build/dex/integral/types.d.ts +85 -0
  101. package/build/dex/integral/types.js +9 -0
  102. package/build/dex/integral/types.js.map +1 -0
  103. package/build/dex/integral/utils-e2e.d.ts +9 -0
  104. package/build/dex/integral/utils-e2e.js +131 -0
  105. package/build/dex/integral/utils-e2e.js.map +1 -0
  106. package/build/dex/integral/utils.d.ts +17 -0
  107. package/build/dex/integral/utils.js +94 -0
  108. package/build/dex/integral/utils.js.map +1 -0
  109. package/build/dex/lido.d.ts +19 -0
  110. package/build/dex/lido.js +42 -0
  111. package/build/dex/lido.js.map +1 -0
  112. package/build/dex/lite-psm/lite-psm.js +2 -5
  113. package/build/dex/lite-psm/lite-psm.js.map +1 -1
  114. package/build/dex/maker-psm/maker-psm.js +2 -6
  115. package/build/dex/maker-psm/maker-psm.js.map +1 -1
  116. package/build/dex/maverick-v2/config.js +4 -0
  117. package/build/dex/maverick-v2/config.js.map +1 -1
  118. package/build/dex/maverick-v2/maverick-math/maverick-pool-math.js +4 -0
  119. package/build/dex/maverick-v2/maverick-math/maverick-pool-math.js.map +1 -1
  120. package/build/dex/maverick-v2/maverick-v2-pool.d.ts +1 -1
  121. package/build/dex/maverick-v2/maverick-v2-pool.js +8 -8
  122. package/build/dex/maverick-v2/maverick-v2-pool.js.map +1 -1
  123. package/build/dex/maverick-v2/maverick-v2.d.ts +5 -4
  124. package/build/dex/maverick-v2/maverick-v2.js +73 -63
  125. package/build/dex/maverick-v2/maverick-v2.js.map +1 -1
  126. package/build/dex/maverick-v2/types.d.ts +4 -0
  127. package/build/dex/onebit.d.ts +25 -0
  128. package/build/dex/onebit.js +42 -0
  129. package/build/dex/onebit.js.map +1 -0
  130. package/build/dex/oswap/config.d.ts +5 -0
  131. package/build/dex/oswap/config.js +31 -0
  132. package/build/dex/oswap/config.js.map +1 -0
  133. package/build/dex/oswap/oswap-pool.d.ts +51 -0
  134. package/build/dex/oswap/oswap-pool.js +150 -0
  135. package/build/dex/oswap/oswap-pool.js.map +1 -0
  136. package/build/dex/oswap/oswap.d.ts +46 -0
  137. package/build/dex/oswap/oswap.js +273 -0
  138. package/build/dex/oswap/oswap.js.map +1 -0
  139. package/build/dex/oswap/types.d.ts +20 -0
  140. package/build/dex/oswap/types.js +3 -0
  141. package/build/dex/oswap/types.js.map +1 -0
  142. package/build/dex/platypus/asset.d.ts +14 -0
  143. package/build/dex/platypus/asset.js +97 -0
  144. package/build/dex/platypus/asset.js.map +1 -0
  145. package/build/dex/platypus/config.d.ts +11 -0
  146. package/build/dex/platypus/config.js +69 -0
  147. package/build/dex/platypus/config.js.map +1 -0
  148. package/build/dex/platypus/platypus.d.ts +62 -0
  149. package/build/dex/platypus/platypus.js +442 -0
  150. package/build/dex/platypus/platypus.js.map +1 -0
  151. package/build/dex/platypus/pool-avax.d.ts +8 -0
  152. package/build/dex/platypus/pool-avax.js +54 -0
  153. package/build/dex/platypus/pool-avax.js.map +1 -0
  154. package/build/dex/platypus/pool-base.d.ts +19 -0
  155. package/build/dex/platypus/pool-base.js +86 -0
  156. package/build/dex/platypus/pool-base.js.map +1 -0
  157. package/build/dex/platypus/pool-pure.d.ts +8 -0
  158. package/build/dex/platypus/pool-pure.js +37 -0
  159. package/build/dex/platypus/pool-pure.js.map +1 -0
  160. package/build/dex/platypus/pool-subscriber.d.ts +14 -0
  161. package/build/dex/platypus/pool-subscriber.js +167 -0
  162. package/build/dex/platypus/pool-subscriber.js.map +1 -0
  163. package/build/dex/platypus/pool.d.ts +8 -0
  164. package/build/dex/platypus/pool.js +58 -0
  165. package/build/dex/platypus/pool.js.map +1 -0
  166. package/build/dex/platypus/types.d.ts +92 -0
  167. package/build/dex/platypus/types.js +10 -0
  168. package/build/dex/platypus/types.js.map +1 -0
  169. package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
  170. package/build/dex/quickswap/spiritswap-v3.js +19 -0
  171. package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
  172. package/build/dex/sdai/config.d.ts +11 -0
  173. package/build/dex/sdai/config.js +21 -0
  174. package/build/dex/sdai/config.js.map +1 -0
  175. package/build/dex/sdai/constants.d.ts +2 -0
  176. package/build/dex/sdai/constants.js +6 -0
  177. package/build/dex/sdai/constants.js.map +1 -0
  178. package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
  179. package/build/dex/sdai/scripts/validate-state.js +102 -0
  180. package/build/dex/sdai/scripts/validate-state.js.map +1 -0
  181. package/build/dex/sdai/sdai-pool.d.ts +16 -0
  182. package/build/dex/sdai/sdai-pool.js +85 -0
  183. package/build/dex/sdai/sdai-pool.js.map +1 -0
  184. package/build/dex/sdai/sdai.d.ts +51 -0
  185. package/build/dex/sdai/sdai.js +172 -0
  186. package/build/dex/sdai/sdai.js.map +1 -0
  187. package/build/dex/sdai/types.d.ts +21 -0
  188. package/build/dex/sdai/types.js +11 -0
  189. package/build/dex/sdai/types.js.map +1 -0
  190. package/build/dex/sdai/utils.d.ts +4 -0
  191. package/build/dex/sdai/utils.js +39 -0
  192. package/build/dex/sdai/utils.js.map +1 -0
  193. package/build/dex/smardex/config.d.ts +4 -0
  194. package/build/dex/smardex/config.js +64 -0
  195. package/build/dex/smardex/config.js.map +1 -0
  196. package/build/dex/smardex/constants.d.ts +18 -0
  197. package/build/dex/smardex/constants.js +33 -0
  198. package/build/dex/smardex/constants.js.map +1 -0
  199. package/build/dex/smardex/sdk/constants.d.ts +6 -0
  200. package/build/dex/smardex/sdk/constants.js +13 -0
  201. package/build/dex/smardex/sdk/constants.js.map +1 -0
  202. package/build/dex/smardex/sdk/core.d.ts +113 -0
  203. package/build/dex/smardex/sdk/core.js +499 -0
  204. package/build/dex/smardex/sdk/core.js.map +1 -0
  205. package/build/dex/smardex/sdk/errors.d.ts +15 -0
  206. package/build/dex/smardex/sdk/errors.js +22 -0
  207. package/build/dex/smardex/sdk/errors.js.map +1 -0
  208. package/build/dex/smardex/sdk/types.d.ts +62 -0
  209. package/build/dex/smardex/sdk/types.js +3 -0
  210. package/build/dex/smardex/sdk/types.js.map +1 -0
  211. package/build/dex/smardex/sdk/utils.d.ts +44 -0
  212. package/build/dex/smardex/sdk/utils.js +133 -0
  213. package/build/dex/smardex/sdk/utils.js.map +1 -0
  214. package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
  215. package/build/dex/smardex/smardex-event-pool.js +119 -0
  216. package/build/dex/smardex/smardex-event-pool.js.map +1 -0
  217. package/build/dex/smardex/smardex.d.ts +65 -0
  218. package/build/dex/smardex/smardex.js +519 -0
  219. package/build/dex/smardex/smardex.js.map +1 -0
  220. package/build/dex/smardex/types.d.ts +55 -0
  221. package/build/dex/smardex/types.js +3 -0
  222. package/build/dex/smardex/types.js.map +1 -0
  223. package/build/dex/smoothy.d.ts +26 -0
  224. package/build/dex/smoothy.js +48 -0
  225. package/build/dex/smoothy.js.map +1 -0
  226. package/build/dex/solidly/forks-override/cone.d.ts +22 -0
  227. package/build/dex/solidly/forks-override/cone.js +53 -0
  228. package/build/dex/solidly/forks-override/cone.js.map +1 -0
  229. package/build/dex/solidly/forks-override/solisnek.d.ts +8 -0
  230. package/build/dex/solidly/forks-override/solisnek.js +15 -0
  231. package/build/dex/solidly/forks-override/solisnek.js.map +1 -0
  232. package/build/dex/stable-pool.d.ts +28 -0
  233. package/build/dex/stable-pool.js +62 -0
  234. package/build/dex/stable-pool.js.map +1 -0
  235. package/build/dex/swaap-v1/config.d.ts +17 -0
  236. package/build/dex/swaap-v1/config.js +56 -0
  237. package/build/dex/swaap-v1/config.js.map +1 -0
  238. package/build/dex/swaap-v1/constants.d.ts +6 -0
  239. package/build/dex/swaap-v1/constants.js +17 -0
  240. package/build/dex/swaap-v1/constants.js.map +1 -0
  241. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +25 -0
  242. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +62 -0
  243. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +1 -0
  244. package/build/dex/swaap-v1/libraries/Const.d.ts +18 -0
  245. package/build/dex/swaap-v1/libraries/Const.js +26 -0
  246. package/build/dex/swaap-v1/libraries/Const.js.map +1 -0
  247. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +77 -0
  248. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +316 -0
  249. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +1 -0
  250. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +75 -0
  251. package/build/dex/swaap-v1/libraries/LogExpMath.js +418 -0
  252. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +1 -0
  253. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +185 -0
  254. package/build/dex/swaap-v1/libraries/MathMMM.js +453 -0
  255. package/build/dex/swaap-v1/libraries/MathMMM.js.map +1 -0
  256. package/build/dex/swaap-v1/libraries/Num.d.ts +31 -0
  257. package/build/dex/swaap-v1/libraries/Num.js +167 -0
  258. package/build/dex/swaap-v1/libraries/Num.js.map +1 -0
  259. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +23 -0
  260. package/build/dex/swaap-v1/libraries/PoolQuotations.js +131 -0
  261. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +1 -0
  262. package/build/dex/swaap-v1/libraries/Struct.d.ts +56 -0
  263. package/build/dex/swaap-v1/libraries/Struct.js +3 -0
  264. package/build/dex/swaap-v1/libraries/Struct.js.map +1 -0
  265. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +45 -0
  266. package/build/dex/swaap-v1/swaap-v1-pool.js +656 -0
  267. package/build/dex/swaap-v1/swaap-v1-pool.js.map +1 -0
  268. package/build/dex/swaap-v1/swaap-v1.d.ts +61 -0
  269. package/build/dex/swaap-v1/swaap-v1.js +369 -0
  270. package/build/dex/swaap-v1/swaap-v1.js.map +1 -0
  271. package/build/dex/swaap-v1/types.d.ts +106 -0
  272. package/build/dex/swaap-v1/types.js +9 -0
  273. package/build/dex/swaap-v1/types.js.map +1 -0
  274. package/build/dex/trader-joe-v2.1/optimizer.js +1 -4
  275. package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -1
  276. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  277. package/build/dex/trader-joe-v2.1.js +79 -0
  278. package/build/dex/trader-joe-v2.1.js.map +1 -0
  279. package/build/executor/compressor/Compressor.d.ts +23 -0
  280. package/build/executor/compressor/Compressor.js +144 -0
  281. package/build/executor/compressor/Compressor.js.map +1 -0
  282. package/build/executor/compressor/compress.d.ts +17 -0
  283. package/build/executor/compressor/compress.js +187 -0
  284. package/build/executor/compressor/compress.js.map +1 -0
  285. package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
  286. package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
  287. package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
  288. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
  289. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
  290. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
  291. package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
  292. package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
  293. package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
  294. package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
  295. package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
  296. package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
  297. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
  298. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
  299. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
  300. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
  301. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
  302. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
  303. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
  304. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
  305. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
  306. package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
  307. package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
  308. package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
  309. package/build/executor/compressor/fetchSaved.d.ts +0 -0
  310. package/build/executor/compressor/fetchSaved.js +17 -0
  311. package/build/executor/compressor/fetchSaved.js.map +1 -0
  312. package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
  313. package/build/executor/compressor/utils/computeCostL2.js +14 -0
  314. package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
  315. package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
  316. package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
  317. package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
  318. package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
  319. package/build/executor/compressor/utils/getAllIndexes.js +12 -0
  320. package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
  321. package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
  322. package/build/executor/compressor/utils/getByteForAddress.js +14 -0
  323. package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
  324. package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
  325. package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
  326. package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
  327. package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
  328. package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
  329. package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
  330. package/build/executor/compressor/utils/intToByte.d.ts +2 -0
  331. package/build/executor/compressor/utils/intToByte.js +10 -0
  332. package/build/executor/compressor/utils/intToByte.js.map +1 -0
  333. package/package.json +1 -1
  334. package/src/abi/infusion/InfusionFactory.json +147 -0
  335. package/src/abi/infusion/InfusionPair.json +658 -0
  336. package/src/abi/infusion/InfusionRouter.json +442 -0
  337. package/src/abi/maverick-v2/MaverickV2Router.json +778 -0
  338. package/src/abi/oswap/oswap.abi.json +452 -0
  339. package/src/dex/generic-rfq/rate-fetcher.ts +6 -5
  340. package/src/dex/index.ts +4 -0
  341. package/src/dex/infusion/config.ts +21 -0
  342. package/src/dex/infusion/infusion-e2e.test.ts +110 -0
  343. package/src/dex/infusion/infusion-integration.test.ts +232 -0
  344. package/src/dex/infusion/infusion-stable-pool.ts +91 -0
  345. package/src/dex/infusion/infusion.ts +652 -0
  346. package/src/dex/infusion/types.ts +60 -0
  347. package/src/dex/infusion/utils/isStablePair.ts +18 -0
  348. package/src/dex/lite-psm/lite-psm.ts +2 -5
  349. package/src/dex/maker-psm/maker-psm.ts +2 -6
  350. package/src/dex/maverick-v2/config.ts +4 -0
  351. package/src/dex/maverick-v2/maverick-math/maverick-pool-math.ts +5 -0
  352. package/src/dex/maverick-v2/maverick-v2-e2e.test.ts +21 -43
  353. package/src/dex/maverick-v2/maverick-v2-integration.test.ts +100 -96
  354. package/src/dex/maverick-v2/maverick-v2-pool.ts +8 -8
  355. package/src/dex/maverick-v2/maverick-v2.ts +111 -81
  356. package/src/dex/maverick-v2/types.ts +4 -0
  357. package/src/dex/oswap/config.ts +32 -0
  358. package/src/dex/oswap/oswap-e2e.test.ts +91 -0
  359. package/src/dex/oswap/oswap-events.test.ts +88 -0
  360. package/src/dex/oswap/oswap-integration.test.ts +291 -0
  361. package/src/dex/oswap/oswap-pool.ts +190 -0
  362. package/src/dex/oswap/oswap.ts +392 -0
  363. package/src/dex/oswap/types.ts +29 -0
  364. package/tests/constants-e2e.ts +10 -1
  365. package/.idea/aws.xml +0 -17
  366. package/.idea/codeStyles/Project.xml +0 -19
  367. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  368. package/.idea/misc.xml +0 -6
  369. package/.idea/modules.xml +0 -8
  370. package/.idea/paraswap-dex-lib.iml +0 -9
  371. package/.idea/prettier.xml +0 -7
  372. package/.idea/vcs.xml +0 -6
  373. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  374. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  375. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dex/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,kDAA8C;AAE9C,qDAAiD;AACjD,2DAAuD;AACvD,sCAAmC;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,cAAc;gBACtB,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,qCAAqC,IAAI,CAAC,OAAO,IAAI,CAC/D,CAAC;YACJ,OAAO,IAAI,CAAC,cAAc,CAAC;SAC5B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,MAAc,EAAE,IAAc;QACvC,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,IAAI,KAAK,oBAAQ,CAAC,IAAI;YAC3B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;YAClC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED,qCAAqC,CAAC,MAAc;QAClD,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,KAAK,CAAC;SACd;IACH,CAAC;CACF;AApLD,8CAoLC"}
@@ -0,0 +1,3 @@
1
+ import { DexParams } from './types';
2
+ import { DexConfigMap } from '../../types';
3
+ export declare const InfusionConfig: DexConfigMap<DexParams>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfusionConfig = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.InfusionConfig = {
6
+ Infusion: {
7
+ [constants_1.Network.BASE]: {
8
+ subgraphURL: 'https://api.goldsky.com/api/public/project_clvn0ei0x2qro0130fpihh83o/subgraphs/infusion-subgraph/1.0.0/gn',
9
+ factoryAddress: '0x2D9A3a2bd6400eE28d770c7254cA840c82faf23f',
10
+ router: '0x1E891C9F96DcA29Da8B97bE3403D16135EBe8028',
11
+ initCode: '0xc1ac28b1c4ebe53c0cff67bab5878c4eb68759bb1e9f73977cd266b247d149f0',
12
+ // updatable fees on the factory without event
13
+ stableFee: 2,
14
+ volatileFee: 2,
15
+ poolGasCost: 180 * 1000,
16
+ feeCode: 2,
17
+ },
18
+ },
19
+ };
20
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/infusion/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,cAAc,GAA4B;IACrD,QAAQ,EAAE;QACR,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,WAAW,EACT,2GAA2G;YAC7G,cAAc,EAAE,4CAA4C;YAC5D,MAAM,EAAE,4CAA4C;YACpD,QAAQ,EACN,oEAAoE;YACtE,8CAA8C;YAC9C,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,GAAG,GAAG,IAAI;YACvB,OAAO,EAAE,CAAC;SACX;KACF;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { InfusionPoolOrderedParams } from './types';
2
+ export declare class InfusionStablePool {
3
+ static getSellPrice(priceParams: InfusionPoolOrderedParams, srcAmount: bigint, feeFactor: number): Promise<bigint>;
4
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfusionStablePool = void 0;
4
+ const bigint_constants_1 = require("../../bigint-constants");
5
+ const uniswap_v2_1 = require("../uniswap-v2/uniswap-v2");
6
+ const e18 = bigint_constants_1.BI_POWS[18];
7
+ function _k(x, y, decimals0, decimals1) {
8
+ const _x = (x * e18) / decimals0;
9
+ const _y = (y * e18) / decimals1;
10
+ const _a = (_x * _y) / e18;
11
+ const _b = (_x * _x) / e18 + (_y * _y) / e18;
12
+ // x3y+y3x >= k
13
+ return (_a * _b) / e18;
14
+ }
15
+ function _f(x0, y) {
16
+ return ((x0 * ((((y * y) / e18) * y) / e18)) / e18 +
17
+ (((((x0 * x0) / e18) * x0) / e18) * y) / e18);
18
+ }
19
+ function _d(x0, y) {
20
+ return (3n * x0 * ((y * y) / e18)) / e18 + (((x0 * x0) / e18) * x0) / e18;
21
+ }
22
+ function _getY(x0, xy, y) {
23
+ for (let i = 0; i < 255; i++) {
24
+ const yPrev = y;
25
+ const k = _f(x0, y);
26
+ if (k < xy) {
27
+ const dy = ((xy - k) * e18) / _d(x0, y);
28
+ y = y + dy;
29
+ }
30
+ else {
31
+ const dy = ((k - xy) * e18) / _d(x0, y);
32
+ y = y - dy;
33
+ }
34
+ if (_closeTo(y, yPrev, 1n)) {
35
+ break;
36
+ }
37
+ }
38
+ return y;
39
+ }
40
+ function _closeTo(a, b, target) {
41
+ if (a > b) {
42
+ if (a - b <= target) {
43
+ return true;
44
+ }
45
+ }
46
+ else {
47
+ if (b - a <= target) {
48
+ return true;
49
+ }
50
+ }
51
+ return false;
52
+ }
53
+ class InfusionStablePool {
54
+ static async getSellPrice(priceParams, srcAmount, feeFactor) {
55
+ const { reservesIn, reservesOut, decimalsIn, decimalsOut, fee } = priceParams;
56
+ // FIXME: some dexes use uint112 others use uint256
57
+ if (BigInt(reservesIn) + srcAmount > uniswap_v2_1.RESERVE_LIMIT) {
58
+ return 0n;
59
+ }
60
+ const amountIn = srcAmount - (srcAmount * BigInt(fee)) / BigInt(feeFactor);
61
+ const reservesInN = BigInt(reservesIn);
62
+ const reservesOutN = BigInt(reservesOut);
63
+ const decimalsInN = 10n ** BigInt(decimalsIn);
64
+ const decimalsOutN = 10n ** BigInt(decimalsOut);
65
+ const xy = _k(reservesInN, reservesOutN, decimalsInN, decimalsOutN);
66
+ const reserveA = (reservesInN * e18) / decimalsInN;
67
+ const reserveB = (reservesOutN * e18) / decimalsOutN;
68
+ const amountInNorm = (amountIn * e18) / decimalsInN;
69
+ const y = reserveB - _getY(amountInNorm + reserveA, xy, reserveB);
70
+ return (y * decimalsOutN) / e18;
71
+ }
72
+ }
73
+ exports.InfusionStablePool = InfusionStablePool;
74
+ //# sourceMappingURL=infusion-stable-pool.js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AiB;QAEjB,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,GAC7D,WAAW,CAAC;QAEd,mDAAmD;QACnD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,0BAAa,EAAE;YAClD,OAAO,EAAE,CAAC;SACX;QAED,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QAE3E,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,YAAY,GAAG,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;QAEhD,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,GAAG,WAAW,CAAC;QACnD,MAAM,QAAQ,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC;QACrD,MAAM,YAAY,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,WAAW,CAAC;QACpD,MAAM,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC,YAAY,GAAG,QAAQ,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QAClE,OAAO,CAAC,CAAC,GAAG,YAAY,CAAC,GAAG,GAAG,CAAC;IAClC,CAAC;CACF;AA5BD,gDA4BC"}
@@ -0,0 +1,51 @@
1
+ import { UniswapV2 } from '../uniswap-v2/uniswap-v2';
2
+ import { Network } from '../../constants';
3
+ import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, PoolLiquidity, Token, TransferFeeParams } from '../../types';
4
+ import { IDexHelper } from '../../dex-helper';
5
+ import { NumberAsString, SwapSide } from '@paraswap/core';
6
+ import { PoolState, InfusionData, InfusionPair, InfusionPoolOrderedParams } from './types';
7
+ export declare enum InfusionRouterFunctions {
8
+ sellExactEth = "swapExactETHForTokens",
9
+ sellExactToken = "swapExactTokensForETH",
10
+ swapExactIn = "swapExactTokensForTokens"
11
+ }
12
+ export declare class Infusion extends UniswapV2 {
13
+ protected network: Network;
14
+ protected dexHelper: IDexHelper;
15
+ pairs: {
16
+ [key: string]: InfusionPair;
17
+ };
18
+ stableFee?: number;
19
+ volatileFee?: number;
20
+ readonly isFeeOnTransferSupported: boolean;
21
+ readonly SRC_TOKEN_DEX_TRANSFERS = 1;
22
+ readonly DEST_TOKEN_DEX_TRANSFERS = 1;
23
+ static dexKeysWithNetwork: {
24
+ key: string;
25
+ networks: Network[];
26
+ }[];
27
+ constructor(network: Network, dexKey: string, dexHelper: IDexHelper, isDynamicFees?: boolean, factoryAddress?: Address, subgraphURL?: string, initCode?: string, feeCode?: number, poolGasCost?: number, routerAddress?: Address);
28
+ findInfusionPair(from: Token, to: Token, stable: boolean): Promise<InfusionPair | null>;
29
+ batchCatchUpPairs(pairs: [Token, Token][], blockNumber: number): Promise<void>;
30
+ getManyPoolReserves(pairs: InfusionPair[], blockNumber: number): Promise<PoolState[]>;
31
+ getSellPrice(priceParams: InfusionPoolOrderedParams, srcAmount: bigint): Promise<bigint>;
32
+ getPricesVolume(_from: Token, _to: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[], transferFees?: TransferFeeParams): Promise<ExchangePrices<InfusionData> | null>;
33
+ getTopPoolsForToken(tokenAddress: Address, count: number): Promise<PoolLiquidity[]>;
34
+ getInfusionPairOrderedParams(from: Token, to: Token, blockNumber: number, stable: boolean, tokenDexTransferFee: number): Promise<InfusionPoolOrderedParams | null>;
35
+ getPoolIdentifiers(_from: Token, _to: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
36
+ poolPostfix(stable: boolean): "S" | "V";
37
+ getAdapters(side: SwapSide): {
38
+ name: string;
39
+ index: number;
40
+ }[] | null;
41
+ getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, toAmount: NumberAsString, // required for buy case
42
+ data: InfusionData, side: SwapSide): AdapterExchangeParam;
43
+ getDexParam(src: Address, dest: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: InfusionData, side: SwapSide): DexExchangeParam;
44
+ protected getFeesMultiCallData(pair: InfusionPair): {
45
+ callEntry: {
46
+ target: string;
47
+ callData: string;
48
+ };
49
+ callDecoder: (values: any[]) => number;
50
+ };
51
+ }
@@ -0,0 +1,457 @@
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.Infusion = exports.InfusionRouterFunctions = void 0;
7
+ const uniswap_v2_1 = require("../uniswap-v2/uniswap-v2");
8
+ const constants_1 = require("../../constants");
9
+ const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
10
+ const utils_1 = require("../../utils");
11
+ const InfusionFactory_json_1 = __importDefault(require("../../abi/infusion/InfusionFactory.json"));
12
+ const InfusionPair_json_1 = __importDefault(require("../../abi/infusion/InfusionPair.json"));
13
+ const InfusionRouter_json_1 = __importDefault(require("../../abi/infusion/InfusionRouter.json"));
14
+ const lodash_1 = __importDefault(require("lodash"));
15
+ const core_1 = require("@paraswap/core");
16
+ const abi_1 = require("@ethersproject/abi");
17
+ const infusion_stable_pool_1 = require("./infusion-stable-pool");
18
+ const uniswap_v2_constant_product_pool_1 = require("../uniswap-v2/uniswap-v2-constant-product-pool");
19
+ const config_1 = require("./config");
20
+ const token_transfer_fee_1 = require("../../lib/token-transfer-fee");
21
+ const isStablePair_1 = require("./utils/isStablePair");
22
+ var InfusionRouterFunctions;
23
+ (function (InfusionRouterFunctions) {
24
+ InfusionRouterFunctions["sellExactEth"] = "swapExactETHForTokens";
25
+ InfusionRouterFunctions["sellExactToken"] = "swapExactTokensForETH";
26
+ InfusionRouterFunctions["swapExactIn"] = "swapExactTokensForTokens";
27
+ })(InfusionRouterFunctions = exports.InfusionRouterFunctions || (exports.InfusionRouterFunctions = {}));
28
+ const VelodromeFactoryABI = [
29
+ {
30
+ inputs: [{ internalType: 'bool', name: '_stable', type: 'bool' }],
31
+ name: 'getFee',
32
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
33
+ stateMutability: 'view',
34
+ type: 'function',
35
+ },
36
+ ];
37
+ const velodromeFactoryIface = new abi_1.Interface(VelodromeFactoryABI);
38
+ const erc20Iface = new abi_1.Interface(erc20_json_1.default);
39
+ const infusionPairIface = new abi_1.Interface(InfusionPair_json_1.default);
40
+ const defaultAbiCoder = new abi_1.AbiCoder();
41
+ class Infusion extends uniswap_v2_1.UniswapV2 {
42
+ constructor(network, dexKey, dexHelper, isDynamicFees = true, factoryAddress, subgraphURL, initCode, feeCode, poolGasCost, routerAddress) {
43
+ super(network, dexKey, dexHelper, isDynamicFees, factoryAddress !== undefined
44
+ ? factoryAddress
45
+ : config_1.InfusionConfig[dexKey][network].factoryAddress, subgraphURL === ''
46
+ ? undefined
47
+ : subgraphURL !== undefined
48
+ ? subgraphURL
49
+ : config_1.InfusionConfig[dexKey][network].subgraphURL, initCode !== undefined
50
+ ? initCode
51
+ : config_1.InfusionConfig[dexKey][network].initCode, feeCode !== undefined ? feeCode : config_1.InfusionConfig[dexKey][network].feeCode, poolGasCost !== undefined
52
+ ? poolGasCost
53
+ : config_1.InfusionConfig[dexKey][network].poolGasCost, infusionPairIface);
54
+ this.network = network;
55
+ this.dexHelper = dexHelper;
56
+ this.pairs = {};
57
+ this.isFeeOnTransferSupported = true;
58
+ this.SRC_TOKEN_DEX_TRANSFERS = 1;
59
+ this.DEST_TOKEN_DEX_TRANSFERS = 1;
60
+ this.stableFee = config_1.InfusionConfig[dexKey][network].stableFee;
61
+ this.volatileFee = config_1.InfusionConfig[dexKey][network].volatileFee;
62
+ this.factory = new dexHelper.web3Provider.eth.Contract(InfusionFactory_json_1.default, factoryAddress !== undefined
63
+ ? factoryAddress
64
+ : config_1.InfusionConfig[dexKey][network].factoryAddress);
65
+ this.router =
66
+ routerAddress !== undefined
67
+ ? routerAddress
68
+ : config_1.InfusionConfig[dexKey][network].router || '';
69
+ this.feeFactor =
70
+ config_1.InfusionConfig[dexKey][network].feeFactor || this.feeFactor;
71
+ }
72
+ async findInfusionPair(from, to, stable) {
73
+ if (from.address.toLowerCase() === to.address.toLowerCase())
74
+ return null;
75
+ const [token0, token1] = from.address.toLowerCase() < to.address.toLowerCase()
76
+ ? [from, to]
77
+ : [to, from];
78
+ const typePostfix = this.poolPostfix(stable);
79
+ const key = `${token0.address.toLowerCase()}-${token1.address.toLowerCase()}-${typePostfix}`;
80
+ let pair = this.pairs[key];
81
+ if (pair)
82
+ return pair;
83
+ let exchange = await this.factory.methods
84
+ // Infusion has additional boolean parameter "StablePool"
85
+ // At first we look for uniswap-like volatile pool
86
+ .getPair(token0.address, token1.address, stable)
87
+ .call();
88
+ if (exchange === constants_1.NULL_ADDRESS) {
89
+ pair = { token0, token1, stable };
90
+ }
91
+ else {
92
+ pair = { token0, token1, exchange, stable };
93
+ }
94
+ this.pairs[key] = pair;
95
+ return pair;
96
+ }
97
+ async batchCatchUpPairs(pairs, blockNumber) {
98
+ if (!blockNumber)
99
+ return;
100
+ const pairsToFetch = [];
101
+ for (const _pair of pairs) {
102
+ const pairs = await Promise.all([
103
+ this.findInfusionPair(_pair[0], _pair[1], true),
104
+ this.findInfusionPair(_pair[0], _pair[1], false),
105
+ ]);
106
+ for (const pair of pairs) {
107
+ if (!(pair && pair.exchange))
108
+ continue;
109
+ if (!pair.pool) {
110
+ pairsToFetch.push(pair);
111
+ }
112
+ else if (!pair.pool.getState(blockNumber)) {
113
+ pairsToFetch.push(pair);
114
+ }
115
+ }
116
+ }
117
+ if (!pairsToFetch.length)
118
+ return;
119
+ const reserves = await this.getManyPoolReserves(pairsToFetch, blockNumber);
120
+ if (reserves.length !== pairsToFetch.length) {
121
+ this.logger.error(`Error_getManyPoolReserves didn't get any pool reserves`);
122
+ }
123
+ for (let i = 0; i < pairsToFetch.length; i++) {
124
+ const pairState = reserves[i];
125
+ const pair = pairsToFetch[i];
126
+ if (!pair.pool) {
127
+ await this.addPool(pair, pairState.reserves0, pairState.reserves1, pairState.feeCode, blockNumber);
128
+ }
129
+ else
130
+ pair.pool.setState(pairState, blockNumber);
131
+ }
132
+ }
133
+ async getManyPoolReserves(pairs, blockNumber) {
134
+ try {
135
+ const multiCallFeeData = pairs.map(pair => this.getFeesMultiCallData(pair));
136
+ const calldata = pairs
137
+ .map((pair, i) => {
138
+ let calldata = [
139
+ {
140
+ target: pair.token0.address,
141
+ callData: erc20Iface.encodeFunctionData('balanceOf', [
142
+ pair.exchange,
143
+ ]),
144
+ },
145
+ {
146
+ target: pair.token1.address,
147
+ callData: erc20Iface.encodeFunctionData('balanceOf', [
148
+ pair.exchange,
149
+ ]),
150
+ },
151
+ ];
152
+ if (this.isDynamicFees)
153
+ calldata.push(multiCallFeeData[i].callEntry);
154
+ return calldata;
155
+ })
156
+ .flat();
157
+ const data = await this.dexHelper.multiContract.methods
158
+ .aggregate(calldata)
159
+ .call({}, blockNumber);
160
+ const returnData = lodash_1.default.chunk(data.returnData, this.isDynamicFees ? 3 : 2);
161
+ return pairs.map((pair, i) => ({
162
+ reserves0: defaultAbiCoder
163
+ .decode(['uint256'], returnData[i][0])[0]
164
+ .toString(),
165
+ reserves1: defaultAbiCoder
166
+ .decode(['uint256'], returnData[i][1])[0]
167
+ .toString(),
168
+ feeCode: this.isDynamicFees
169
+ ? multiCallFeeData[i].callDecoder(returnData[i][2])
170
+ : (pair.stable ? this.stableFee : this.volatileFee) || this.feeCode,
171
+ }));
172
+ }
173
+ catch (e) {
174
+ this.logger.error(`Error_getManyPoolReserves could not get reserves with error:`, e);
175
+ return [];
176
+ }
177
+ }
178
+ async getSellPrice(priceParams, srcAmount) {
179
+ return priceParams.stable
180
+ ? infusion_stable_pool_1.InfusionStablePool.getSellPrice(priceParams, srcAmount, this.feeFactor)
181
+ : uniswap_v2_constant_product_pool_1.Uniswapv2ConstantProductPool.getSellPrice(priceParams, srcAmount, this.feeFactor);
182
+ }
183
+ async getPricesVolume(_from, _to, amounts, side, blockNumber,
184
+ // list of pool identifiers to use for pricing, if undefined use all pools
185
+ limitPools, transferFees = {
186
+ srcFee: 0,
187
+ destFee: 0,
188
+ srcDexFee: 0,
189
+ destDexFee: 0,
190
+ }) {
191
+ try {
192
+ if (side === core_1.SwapSide.BUY)
193
+ return null; // Buy side not implemented yet
194
+ const from = this.dexHelper.config.wrapETH(_from);
195
+ const to = this.dexHelper.config.wrapETH(_to);
196
+ if (from.address.toLowerCase() === to.address.toLowerCase()) {
197
+ return null;
198
+ }
199
+ const tokenAddress = [
200
+ from.address.toLowerCase(),
201
+ to.address.toLowerCase(),
202
+ ]
203
+ .sort((a, b) => (a > b ? 1 : -1))
204
+ .join('_');
205
+ await this.batchCatchUpPairs([[from, to]], blockNumber);
206
+ const resultPromises = [false, true].map(async (stable) => {
207
+ // We don't support fee on transfer for stable pools yet
208
+ if (stable &&
209
+ (transferFees.srcFee !== 0 || transferFees.srcDexFee !== 0)) {
210
+ return null;
211
+ }
212
+ const poolIdentifier = `${this.dexKey}_${tokenAddress}` + this.poolPostfix(stable);
213
+ if (limitPools && limitPools.every(p => p !== poolIdentifier))
214
+ return null;
215
+ const isSell = side === core_1.SwapSide.SELL;
216
+ const pairParam = await this.getInfusionPairOrderedParams(from, to, blockNumber, stable, transferFees.srcDexFee);
217
+ if (!pairParam)
218
+ return null;
219
+ const unitAmount = (0, utils_1.getBigIntPow)(from.decimals);
220
+ const [unitVolumeWithFee, ...amountsWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unitAmount, ...amounts], side, isSell ? transferFees.srcFee : transferFees.destFee, isSell ? constants_1.SRC_TOKEN_PARASWAP_TRANSFERS : constants_1.DEST_TOKEN_PARASWAP_TRANSFERS);
221
+ const unit = await this.getSellPricePath(unitVolumeWithFee, [
222
+ pairParam,
223
+ ]);
224
+ const prices = await Promise.all(amountsWithFee.map(amount => amount === 0n ? 0n : this.getSellPricePath(amount, [pairParam])));
225
+ const [unitOutWithFee, ...outputsWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unit, ...prices], side,
226
+ // This part is confusing, because we treat differently SELL and BUY fees
227
+ // If Buy, we should apply transfer fee on srcToken on top of dexFee applied earlier
228
+ // But for Sell we should apply only one dexFee
229
+ isSell ? transferFees.destDexFee : transferFees.srcFee, isSell ? this.DEST_TOKEN_DEX_TRANSFERS : constants_1.SRC_TOKEN_PARASWAP_TRANSFERS);
230
+ return {
231
+ prices: outputsWithFee,
232
+ unit: unitOutWithFee,
233
+ data: {
234
+ router: this.router,
235
+ path: [from.address.toLowerCase(), to.address.toLowerCase()],
236
+ factory: this.factoryAddress,
237
+ initCode: this.initCode,
238
+ feeFactor: this.feeFactor,
239
+ isFeeTokenInRoute: Object.values(transferFees).some(f => f !== 0),
240
+ pools: [
241
+ {
242
+ address: pairParam.exchange,
243
+ fee: parseInt(pairParam.fee),
244
+ direction: pairParam.direction,
245
+ },
246
+ ],
247
+ },
248
+ exchange: this.dexKey,
249
+ poolIdentifier,
250
+ gasCost: this.poolGasCost,
251
+ poolAddresses: [pairParam.exchange],
252
+ };
253
+ });
254
+ const resultPools = (await Promise.all(resultPromises));
255
+ const resultPoolsFiltered = resultPools.filter(item => !!item); // filter null elements
256
+ return resultPoolsFiltered.length > 0 ? resultPoolsFiltered : null;
257
+ }
258
+ catch (e) {
259
+ if (blockNumber === 0)
260
+ this.logger.error(`Error_getPricesVolume: Aurelius block manager not yet instantiated`);
261
+ this.logger.error(`Error_getPrices:`, e);
262
+ return null;
263
+ }
264
+ }
265
+ async getTopPoolsForToken(tokenAddress, count) {
266
+ if (!this.subgraphURL)
267
+ return [];
268
+ let stableFieldKey = 'isStable';
269
+ const query = `query ($token: Bytes!, $count: Int) {
270
+ pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
271
+ id
272
+ ${stableFieldKey}
273
+ token0 {
274
+ id
275
+ decimals
276
+ }
277
+ token1 {
278
+ id
279
+ decimals
280
+ }
281
+ reserveUSD
282
+ }
283
+ pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
284
+ id
285
+ ${stableFieldKey}
286
+ token0 {
287
+ id
288
+ decimals
289
+ }
290
+ token1 {
291
+ id
292
+ decimals
293
+ }
294
+ reserveUSD
295
+ }
296
+ }`;
297
+ const { data } = await this.dexHelper.httpRequest.post(this.subgraphURL, {
298
+ query,
299
+ variables: { token: tokenAddress.toLowerCase(), count },
300
+ }, constants_1.SUBGRAPH_TIMEOUT);
301
+ if (!(data && data.pools0 && data.pools1))
302
+ throw new Error("Couldn't fetch the pools from the subgraph");
303
+ const pools0 = lodash_1.default.map(data.pools0, pool => ({
304
+ exchange: this.dexKey,
305
+ stable: pool[stableFieldKey],
306
+ address: pool.id.toLowerCase(),
307
+ connectorTokens: [
308
+ {
309
+ address: pool.token1.id.toLowerCase(),
310
+ decimals: parseInt(pool.token1.decimals),
311
+ },
312
+ ],
313
+ liquidityUSD: parseFloat(pool.reserveUSD),
314
+ }));
315
+ const pools1 = lodash_1.default.map(data.pools1, pool => ({
316
+ exchange: this.dexKey,
317
+ stable: pool[stableFieldKey],
318
+ address: pool.id.toLowerCase(),
319
+ connectorTokens: [
320
+ {
321
+ address: pool.token0.id.toLowerCase(),
322
+ decimals: parseInt(pool.token0.decimals),
323
+ },
324
+ ],
325
+ liquidityUSD: parseFloat(pool.reserveUSD),
326
+ }));
327
+ return lodash_1.default.slice(lodash_1.default.sortBy(lodash_1.default.concat(pools0, pools1), [pool => -1 * pool.liquidityUSD]), 0, count);
328
+ }
329
+ // Same as at uniswap-v2-pool.json, but extended with decimals and stable
330
+ async getInfusionPairOrderedParams(from, to, blockNumber, stable, tokenDexTransferFee) {
331
+ const pair = await this.findInfusionPair(from, to, stable);
332
+ if (!(pair && pair.pool && pair.exchange))
333
+ return null;
334
+ const pairState = pair?.pool.getState(blockNumber);
335
+ if (!pairState) {
336
+ this.logger.error(`Error_orderPairParams expected reserves, got none (maybe the pool doesn't exist) ${from.symbol || from.address} ${to.symbol || to.address}`);
337
+ return null;
338
+ }
339
+ const fee = (pairState.feeCode + tokenDexTransferFee).toString();
340
+ const pairReversed = pair.token1.address.toLowerCase() === from.address.toLowerCase();
341
+ if (pairReversed) {
342
+ return {
343
+ tokenIn: from.address,
344
+ tokenOut: to.address,
345
+ reservesIn: pairState.reserves1,
346
+ reservesOut: pairState.reserves0,
347
+ fee,
348
+ direction: false,
349
+ exchange: pair.exchange,
350
+ decimalsIn: from.decimals,
351
+ decimalsOut: to.decimals,
352
+ stable,
353
+ };
354
+ }
355
+ return {
356
+ tokenIn: from.address,
357
+ tokenOut: to.address,
358
+ reservesIn: pairState.reserves0,
359
+ reservesOut: pairState.reserves1,
360
+ fee,
361
+ direction: true,
362
+ exchange: pair.exchange,
363
+ decimalsIn: from.decimals,
364
+ decimalsOut: to.decimals,
365
+ stable,
366
+ };
367
+ }
368
+ async getPoolIdentifiers(_from, _to, side, blockNumber) {
369
+ if (side === core_1.SwapSide.BUY)
370
+ return [];
371
+ const from = this.dexHelper.config.wrapETH(_from);
372
+ const to = this.dexHelper.config.wrapETH(_to);
373
+ if (from.address.toLowerCase() === to.address.toLowerCase()) {
374
+ return [];
375
+ }
376
+ const tokenAddress = [from.address.toLowerCase(), to.address.toLowerCase()]
377
+ .sort((a, b) => (a > b ? 1 : -1))
378
+ .join('_');
379
+ const poolIdentifier = `${this.dexKey}_${tokenAddress}`;
380
+ const poolIdentifierUniswap = poolIdentifier + this.poolPostfix(false);
381
+ const poolIdentifierStable = poolIdentifier + this.poolPostfix(true);
382
+ return [poolIdentifierUniswap, poolIdentifierStable];
383
+ }
384
+ poolPostfix(stable) {
385
+ return stable ? 'S' : 'V';
386
+ }
387
+ getAdapters(side) {
388
+ return null;
389
+ }
390
+ getAdapterParam(srcToken, destToken, srcAmount, toAmount, // required for buy case
391
+ data, side) {
392
+ return {
393
+ targetExchange: data.router,
394
+ payload: '',
395
+ networkFee: '0',
396
+ };
397
+ }
398
+ getDexParam(src, dest, srcAmount, destAmount, recipient, data, side) {
399
+ if (side === core_1.SwapSide.BUY)
400
+ throw new Error(`Buy not supported`);
401
+ let routerMethod;
402
+ let routerArgs;
403
+ const stable = (0, isStablePair_1.isStablePair)(this.network, src, dest);
404
+ const from = (0, utils_1.isETHAddress)(src)
405
+ ? this.dexHelper.config.data.wrappedNativeTokenAddress
406
+ : src;
407
+ const to = (0, utils_1.isETHAddress)(dest)
408
+ ? this.dexHelper.config.data.wrappedNativeTokenAddress
409
+ : dest;
410
+ routerMethod = (0, utils_1.isETHAddress)(src)
411
+ ? InfusionRouterFunctions.sellExactEth
412
+ : InfusionRouterFunctions.swapExactIn;
413
+ routerMethod = (0, utils_1.isETHAddress)(dest)
414
+ ? InfusionRouterFunctions.sellExactToken
415
+ : routerMethod;
416
+ routerArgs = (0, utils_1.isETHAddress)(src)
417
+ ? [
418
+ destAmount,
419
+ [{ from, to, stable }],
420
+ recipient,
421
+ Math.floor(new Date().getTime() / 1000) + 120,
422
+ ]
423
+ : [
424
+ srcAmount,
425
+ destAmount,
426
+ [{ from, to, stable }],
427
+ recipient,
428
+ Math.floor(new Date().getTime() / 1000) + 120,
429
+ ];
430
+ const exchangeData = new abi_1.Interface(InfusionRouter_json_1.default).encodeFunctionData(routerMethod, routerArgs);
431
+ return {
432
+ needWrapNative: this.needWrapNative,
433
+ dexFuncHasRecipient: true,
434
+ exchangeData,
435
+ targetExchange: data.router,
436
+ returnAmountPos: undefined,
437
+ };
438
+ }
439
+ getFeesMultiCallData(pair) {
440
+ const callEntry = {
441
+ target: this.factoryAddress,
442
+ callData: velodromeFactoryIface.encodeFunctionData('getFee', [
443
+ pair.stable,
444
+ ]),
445
+ };
446
+ const callDecoder = (values) => parseInt(velodromeFactoryIface
447
+ .decodeFunctionResult('getFee', values)[0]
448
+ .toString());
449
+ return {
450
+ callEntry,
451
+ callDecoder,
452
+ };
453
+ }
454
+ }
455
+ exports.Infusion = Infusion;
456
+ Infusion.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(lodash_1.default.pick(config_1.InfusionConfig, ['Infusion']));
457
+ //# sourceMappingURL=infusion.js.map