@paraswap/dex-lib 4.1.13 → 4.1.14-balv3

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 (340) hide show
  1. package/build/abi/Aave_GSM.json +751 -0
  2. package/build/abi/Balancer.json +257 -0
  3. package/build/abi/BalancerV2.json +1179 -0
  4. package/build/abi/{integral/relayer.json → RamsesV2Pool.abi.json} +850 -832
  5. package/build/abi/RamsesV2Quoter.abi.json +274 -0
  6. package/build/abi/USDM.json +807 -0
  7. package/build/abi/UniswapV2Router.json +397 -0
  8. package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +1246 -0
  9. package/build/abi/{integral/oracle.json → angle-transmuter/ChainlinkEACAggregatorProxy.json} +247 -239
  10. package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
  11. package/build/abi/curve-v1/CurveTokenV1.json +305 -0
  12. package/build/abi/curve-v1/CurveTokenV2.json +318 -0
  13. package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
  14. package/build/abi/curve-v1/CurveV2Swap.json +700 -0
  15. package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
  16. package/build/abi/curve-v1/FactoryRegistry.json +508 -0
  17. package/build/abi/curve-v1/StableSwapAave.json +1152 -0
  18. package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
  19. package/build/abi/curve-v1/StableSwapCompound.json +814 -0
  20. package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
  21. package/build/abi/curve-v1/StableSwapPax.json +865 -0
  22. package/build/abi/curve-v1/StableSwapSnow.json +900 -0
  23. package/build/abi/{integral/pool.json → curve-v1/StableSwapUSDN.json} +450 -487
  24. package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
  25. package/build/abi/curve-v1/StableSwapY.json +814 -0
  26. package/build/abi/inception/inception-ineth-pool.json +1062 -0
  27. package/build/abi/inception/inception-ineth.json +609 -0
  28. package/build/abi/inception/inception-ratio-feed.json +329 -0
  29. package/build/abi/inception/inception-vault.json +991 -0
  30. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  31. package/build/abi/kyberdmm.abi.json +1148 -0
  32. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  33. package/build/abi/nerve/nerve-metapool.json +790 -0
  34. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  35. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  36. package/build/dex/aave-v1/aave-v1.d.ts +2 -1
  37. package/build/dex/aave-v1/aave-v1.js +22 -0
  38. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  39. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  40. package/build/dex/balancer-v3/balancer-v3-pool.js +9 -0
  41. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
  42. package/build/dex/balancer-v3/balancer-v3.js +9 -2
  43. package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
  44. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  45. package/build/dex/bebop/websocket-fetcher.js +87 -0
  46. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  47. package/build/dex/hashflow/config.js +3 -0
  48. package/build/dex/hashflow/config.js.map +1 -1
  49. package/build/dex/hashflow/hashflow.js +4 -8
  50. package/build/dex/hashflow/hashflow.js.map +1 -1
  51. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  52. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  53. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  54. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  55. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  56. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  57. package/build/dex/idle-dao/scripts.d.ts +9 -0
  58. package/build/dex/idle-dao/scripts.js +552 -0
  59. package/build/dex/idle-dao/scripts.js.map +1 -0
  60. package/build/dex/inception/config.d.ts +4 -0
  61. package/build/dex/inception/config.js +109 -0
  62. package/build/dex/inception/config.js.map +1 -0
  63. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  64. package/build/dex/inception/inception-event-pool.js +51 -0
  65. package/build/dex/inception/inception-event-pool.js.map +1 -0
  66. package/build/dex/{integral/integral.d.ts → inception/inception-native.d.ts} +21 -19
  67. package/build/dex/inception/inception-native.js +131 -0
  68. package/build/dex/inception/inception-native.js.map +1 -0
  69. package/build/dex/inception/inception-pool.d.ts +18 -0
  70. package/build/dex/inception/inception-pool.js +32 -0
  71. package/build/dex/inception/inception-pool.js.map +1 -0
  72. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  73. package/build/dex/inception/inception-price-feed.js +51 -0
  74. package/build/dex/inception/inception-price-feed.js.map +1 -0
  75. package/build/dex/inception/inception.d.ts +43 -0
  76. package/build/dex/inception/inception.js +204 -0
  77. package/build/dex/inception/inception.js.map +1 -0
  78. package/build/dex/inception/tokens.d.ts +9 -0
  79. package/build/dex/inception/tokens.js +28 -0
  80. package/build/dex/inception/tokens.js.map +1 -0
  81. package/build/dex/inception/types.d.ts +22 -0
  82. package/build/dex/{m-token → inception}/types.js.map +1 -1
  83. package/build/dex/inception/utils.d.ts +6 -0
  84. package/build/dex/inception/utils.js +37 -0
  85. package/build/dex/inception/utils.js.map +1 -0
  86. package/build/dex/jarvis.d.ts +2 -1
  87. package/build/dex/jarvis.js +58 -0
  88. package/build/dex/jarvis.js.map +1 -1
  89. package/build/dex/platypus/platypus.d.ts +2 -1
  90. package/build/dex/platypus/platypus.js +31 -0
  91. package/build/dex/platypus/platypus.js.map +1 -1
  92. package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
  93. package/build/dex/swaap-v1/swaap-v1.js +10 -0
  94. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  95. package/build/dex/woo-fi-v2/config.js +1 -1
  96. package/build/dex/zerox/index.d.ts +4 -26
  97. package/build/dex/zerox/index.js +50 -42
  98. package/build/dex/zerox/index.js.map +1 -1
  99. package/build/dex/zerox/types.d.ts +29 -0
  100. package/build/dex/zerox/types.js +8 -1
  101. package/build/dex/zerox/types.js.map +1 -1
  102. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  103. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  104. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  105. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  106. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  107. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  108. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  109. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  110. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  111. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  112. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  113. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  114. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  115. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  116. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  117. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  118. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  119. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  120. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  121. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  122. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  123. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  124. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  125. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  126. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  127. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  128. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  129. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  130. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  131. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  132. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  133. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  134. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  135. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  136. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  137. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  138. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  139. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  140. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  141. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  142. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  143. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  144. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  145. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  146. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  147. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  148. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  149. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  150. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  151. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  152. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  153. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  154. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  155. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  156. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  157. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  158. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  159. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  160. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  161. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  162. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  163. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  164. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  165. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  166. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  167. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  168. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  169. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  170. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  171. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  172. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  173. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  174. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  175. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  176. package/package.json +2 -2
  177. package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +62 -42
  178. package/src/dex/balancer-v3/balancer-v3-pool.ts +9 -0
  179. package/src/dex/balancer-v3/balancer-v3.ts +15 -4
  180. package/src/dex/hashflow/config.ts +3 -0
  181. package/src/dex/hashflow/hashflow-e2e.test.ts +30 -18
  182. package/src/dex/hashflow/hashflow.ts +6 -10
  183. package/src/dex/woo-fi-v2/config.ts +1 -1
  184. package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +1 -0
  185. package/tests/constants-e2e.ts +6 -1
  186. package/.idea/aws.xml +0 -17
  187. package/.idea/codeStyles/Project.xml +0 -19
  188. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  189. package/.idea/misc.xml +0 -6
  190. package/.idea/modules.xml +0 -8
  191. package/.idea/paraswap-dex-lib.iml +0 -9
  192. package/.idea/prettier.xml +0 -7
  193. package/.idea/vcs.xml +0 -6
  194. package/build/abi/integral/factory.json +0 -333
  195. package/build/abi/uniswap-v4/pool-manager.abi.json +0 -1366
  196. package/build/abi/uniswap-v4/quoter.abi.json +0 -461
  197. package/build/abi/uniswap-v4/router.abi.json +0 -230
  198. package/build/abi/uniswap-v4/state-view.abi.json +0 -365
  199. package/build/dex/bProtocol.d.ts +0 -18
  200. package/build/dex/bProtocol.js +0 -39
  201. package/build/dex/bProtocol.js.map +0 -1
  202. package/build/dex/bancor.d.ts +0 -26
  203. package/build/dex/bancor.js +0 -58
  204. package/build/dex/bancor.js.map +0 -1
  205. package/build/dex/compound.d.ts +0 -18
  206. package/build/dex/compound.js +0 -46
  207. package/build/dex/compound.js.map +0 -1
  208. package/build/dex/curve-v2.d.ts +0 -58
  209. package/build/dex/curve-v2.js +0 -180
  210. package/build/dex/curve-v2.js.map +0 -1
  211. package/build/dex/dodo-v1.d.ts +0 -33
  212. package/build/dex/dodo-v1.js +0 -63
  213. package/build/dex/dodo-v1.js.map +0 -1
  214. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
  215. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
  216. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
  217. package/build/dex/integral/config.d.ts +0 -4
  218. package/build/dex/integral/config.js +0 -20
  219. package/build/dex/integral/config.js.map +0 -1
  220. package/build/dex/integral/context.d.ts +0 -40
  221. package/build/dex/integral/context.js +0 -158
  222. package/build/dex/integral/context.js.map +0 -1
  223. package/build/dex/integral/integral-factory.d.ts +0 -24
  224. package/build/dex/integral/integral-factory.js +0 -95
  225. package/build/dex/integral/integral-factory.js.map +0 -1
  226. package/build/dex/integral/integral-pool.d.ts +0 -50
  227. package/build/dex/integral/integral-pool.js +0 -149
  228. package/build/dex/integral/integral-pool.js.map +0 -1
  229. package/build/dex/integral/integral-pricing.d.ts +0 -18
  230. package/build/dex/integral/integral-pricing.js +0 -114
  231. package/build/dex/integral/integral-pricing.js.map +0 -1
  232. package/build/dex/integral/integral-relayer.d.ts +0 -42
  233. package/build/dex/integral/integral-relayer.js +0 -192
  234. package/build/dex/integral/integral-relayer.js.map +0 -1
  235. package/build/dex/integral/integral-token.d.ts +0 -27
  236. package/build/dex/integral/integral-token.js +0 -59
  237. package/build/dex/integral/integral-token.js.map +0 -1
  238. package/build/dex/integral/integral.js +0 -376
  239. package/build/dex/integral/integral.js.map +0 -1
  240. package/build/dex/integral/types.d.ts +0 -85
  241. package/build/dex/integral/types.js +0 -9
  242. package/build/dex/integral/types.js.map +0 -1
  243. package/build/dex/integral/utils-e2e.d.ts +0 -9
  244. package/build/dex/integral/utils-e2e.js +0 -131
  245. package/build/dex/integral/utils-e2e.js.map +0 -1
  246. package/build/dex/integral/utils.d.ts +0 -17
  247. package/build/dex/integral/utils.js +0 -94
  248. package/build/dex/integral/utils.js.map +0 -1
  249. package/build/dex/lido.d.ts +0 -19
  250. package/build/dex/lido.js +0 -42
  251. package/build/dex/lido.js.map +0 -1
  252. package/build/dex/m-token/config.d.ts +0 -3
  253. package/build/dex/m-token/config.js +0 -19
  254. package/build/dex/m-token/config.js.map +0 -1
  255. package/build/dex/m-token/m-token.d.ts +0 -29
  256. package/build/dex/m-token/m-token.js +0 -145
  257. package/build/dex/m-token/m-token.js.map +0 -1
  258. package/build/dex/m-token/m-wrapped-m.d.ts +0 -17
  259. package/build/dex/m-token/m-wrapped-m.js +0 -50
  260. package/build/dex/m-token/m-wrapped-m.js.map +0 -1
  261. package/build/dex/m-token/types.d.ts +0 -12
  262. package/build/dex/onebit.d.ts +0 -25
  263. package/build/dex/onebit.js +0 -42
  264. package/build/dex/onebit.js.map +0 -1
  265. package/build/dex/smoothy.d.ts +0 -26
  266. package/build/dex/smoothy.js +0 -48
  267. package/build/dex/smoothy.js.map +0 -1
  268. package/build/dex/spark/susds-psm.d.ts +0 -49
  269. package/build/dex/spark/susds-psm.js +0 -245
  270. package/build/dex/spark/susds-psm.js.map +0 -1
  271. package/build/dex/stable-pool.d.ts +0 -28
  272. package/build/dex/stable-pool.js +0 -62
  273. package/build/dex/stable-pool.js.map +0 -1
  274. package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
  275. package/build/dex/trader-joe-v2.1/optimizer.js +0 -47
  276. package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
  277. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  278. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  279. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  280. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  281. package/build/dex/trader-joe-v2.1.js +0 -79
  282. package/build/dex/trader-joe-v2.1.js.map +0 -1
  283. package/build/dex/uniswap-v4/config.d.ts +0 -3
  284. package/build/dex/uniswap-v4/config.js +0 -58
  285. package/build/dex/uniswap-v4/config.js.map +0 -1
  286. package/build/dex/uniswap-v4/constants.d.ts +0 -7
  287. package/build/dex/uniswap-v4/constants.js +0 -18
  288. package/build/dex/uniswap-v4/constants.js.map +0 -1
  289. package/build/dex/uniswap-v4/contract-math/BitMath.d.ts +0 -4
  290. package/build/dex/uniswap-v4/contract-math/BitMath.js +0 -93
  291. package/build/dex/uniswap-v4/contract-math/BitMath.js.map +0 -1
  292. package/build/dex/uniswap-v4/contract-math/FixedPoint128.d.ts +0 -3
  293. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js +0 -8
  294. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js.map +0 -1
  295. package/build/dex/uniswap-v4/contract-math/FixedPoint96.d.ts +0 -4
  296. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js +0 -9
  297. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js.map +0 -1
  298. package/build/dex/uniswap-v4/contract-math/FullMath.d.ts +0 -4
  299. package/build/dex/uniswap-v4/contract-math/FullMath.js +0 -19
  300. package/build/dex/uniswap-v4/contract-math/FullMath.js.map +0 -1
  301. package/build/dex/uniswap-v4/contract-math/LiquidityMath.d.ts +0 -3
  302. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js +0 -22
  303. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js.map +0 -1
  304. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.d.ts +0 -10
  305. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js +0 -91
  306. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js.map +0 -1
  307. package/build/dex/uniswap-v4/contract-math/SwapMath.d.ts +0 -8
  308. package/build/dex/uniswap-v4/contract-math/SwapMath.js +0 -70
  309. package/build/dex/uniswap-v4/contract-math/SwapMath.js.map +0 -1
  310. package/build/dex/uniswap-v4/contract-math/TickBitMap.d.ts +0 -7
  311. package/build/dex/uniswap-v4/contract-math/TickBitMap.js +0 -86
  312. package/build/dex/uniswap-v4/contract-math/TickBitMap.js.map +0 -1
  313. package/build/dex/uniswap-v4/contract-math/TickMath.d.ts +0 -8
  314. package/build/dex/uniswap-v4/contract-math/TickMath.js +0 -162
  315. package/build/dex/uniswap-v4/contract-math/TickMath.js.map +0 -1
  316. package/build/dex/uniswap-v4/contract-math/UnsafeMath.d.ts +0 -3
  317. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js +0 -10
  318. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js.map +0 -1
  319. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.d.ts +0 -8
  320. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js +0 -11
  321. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js.map +0 -1
  322. package/build/dex/uniswap-v4/encoder.d.ts +0 -16
  323. package/build/dex/uniswap-v4/encoder.js +0 -104
  324. package/build/dex/uniswap-v4/encoder.js.map +0 -1
  325. package/build/dex/uniswap-v4/subgraph.d.ts +0 -5
  326. package/build/dex/uniswap-v4/subgraph.js +0 -80
  327. package/build/dex/uniswap-v4/subgraph.js.map +0 -1
  328. package/build/dex/uniswap-v4/types.d.ts +0 -64
  329. package/build/dex/uniswap-v4/types.js +0 -3
  330. package/build/dex/uniswap-v4/types.js.map +0 -1
  331. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.d.ts +0 -33
  332. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js +0 -152
  333. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js.map +0 -1
  334. package/build/dex/uniswap-v4/uniswap-v4.d.ts +0 -38
  335. package/build/dex/uniswap-v4/uniswap-v4.js +0 -169
  336. package/build/dex/uniswap-v4/uniswap-v4.js.map +0 -1
  337. package/build/dex/uniswap-v4/utils.d.ts +0 -2
  338. package/build/dex/uniswap-v4/utils.js +0 -15
  339. package/build/dex/uniswap-v4/utils.js.map +0 -1
  340. /package/build/dex/{m-token → inception}/types.js +0 -0
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPoolBackReferencedFrom = exports.getPoolIdentifier = exports.isInverted = exports.getTickCumulatives = exports.getAveragePrice = exports.getSpotPrice = exports.getPrice = exports.getDecimalsConverter = exports.sortTokens = exports.uint32ToNumber = exports.ceil_div = void 0;
4
- const decoders_1 = require("../../lib/decoders");
5
- const utils_1 = require("../../utils");
6
- const FullMath_1 = require("../uniswap-v3/contract-math/FullMath");
7
- const Oracle_1 = require("../uniswap-v3/contract-math/Oracle");
8
- const TickMath_1 = require("../uniswap-v3/contract-math/TickMath");
9
- function ceil_div(a, b) {
10
- const c = a / b;
11
- if (a != b * c) {
12
- return c + 1n;
13
- }
14
- else {
15
- return c;
16
- }
17
- }
18
- exports.ceil_div = ceil_div;
19
- const uint32ToNumber = (result) => {
20
- return (0, decoders_1.generalDecoder)(result, ['uint32'], 0, value => parseInt(value[0].toString(), 10));
21
- };
22
- exports.uint32ToNumber = uint32ToNumber;
23
- function sortTokens(srcAddress, destAddress) {
24
- return [srcAddress, destAddress].sort((a, b) => (a < b ? -1 : 1));
25
- }
26
- exports.sortTokens = sortTokens;
27
- function getDecimalsConverter(decimals0, decimals1, inverted) {
28
- return (10n **
29
- (18n + BigInt(inverted ? decimals1 - decimals0 : decimals0 - decimals1)));
30
- }
31
- exports.getDecimalsConverter = getDecimalsConverter;
32
- function getPrice(states, inverted) {
33
- const { base, pricing, relayer } = states;
34
- const decimalsConverter = getDecimalsConverter(base.decimals0, base.decimals1, false);
35
- const spotPrice = getSpotPrice(pricing, decimalsConverter);
36
- const averagePrice = getAveragePrice(relayer, pricing, decimalsConverter);
37
- if (inverted) {
38
- return 10n ** 36n / (spotPrice > averagePrice ? spotPrice : averagePrice);
39
- }
40
- else {
41
- return spotPrice < averagePrice ? spotPrice : averagePrice;
42
- }
43
- }
44
- exports.getPrice = getPrice;
45
- function getSpotPrice(pricing, decimalsConverter) {
46
- const sqrtPriceX96 = pricing.slot0.sqrtPriceX96;
47
- const priceX128 = FullMath_1.FullMath.mulDiv(sqrtPriceX96, sqrtPriceX96, 2n ** 64n);
48
- return FullMath_1.FullMath.mulDiv(priceX128, decimalsConverter, 2n ** 128n);
49
- }
50
- exports.getSpotPrice = getSpotPrice;
51
- function getAveragePrice(relayer, pricing, decimalsConverter) {
52
- (0, utils_1._require)(relayer.twapInterval > 0, 'Twap Interval not set');
53
- const secondsAgo = BigInt(relayer.twapInterval);
54
- const secondsAgos = [secondsAgo, 0n];
55
- const tickCumulatives = getTickCumulatives(pricing, secondsAgos);
56
- const delta = tickCumulatives[1] - tickCumulatives[0];
57
- let arithmeticMeanTick = delta / secondsAgo;
58
- if (delta < 0 && delta % secondsAgo != 0n) {
59
- --arithmeticMeanTick;
60
- }
61
- const sqrtRatioX96 = TickMath_1.TickMath.getSqrtRatioAtTick(arithmeticMeanTick);
62
- const ratioX128 = FullMath_1.FullMath.mulDiv(sqrtRatioX96, sqrtRatioX96, 2n ** 64n);
63
- return FullMath_1.FullMath.mulDiv(ratioX128, decimalsConverter, 2n ** 128n);
64
- }
65
- exports.getAveragePrice = getAveragePrice;
66
- function getTickCumulatives(poolState, secondsAgos) {
67
- const { tickCumulatives } = secondsAgos.reduce((memo, secondsAgo, i) => {
68
- [memo.tickCumulatives[i], memo.secondsPerLiquidityCumulativeX128s[i]] =
69
- Oracle_1.Oracle.observeSingle(poolState, BigInt.asUintN(32, poolState.blockTimestamp), secondsAgo, poolState.slot0.tick, poolState.slot0.observationIndex, poolState.liquidity, poolState.slot0.observationCardinality);
70
- return memo;
71
- }, {
72
- tickCumulatives: Array(secondsAgos.length),
73
- secondsPerLiquidityCumulativeX128s: Array(secondsAgos.length),
74
- });
75
- return tickCumulatives;
76
- }
77
- exports.getTickCumulatives = getTickCumulatives;
78
- function isInverted(tokenIn, tokenOut) {
79
- const [, token1] = tokenIn.toLowerCase() < tokenOut.toLowerCase()
80
- ? [tokenIn, tokenOut]
81
- : [tokenOut, tokenIn];
82
- return tokenIn === token1;
83
- }
84
- exports.isInverted = isInverted;
85
- function getPoolIdentifier(dexKey, srcAddress, destAddress) {
86
- const tokenAddresses = sortTokens(srcAddress.toLowerCase(), destAddress.toLowerCase()).join('_');
87
- return `${dexKey}_${tokenAddresses}`;
88
- }
89
- exports.getPoolIdentifier = getPoolIdentifier;
90
- function getPoolBackReferencedFrom(context, poolAddress) {
91
- return Object.entries(context.pools).find(([, pool]) => pool.base?.poolAddress === poolAddress);
92
- }
93
- exports.getPoolBackReferencedFrom = getPoolBackReferencedFrom;
94
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/dex/integral/utils.ts"],"names":[],"mappings":";;;AAEA,iDAAoD;AAGpD,uCAAuC;AACvC,mEAAgE;AAChE,+DAA4D;AAC5D,mEAAgE;AAKhE,SAAgB,QAAQ,CAAC,CAAS,EAAE,CAAS;IAC3C,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACd,OAAO,CAAC,GAAG,EAAE,CAAC;KACf;SAAM;QACL,OAAO,CAAC,CAAC;KACV;AACH,CAAC;AAPD,4BAOC;AAEM,MAAM,cAAc,GAAG,CAC5B,MAA0C,EAClC,EAAE;IACV,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAA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,CAAC,WAAW,EAAE,EACxB,WAAW,CAAC,WAAW,EAAE,CAC1B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,MAAM,IAAI,cAAc,EAAE,CAAC;AACvC,CAAC;AAVD,8CAUC;AAED,SAAgB,yBAAyB,CACvC,OAAwB,EACxB,WAAoB;IAEpB,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CACvC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,KAAK,WAAW,CACrD,CAAC;AACJ,CAAC;AAPD,8DAOC"}
@@ -1,19 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { NumberAsString, SwapSide } from '@paraswap/core';
3
- import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { IDexHelper } from '../dex-helper';
6
- export declare const stETH: any;
7
- export declare enum stETHFunctions {
8
- submit = "submit"
9
- }
10
- export declare type LidoData = {};
11
- export declare class Lido implements IDexTxBuilder<LidoData, any> {
12
- static dexKeys: string[];
13
- stETHInterface: Interface;
14
- needWrapNative: boolean;
15
- private network;
16
- constructor(dexHelper: IDexHelper);
17
- getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): AdapterExchangeParam;
18
- getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): Promise<SimpleExchangeParam>;
19
- }
package/build/dex/lido.js DELETED
@@ -1,42 +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.Lido = exports.stETHFunctions = exports.stETH = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const stETH_json_1 = __importDefault(require("../abi/stETH.json"));
9
- const constants_1 = require("../constants");
10
- exports.stETH = {
11
- 1: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
12
- };
13
- var stETHFunctions;
14
- (function (stETHFunctions) {
15
- stETHFunctions["submit"] = "submit";
16
- })(stETHFunctions = exports.stETHFunctions || (exports.stETHFunctions = {}));
17
- class Lido {
18
- constructor(dexHelper) {
19
- this.needWrapNative = false;
20
- this.network = dexHelper.config.data.network;
21
- this.stETHInterface = new abi_1.Interface(stETH_json_1.default);
22
- }
23
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
24
- return {
25
- targetExchange: exports.stETH[this.network],
26
- payload: '0x',
27
- networkFee: '0',
28
- };
29
- }
30
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
31
- const swapData = this.stETHInterface.encodeFunctionData(stETHFunctions.submit, [constants_1.NULL_ADDRESS]);
32
- return {
33
- callees: [exports.stETH[this.network]],
34
- calldata: [swapData],
35
- values: [srcAmount],
36
- networkFee: '0',
37
- };
38
- }
39
- }
40
- exports.Lido = Lido;
41
- Lido.dexKeys = ['lido'];
42
- //# sourceMappingURL=lido.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lido.js","sourceRoot":"","sources":["../../src/dex/lido.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,mEAAyC;AACzC,4CAA4C;AAI/B,QAAA,KAAK,GAAQ;IACxB,CAAC,EAAE,4CAA4C;CAChD,CAAC;AAEF,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mCAAiB,CAAA;AACnB,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAID,MAAa,IAAI;IAQf,YAAY,SAAqB;QAJjC,mBAAc,GAAG,KAAK,CAAC;QAKrB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAE7C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAS,CAAC,oBAA0B,CAAC,CAAC;IAClE,CAAC;IAED,eAAe,CACb,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACrD,cAAc,CAAC,MAAM,EACrB,CAAC,wBAAY,CAAC,CACf,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;;AAhDH,oBAiDC;AAhDQ,YAAO,GAAG,CAAC,MAAM,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { DexConfigMap } from '../../types';
2
- import { DexParams } from './types';
3
- export declare const Config: DexConfigMap<DexParams>;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Config = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.Config = {
6
- MWrappedM: {
7
- [constants_1.Network.MAINNET]: {
8
- MToken: {
9
- address: '0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b',
10
- decimals: 6,
11
- },
12
- WrappedM: {
13
- address: '0x437cc33344a0B27A429f795ff6B469C72698B291',
14
- decimals: 6,
15
- },
16
- },
17
- },
18
- };
19
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/m-token/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,MAAM,GAA4B;IAC7C,SAAS,EAAE;QACT,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,MAAM,EAAE;gBACN,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,CAAC;aACZ;YACD,QAAQ,EAAE;gBACR,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,CAAC;aACZ;SACF;KACF;CACF,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, PoolLiquidity } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex } from '../idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import type { MTokenData, DexParams } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- export declare class MToken extends SimpleExchange implements IDex<MTokenData> {
8
- readonly network: Network;
9
- readonly dexKey: string;
10
- readonly dexHelper: IDexHelper;
11
- readonly config: DexParams;
12
- readonly hasConstantPriceLargeAmounts = true;
13
- readonly needWrapNative = false;
14
- readonly isFeeOnTransferSupported = false;
15
- logger: Logger;
16
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config: DexParams);
17
- initializePricing(): Promise<void>;
18
- getAdapters(): null;
19
- getPoolIdentifiers(from: Token, to: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
20
- getPricesVolume(from: Token, to: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<MTokenData>>;
21
- getCalldataGasCost(poolPrices: PoolPrices<MTokenData>): number | number[];
22
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MTokenData, side: SwapSide): AdapterExchangeParam;
23
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
24
- isMOrWrappedM(tokenAddress: Address): boolean;
25
- ensureOrigin(args: Partial<{
26
- from: Token;
27
- to: Token;
28
- }>): boolean;
29
- }
@@ -1,145 +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 () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.MToken = void 0;
37
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
38
- const simple_exchange_1 = require("../simple-exchange");
39
- const bigint_constants_1 = require("../../bigint-constants");
40
- class MToken extends simple_exchange_1.SimpleExchange {
41
- network;
42
- dexKey;
43
- dexHelper;
44
- config;
45
- hasConstantPriceLargeAmounts = true;
46
- needWrapNative = false;
47
- isFeeOnTransferSupported = false;
48
- logger;
49
- constructor(network, dexKey, dexHelper, config) {
50
- super(dexHelper, dexKey);
51
- this.network = network;
52
- this.dexKey = dexKey;
53
- this.dexHelper = dexHelper;
54
- this.config = config;
55
- this.logger = dexHelper.getLogger(dexKey);
56
- }
57
- // No initialization needed for constant price
58
- async initializePricing() { }
59
- // Legacy: was only used for V5
60
- // Returns the list of contract adapters (name and index)
61
- // for a buy/sell. Return null if there are no adapters.
62
- getAdapters() {
63
- return null;
64
- }
65
- // Returns list of pool identifiers that can be used
66
- // for a given swap. poolIdentifiers must be unique
67
- // across DEXes. It is recommended to use
68
- // ${dexKey}_${poolAddress} as a poolIdentifier
69
- async getPoolIdentifiers(from, to, side, blockNumber) {
70
- if (!this.ensureOrigin({ from, to })) {
71
- return [];
72
- }
73
- return [`${this.dexKey}_${this.config.WrappedM.address}`];
74
- }
75
- // Returns pool prices for amounts.
76
- // If limitPools is defined only pools in limitPools
77
- // should be used. If limitPools is undefined then
78
- // any pools can be used.
79
- async getPricesVolume(from, to, amounts, side, blockNumber, limitPools) {
80
- if (!this.ensureOrigin({ from, to })) {
81
- return null;
82
- }
83
- // 1:1 swap
84
- // Amounts need no adjustment
85
- const unitOut = bigint_constants_1.BI_POWS[to.decimals];
86
- return [
87
- {
88
- unit: unitOut,
89
- prices: amounts,
90
- data: {},
91
- poolAddresses: [this.config.WrappedM.address],
92
- exchange: this.dexKey,
93
- gasCost: 70000,
94
- poolIdentifier: this.dexKey,
95
- },
96
- ];
97
- }
98
- // Returns estimated gas cost of calldata for this DEX in multiSwap
99
- getCalldataGasCost(poolPrices) {
100
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
101
- }
102
- // Encode params required by the exchange adapter
103
- // V5: Used for multiSwap, buy & megaSwap
104
- // V6: Not used, can be left blank
105
- // Hint: abiCoder.encodeParameter() could be useful
106
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
107
- const exchange = this.config.WrappedM.address;
108
- const payload = '0x';
109
- return {
110
- targetExchange: exchange,
111
- payload,
112
- networkFee: '0',
113
- };
114
- }
115
- // Returns list of top pools based on liquidity. Max
116
- // limit number pools should be returned.
117
- async getTopPoolsForToken(tokenAddress, limit) {
118
- if (!this.isMOrWrappedM(tokenAddress)) {
119
- return [];
120
- }
121
- const isM = tokenAddress.toLowerCase() === this.config.MToken.address.toLowerCase();
122
- return [
123
- {
124
- exchange: this.dexKey,
125
- address: this.config.WrappedM.address,
126
- connectorTokens: [isM ? this.config.WrappedM : this.config.MToken],
127
- liquidityUSD: 1000000000, // Returning a big number to prefer this DEX
128
- },
129
- ];
130
- }
131
- // Checks if the token addresses is M or WrappedM
132
- isMOrWrappedM(tokenAddress) {
133
- return (tokenAddress.toLowerCase() === this.config.MToken.address.toLowerCase() ||
134
- tokenAddress.toLowerCase() === this.config.WrappedM.address.toLowerCase());
135
- }
136
- // Ensures that the token addresses are correct
137
- ensureOrigin(args) {
138
- const areDifferentAddresses = args?.from?.address?.toLowerCase() !== args?.to?.address?.toLowerCase();
139
- return (areDifferentAddresses &&
140
- this.isMOrWrappedM(args?.from?.address || '') &&
141
- this.isMOrWrappedM(args?.to?.address || ''));
142
- }
143
- }
144
- exports.MToken = MToken;
145
- //# sourceMappingURL=m-token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"m-token.js","sourceRoot":"","sources":["../../../src/dex/m-token/m-token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,2EAA6D;AAI7D,wDAAoD;AACpD,6DAAiD;AAEjD,MAAa,MAAO,SAAQ,gCAAc;IAU7B;IACA;IACA;IACA;IAZF,4BAA4B,GAAG,IAAI,CAAC;IAEpC,cAAc,GAAG,KAAK,CAAC;IAEvB,wBAAwB,GAAG,KAAK,CAAC;IAE1C,MAAM,CAAS;IAEf,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACrB,MAAiB;QAE1B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACrB,WA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M,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE;YACvE,YAAY,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAC1E,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,YAAY,CAAC,IAAyC;QACpD,MAAM,qBAAqB,GACzB,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QAE1E,OAAO,CACL,qBAAqB;YACrB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;YAC7C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,CAC5C,CAAC;IACJ,CAAC;CACF;AApJD,wBAoJC"}
@@ -1,17 +0,0 @@
1
- import { Network, SwapSide } from '../../constants';
2
- import { IDexHelper } from '../../dex-helper/idex-helper';
3
- import { MToken } from './m-token';
4
- import type { Address, DexExchangeParam, NumberAsString } from '../../types';
5
- import { Interface } from '@ethersproject/abi';
6
- export declare class MWrappedM extends MToken {
7
- readonly network: Network;
8
- readonly dexKey: string;
9
- readonly dexHelper: IDexHelper;
10
- static dexKeysWithNetwork: {
11
- key: string;
12
- networks: Network[];
13
- }[];
14
- wrappedMInterface: Interface;
15
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
16
- getDexParam(from: Address, to: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: {}, side: SwapSide): Promise<DexExchangeParam>;
17
- }
@@ -1,50 +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.MWrappedM = void 0;
7
- const utils_1 = require("../../utils");
8
- const m_token_1 = require("./m-token");
9
- const abi_1 = require("@ethersproject/abi");
10
- const WrappedM_abi_json_1 = __importDefault(require("../../abi/m-token/WrappedM.abi.json"));
11
- const config_1 = require("./config");
12
- class MWrappedM extends m_token_1.MToken {
13
- network;
14
- dexKey;
15
- dexHelper;
16
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.Config);
17
- wrappedMInterface;
18
- constructor(network, dexKey, dexHelper) {
19
- const config = config_1.Config[dexKey][network];
20
- super(network, dexKey, dexHelper, config);
21
- this.network = network;
22
- this.dexKey = dexKey;
23
- this.dexHelper = dexHelper;
24
- this.wrappedMInterface = new abi_1.Interface(WrappedM_abi_json_1.default);
25
- }
26
- async getDexParam(from, to, srcAmount, destAmount, recipient, data, side) {
27
- if (!this.ensureOrigin({
28
- from: { address: from },
29
- to: { address: to },
30
- })) {
31
- throw new Error('Unexpected token addresses');
32
- }
33
- const fn = from.toLowerCase() === this.config.MToken.address.toLowerCase()
34
- ? 'wrap(address, uint256)'
35
- : 'unwrap(address, uint256)';
36
- const exchangeData = this.wrappedMInterface.encodeFunctionData(fn, [
37
- recipient,
38
- srcAmount,
39
- ]);
40
- return {
41
- needWrapNative: false,
42
- dexFuncHasRecipient: true,
43
- exchangeData,
44
- targetExchange: this.config.WrappedM.address,
45
- returnAmountPos: undefined,
46
- };
47
- }
48
- }
49
- exports.MWrappedM = MWrappedM;
50
- //# sourceMappingURL=m-wrapped-m.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"m-wrapped-m.js","sourceRoot":"","sources":["../../../src/dex/m-token/m-wrapped-m.ts"],"names":[],"mappings":";;;;;;AACA,uCAAoD;AAEpD,uCAAmC;AAOnC,4CAA+C;AAC/C,4FAAgE;AAChE,qCAAkC;AAElC,MAAa,SAAU,SAAQ,gBAAM;IAOxB;IACA;IACA;IARJ,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,eAAM,CAAC,CAAC;IAEhC,iBAAiB,CAAY;IAE7B,YACW,OAAgB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Params = {
4
- MToken: {
5
- address: Address;
6
- decimals: number;
7
- };
8
- WrappedM: {
9
- address: Address;
10
- decimals: number;
11
- };
12
- };
@@ -1,25 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { SwapSide } from '../constants';
3
- import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { SimpleExchange } from './simple-exchange';
6
- import { IDexHelper } from '../dex-helper';
7
- export declare type OnebitData = {
8
- router: Address;
9
- };
10
- declare type OnebitParam = [
11
- srcToken: string,
12
- destToken: string,
13
- srcAmount: string,
14
- destAmountMin: string,
15
- to: string
16
- ];
17
- export declare class Onebit extends SimpleExchange implements IDexTxBuilder<OnebitData, OnebitParam> {
18
- static dexKeys: string[];
19
- exchangeRouterInterface: Interface;
20
- needWrapNative: boolean;
21
- constructor(dexHelper: IDexHelper);
22
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: OnebitData, side: SwapSide): AdapterExchangeParam;
23
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: OnebitData, side: SwapSide): Promise<SimpleExchangeParam>;
24
- }
25
- export {};
@@ -1,42 +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.Onebit = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const simple_exchange_1 = require("./simple-exchange");
9
- const Onebit_json_1 = __importDefault(require("../abi/Onebit.json"));
10
- var OnebitFunctions;
11
- (function (OnebitFunctions) {
12
- OnebitFunctions["swapTokensWithTrust"] = "swapTokensWithTrust";
13
- })(OnebitFunctions || (OnebitFunctions = {}));
14
- class Onebit extends simple_exchange_1.SimpleExchange {
15
- constructor(dexHelper) {
16
- super(dexHelper, 'omm1');
17
- this.needWrapNative = true;
18
- this.exchangeRouterInterface = new abi_1.Interface(Onebit_json_1.default);
19
- }
20
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
21
- return {
22
- targetExchange: data.router,
23
- payload: '0x',
24
- networkFee: '0',
25
- };
26
- }
27
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
28
- const swapFunction = OnebitFunctions.swapTokensWithTrust;
29
- const swapFunctionParams = [
30
- srcToken,
31
- destToken,
32
- srcAmount,
33
- destAmount,
34
- this.augustusAddress,
35
- ];
36
- const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
37
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.router);
38
- }
39
- }
40
- exports.Onebit = Onebit;
41
- Onebit.dexKeys = ['omm1'];
42
- //# sourceMappingURL=onebit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onebit.js","sourceRoot":"","sources":["../../src/dex/onebit.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAK7D,uDAAmD;AACnD,qEAA2C;AAc3C,IAAK,eAEJ;AAFD,WAAK,eAAe;IAClB,8DAA2C,CAAA;AAC7C,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,MAAa,MACX,SAAQ,gCAAc;IAOtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAH3B,mBAAc,GAAG,IAAI,CAAC;QAIpB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAAC,qBAA2B,CAAC,CAAC;IAC5E,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,MAAM;YAC3B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,MAAM,YAAY,GAAG,eAAe,CAAC,mBAAmB,CAAC;QACzD,MAAM,kBAAkB,GAAgB;YACtC,QAAQ;YACR,SAAS;YACT,SAAS;YACT,UAAU;YACV,IAAI,CAAC,eAAe;SACrB,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;;AAzDH,wBA0DC;AAtDQ,cAAO,GAAG,CAAC,MAAM,CAAC,CAAC"}
@@ -1,26 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { SwapSide } from '../constants';
3
- import { AdapterExchangeParam, NumberAsString, SimpleExchangeParam } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { SimpleExchange } from './simple-exchange';
6
- import { IDexHelper } from '../dex-helper';
7
- declare type SmoothyData = {
8
- exchange: string;
9
- i: string;
10
- j: string;
11
- };
12
- declare type SmoothyParam = [
13
- bTokenIdxIn: NumberAsString,
14
- bTokenIdxOut: NumberAsString,
15
- bTokenInAmount: NumberAsString,
16
- bTokenOutMin: NumberAsString
17
- ];
18
- export declare class Smoothy extends SimpleExchange implements IDexTxBuilder<SmoothyData, SmoothyParam> {
19
- static dexKeys: string[];
20
- exchangeRouterInterface: Interface;
21
- minConversionRate: string;
22
- constructor(dexHelper: IDexHelper);
23
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: SmoothyData, side: SwapSide): AdapterExchangeParam;
24
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: SmoothyData, side: SwapSide): Promise<SimpleExchangeParam>;
25
- }
26
- export {};
@@ -1,48 +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.Smoothy = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const constants_1 = require("../constants");
9
- const simple_exchange_1 = require("./simple-exchange");
10
- const Smoothy_json_1 = __importDefault(require("../abi/Smoothy.json"));
11
- var SmoothyFunctions;
12
- (function (SmoothyFunctions) {
13
- SmoothyFunctions["swap"] = "swap";
14
- })(SmoothyFunctions || (SmoothyFunctions = {}));
15
- class Smoothy extends simple_exchange_1.SimpleExchange {
16
- constructor(dexHelper) {
17
- super(dexHelper, 'smoothy');
18
- this.minConversionRate = '1';
19
- this.exchangeRouterInterface = new abi_1.Interface(Smoothy_json_1.default);
20
- }
21
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
22
- if (side === constants_1.SwapSide.BUY)
23
- throw new Error(`Buy not supported`);
24
- const { i, j } = data;
25
- const payload = this.abiCoder.encodeParameter({
26
- ParentStruct: {
27
- i: 'int128',
28
- j: 'int128',
29
- },
30
- }, { i, j });
31
- return {
32
- targetExchange: data.exchange,
33
- payload,
34
- networkFee: '0',
35
- };
36
- }
37
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
38
- if (side === constants_1.SwapSide.BUY)
39
- throw new Error(`Buy not supported`);
40
- const { exchange, i, j } = data;
41
- const swapFunctionParams = [i, j, srcAmount, destAmount];
42
- const swapData = this.exchangeRouterInterface.encodeFunctionData(SmoothyFunctions.swap, swapFunctionParams);
43
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, exchange);
44
- }
45
- }
46
- exports.Smoothy = Smoothy;
47
- Smoothy.dexKeys = ['smoothy'];
48
- //# sourceMappingURL=smoothy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smoothy.js","sourceRoot":"","sources":["../../src/dex/smoothy.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;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