@paraswap/dex-lib 4.1.16 → 4.1.17-arena

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 (304) hide show
  1. package/.eslintrc.js +8 -0
  2. package/build/abi/Aave_GSM.json +751 -0
  3. package/build/abi/Balancer.json +257 -0
  4. package/build/abi/BalancerV2.json +1179 -0
  5. package/build/abi/RamsesV2Pool.abi.json +1554 -0
  6. package/build/abi/RamsesV2Quoter.abi.json +274 -0
  7. package/build/abi/USDM.json +807 -0
  8. package/build/abi/UniswapV2Router.json +397 -0
  9. package/build/abi/{wombat/pool.json → angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json} +594 -637
  10. package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
  11. package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
  12. package/build/abi/curve-v1/CurveTokenV1.json +305 -0
  13. package/build/abi/curve-v1/CurveTokenV2.json +318 -0
  14. package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
  15. package/build/abi/curve-v1/CurveV2Swap.json +700 -0
  16. package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
  17. package/build/abi/curve-v1/FactoryRegistry.json +508 -0
  18. package/build/abi/curve-v1/StableSwapAave.json +1152 -0
  19. package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
  20. package/build/abi/curve-v1/StableSwapCompound.json +814 -0
  21. package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
  22. package/build/abi/curve-v1/StableSwapPax.json +865 -0
  23. package/build/abi/curve-v1/StableSwapSnow.json +900 -0
  24. package/build/abi/curve-v1/StableSwapUSDN.json +1004 -0
  25. package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
  26. package/build/abi/curve-v1/StableSwapY.json +814 -0
  27. package/build/abi/inception/inception-ineth.json +609 -0
  28. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  29. package/build/abi/kyberdmm.abi.json +1148 -0
  30. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  31. package/build/abi/nerve/nerve-metapool.json +790 -0
  32. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  33. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  34. package/build/dex/aave-v1/aave-v1.js +0 -1
  35. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  36. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  37. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  38. package/build/dex/bebop/websocket-fetcher.js +87 -0
  39. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  40. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  41. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  42. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  43. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  44. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  45. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  46. package/build/dex/idle-dao/scripts.d.ts +9 -0
  47. package/build/dex/idle-dao/scripts.js +552 -0
  48. package/build/dex/idle-dao/scripts.js.map +1 -0
  49. package/build/dex/inception/inception-event-pool.d.ts +4 -4
  50. package/build/dex/inception/inception-event-pool.js +9 -7
  51. package/build/dex/inception/inception-event-pool.js.map +1 -1
  52. package/build/dex/inception/inception-native.d.ts +43 -0
  53. package/build/dex/inception/inception-native.js +131 -0
  54. package/build/dex/inception/inception-native.js.map +1 -0
  55. package/build/dex/inception/inception-pool.d.ts +18 -0
  56. package/build/dex/inception/inception-pool.js +32 -0
  57. package/build/dex/inception/inception-pool.js.map +1 -0
  58. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  59. package/build/dex/inception/inception-price-feed.js +51 -0
  60. package/build/dex/inception/inception-price-feed.js.map +1 -0
  61. package/build/dex/inception/inception.d.ts +6 -6
  62. package/build/dex/inception/inception.js +40 -16
  63. package/build/dex/inception/inception.js.map +1 -1
  64. package/build/dex/inception/utils.d.ts +0 -1
  65. package/build/dex/inception/utils.js +1 -22
  66. package/build/dex/inception/utils.js.map +1 -1
  67. package/build/dex/platypus/platypus.js +3 -17
  68. package/build/dex/platypus/platypus.js.map +1 -1
  69. package/build/dex/swaap-v1/swaap-v1.js +0 -4
  70. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  71. package/build/dex/uniswap-v2/config.js +8 -0
  72. package/build/dex/uniswap-v2/config.js.map +1 -1
  73. package/build/dex/uniswap-v3/config.js +2 -1
  74. package/build/dex/uniswap-v3/config.js.map +1 -1
  75. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  76. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  77. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  78. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  79. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  80. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  81. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  82. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  83. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  84. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  85. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  86. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  87. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  88. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  89. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  90. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  91. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  92. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  93. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  94. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  95. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  96. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  97. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  98. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  99. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  100. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  101. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  102. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  103. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  104. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  105. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  106. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  107. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  108. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  109. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  110. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  111. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  112. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  113. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  114. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  115. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  116. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  117. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  118. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  119. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  120. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  121. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  122. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  123. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  124. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  125. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  126. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  127. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  128. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  129. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  130. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  131. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  132. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  133. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  134. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  135. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  136. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  137. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  138. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  139. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  140. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  141. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  142. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  143. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  144. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  145. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  146. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  147. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  148. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  149. package/package.json +1 -1
  150. package/src/dex/generic-rfq/example-api.test.ts +12 -1
  151. package/src/dex/generic-rfq/generic-rfq-e2e.test.ts +5 -47
  152. package/src/dex/generic-rfq/generic-rfq-local-e2e.test.ts +8 -22
  153. package/src/dex/uniswap-v2/config.ts +9 -0
  154. package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +105 -1
  155. package/src/dex/uniswap-v3/config.ts +2 -1
  156. package/tests/constants-e2e.ts +7 -53
  157. package/tests/{tenderly-simulation-new.test.ts → tenderly-simulation.test.ts} +2 -2
  158. package/tests/tenderly-simulation.ts +650 -241
  159. package/tests/token-storage-slots.json +166 -0
  160. package/tests/utils-e2e.ts +198 -712
  161. package/tests/v6/utils-e2e-v6.ts +60 -134
  162. package/.vscode/launch.json +0 -53
  163. package/.vscode/settings.json +0 -2
  164. package/.vscode/tasks.json +0 -15
  165. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
  166. package/build/abi/uniswap-v4/quoter.abi.json +0 -461
  167. package/build/abi/uniswap-v4/router.abi.json +0 -230
  168. package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
  169. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  170. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  171. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  172. package/build/dex/bProtocol.d.ts +0 -18
  173. package/build/dex/bProtocol.js +0 -39
  174. package/build/dex/bProtocol.js.map +0 -1
  175. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
  176. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
  177. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
  178. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
  179. package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
  180. package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
  181. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
  182. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
  183. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
  184. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
  185. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
  186. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
  187. package/build/dex/bancor.d.ts +0 -26
  188. package/build/dex/bancor.js +0 -58
  189. package/build/dex/bancor.js.map +0 -1
  190. package/build/dex/compound.d.ts +0 -18
  191. package/build/dex/compound.js +0 -46
  192. package/build/dex/compound.js.map +0 -1
  193. package/build/dex/curve-v2.d.ts +0 -58
  194. package/build/dex/curve-v2.js +0 -180
  195. package/build/dex/curve-v2.js.map +0 -1
  196. package/build/dex/dodo-v1.d.ts +0 -33
  197. package/build/dex/dodo-v1.js +0 -63
  198. package/build/dex/dodo-v1.js.map +0 -1
  199. package/build/dex/erc4626/scripts/validate-state.d.ts +0 -0
  200. package/build/dex/erc4626/scripts/validate-state.js +0 -146
  201. package/build/dex/erc4626/scripts/validate-state.js.map +0 -1
  202. package/build/dex/lido.d.ts +0 -19
  203. package/build/dex/lido.js +0 -42
  204. package/build/dex/lido.js.map +0 -1
  205. package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
  206. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  207. package/build/dex/maker-psm/scripts/validate-state.js +0 -185
  208. package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
  209. package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
  210. package/build/dex/onebit.d.ts +0 -25
  211. package/build/dex/onebit.js +0 -42
  212. package/build/dex/onebit.js.map +0 -1
  213. package/build/dex/smoothy.d.ts +0 -26
  214. package/build/dex/smoothy.js +0 -48
  215. package/build/dex/smoothy.js.map +0 -1
  216. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
  217. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
  218. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
  219. package/build/dex/stable-pool.d.ts +0 -28
  220. package/build/dex/stable-pool.js +0 -55
  221. package/build/dex/stable-pool.js.map +0 -1
  222. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  223. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  224. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  225. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  226. package/build/dex/trader-joe-v2.1.js +0 -79
  227. package/build/dex/trader-joe-v2.1.js.map +0 -1
  228. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
  229. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
  230. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
  231. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
  232. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
  233. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
  234. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
  235. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
  236. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
  237. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
  238. package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
  239. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
  240. package/build/dex/uniswap-v4/config.d.ts +0 -3
  241. package/build/dex/uniswap-v4/config.js +0 -15
  242. package/build/dex/uniswap-v4/config.js.map +0 -1
  243. package/build/dex/uniswap-v4/encoder.d.ts +0 -16
  244. package/build/dex/uniswap-v4/encoder.js +0 -94
  245. package/build/dex/uniswap-v4/encoder.js.map +0 -1
  246. package/build/dex/uniswap-v4/types.d.ts +0 -30
  247. package/build/dex/uniswap-v4/types.js +0 -3
  248. package/build/dex/uniswap-v4/types.js.map +0 -1
  249. package/build/dex/uniswap-v4/uniswap-v4.d.ts +0 -38
  250. package/build/dex/uniswap-v4/uniswap-v4.js +0 -187
  251. package/build/dex/uniswap-v4/uniswap-v4.js.map +0 -1
  252. package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
  253. package/build/dex/usual/usual-m-smart-m.js +0 -50
  254. package/build/dex/usual/usual-m-smart-m.js.map +0 -1
  255. package/build/dex/usual-m-smart-m/config.d.ts +0 -3
  256. package/build/dex/usual-m-smart-m/config.js +0 -13
  257. package/build/dex/usual-m-smart-m/config.js.map +0 -1
  258. package/build/dex/usual-m-smart-m/types.d.ts +0 -7
  259. package/build/dex/usual-m-smart-m/types.js +0 -3
  260. package/build/dex/usual-m-smart-m/types.js.map +0 -1
  261. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
  262. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
  263. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
  264. package/build/dex/usual-m-usd0/config.d.ts +0 -3
  265. package/build/dex/usual-m-usd0/config.js +0 -14
  266. package/build/dex/usual-m-usd0/config.js.map +0 -1
  267. package/build/dex/usual-m-usd0/types.d.ts +0 -8
  268. package/build/dex/usual-m-usd0/types.js +0 -3
  269. package/build/dex/usual-m-usd0/types.js.map +0 -1
  270. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
  271. package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
  272. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
  273. package/tests/augustus-approvals.test.ts +0 -628
  274. package/tests/smart-tokens.ts +0 -112
  275. package/tests/tenderly-simulation-new.ts +0 -698
  276. package/tests/v6/executors.test.ts +0 -110
  277. package/tests/v6/price-routes/arbitrum/sell-0.1-ETH-USDC.json +0 -104
  278. package/tests/v6/price-routes/arbitrum/sell-1_000-ETH-DAI.json +0 -294
  279. package/tests/v6/price-routes/arbitrum/sell-1_000-WETH-wstETH.json +0 -121
  280. package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-DAI.json +0 -270
  281. package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-ETH.json +0 -326
  282. package/tests/v6/price-routes/arbitrum/sell-1_000_000-DAI-ARB.json +0 -434
  283. package/tests/v6/price-routes/arbitrum/sell-250_000-LINK-USDC.json +0 -182
  284. package/tests/v6/price-routes/arbitrum/sell-3_000-BAL-UNI.json +0 -154
  285. package/tests/v6/price-routes/avalanche/sell-100_000-WAVAX-USDC.json +0 -315
  286. package/tests/v6/price-routes/avalanche/sell-40-BTC-AVAX.json +0 -207
  287. package/tests/v6/price-routes/mainnet/buy-3200-ETH-DAI.json +0 -228
  288. package/tests/v6/price-routes/mainnet/sell-1-USDC-USDT.json +0 -78
  289. package/tests/v6/price-routes/mainnet/sell-1-WBTC-BAL.json +0 -158
  290. package/tests/v6/price-routes/mainnet/sell-100-tBTC-WBTC.json +0 -100
  291. package/tests/v6/price-routes/mainnet/sell-1000-eth-dai.json +0 -340
  292. package/tests/v6/price-routes/mainnet/sell-1000-wbtc-eth-uniswapv3-balancerv2.json +0 -162
  293. package/tests/v6/price-routes/mainnet/sell-100_000-USDC-USDT-2-univ2-pools.json +0 -86
  294. package/tests/v6/price-routes/mainnet/sell-10_000-ETH-USDC-balancer.json +0 -383
  295. package/tests/v6/price-routes/mainnet/sell-10_000-ETH-stETH.json +0 -168
  296. package/tests/v6/price-routes/mainnet/sell-10_000-USDC-USDT-BalancerV2.json +0 -68
  297. package/tests/v6/price-routes/mainnet/sell-10_000-eth-usdc-uniswapv3-balancerv2.json +0 -348
  298. package/tests/v6/price-routes/mainnet/sell-1_000-stETH-ETH.json +0 -100
  299. package/tests/v6/price-routes/mainnet/sell-50-eth-usdc.json +0 -153
  300. package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC-1.json +0 -571
  301. package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC.json +0 -559
  302. package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-2.json +0 -447
  303. package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-3.json +0 -472
  304. package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC.json +0 -628
@@ -1,3 +0,0 @@
1
- import { DexConfigMap } from '../../types';
2
- import { DexParams } from './types';
3
- export declare const UniswapV4Config: DexConfigMap<DexParams>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UniswapV4Config = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.UniswapV4Config = {
6
- UniswapV4: {
7
- [constants_1.Network.BASE]: {
8
- poolManager: '0x498581ff718922c3f8e6a244956af099b2652b2b',
9
- subgraphURL: 'HNCFA9TyBqpo5qpe6QreQABAA1kV8g46mhkCcicu6v2R',
10
- quoter: '0x0d5e0f971ed27fbff6c2837bf31316121532048d',
11
- router: '0x6ff5693b99212da76ad316178a184ab56d299b43',
12
- },
13
- },
14
- };
15
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/config.ts"],"names":[],"mappings":";;;AACA,+CAA0C;AAG7B,QAAA,eAAe,GAA4B;IACtD,SAAS,EAAE;QACT,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,WAAW,EAAE,4CAA4C;YACzD,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;SACrD;KACF;CACF,CAAC"}
@@ -1,16 +0,0 @@
1
- import { PoolKey } from './types';
2
- import { Address } from '../../types';
3
- export declare enum Actions {
4
- SWAP_EXACT_IN_SINGLE = 6,// 0x06 -> 6
5
- SWAP_EXACT_IN = 7,// 0x07 -> 7
6
- SWAP_EXACT_OUT_SINGLE = 8,// 0x08 -> 8
7
- SWAP_EXACT_OUT = 9,// 0x09 -> 9
8
- SETTLE = 11,// 0x0b -> 11
9
- SETTLE_ALL = 12,// 0x0c -> 12
10
- SETTLE_PAIR = 13,// 0x0d -> 13
11
- TAKE = 14,// 0x0e -> 14
12
- TAKE_ALL = 15,// 0x0f -> 15
13
- TAKE_PORTION = 16,// 0x10 -> 16
14
- TAKE_PAIR = 17
15
- }
16
- export declare function swapExactInputSingleCalldata(srcToken: Address, destToken: Address, poolKey: PoolKey, zeroForOne: boolean, amountIn: bigint, amountOutMinimum: bigint, recipient: Address): string;
@@ -1,94 +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.Actions = void 0;
7
- exports.swapExactInputSingleCalldata = swapExactInputSingleCalldata;
8
- const ethers_1 = require("ethers");
9
- const router_abi_json_1 = __importDefault(require("../../abi/uniswap-v4/router.abi.json"));
10
- const abi_1 = require("@ethersproject/abi");
11
- const routerIface = new abi_1.Interface(router_abi_json_1.default);
12
- var Commands;
13
- (function (Commands) {
14
- Commands[Commands["V4_SWAP"] = 16] = "V4_SWAP";
15
- })(Commands || (Commands = {}));
16
- var Actions;
17
- (function (Actions) {
18
- // Swapping
19
- Actions[Actions["SWAP_EXACT_IN_SINGLE"] = 6] = "SWAP_EXACT_IN_SINGLE";
20
- Actions[Actions["SWAP_EXACT_IN"] = 7] = "SWAP_EXACT_IN";
21
- Actions[Actions["SWAP_EXACT_OUT_SINGLE"] = 8] = "SWAP_EXACT_OUT_SINGLE";
22
- Actions[Actions["SWAP_EXACT_OUT"] = 9] = "SWAP_EXACT_OUT";
23
- // Settling (paying funds)
24
- Actions[Actions["SETTLE"] = 11] = "SETTLE";
25
- Actions[Actions["SETTLE_ALL"] = 12] = "SETTLE_ALL";
26
- Actions[Actions["SETTLE_PAIR"] = 13] = "SETTLE_PAIR";
27
- // Taking (receiving funds)
28
- Actions[Actions["TAKE"] = 14] = "TAKE";
29
- Actions[Actions["TAKE_ALL"] = 15] = "TAKE_ALL";
30
- Actions[Actions["TAKE_PORTION"] = 16] = "TAKE_PORTION";
31
- Actions[Actions["TAKE_PAIR"] = 17] = "TAKE_PAIR";
32
- })(Actions || (exports.Actions = Actions = {}));
33
- var ActionConstants;
34
- (function (ActionConstants) {
35
- ActionConstants[ActionConstants["OPEN_DELTA"] = 0] = "OPEN_DELTA";
36
- // This value is equivalent to 1<<255, i.e. a singular 1 in the most significant bit.
37
- ActionConstants["CONTRACT_BALANCE"] = "57896044618658097711785492504343953926634992332820282019728792003956564819968";
38
- // address(1)
39
- ActionConstants["MSG_SENDER"] = "0x0000000000000000000000000000000000000001";
40
- // address(2)
41
- ActionConstants["ADDRESS_THIS"] = "0x0000000000000000000000000000000000000002";
42
- })(ActionConstants || (ActionConstants = {}));
43
- function swapExactInputSingleCalldata(srcToken, destToken, poolKey, zeroForOne, amountIn, amountOutMinimum, recipient) {
44
- const command = ethers_1.ethers.utils.solidityPack(['uint8'], [Commands.V4_SWAP]);
45
- const actions = ethers_1.ethers.utils.solidityPack(['uint8', 'uint8', 'uint8'], [Actions.SWAP_EXACT_IN_SINGLE, Actions.SETTLE, Actions.TAKE]);
46
- const exactInputSingleParams = {
47
- poolKey,
48
- zeroForOne,
49
- amountIn,
50
- amountOutMinimum,
51
- hookData: '0x', // empty bytes
52
- };
53
- // encode SWAP_EXACT_IN_SINGLE
54
- const swap = ethers_1.ethers.utils.defaultAbiCoder.encode([
55
- /*
56
- ExactInputSingleParams {
57
- PoolKey poolKey;
58
- bool zeroForOne;
59
- uint128 amountIn;
60
- uint128 amountOutMinimum;
61
- bytes hookData;
62
- }
63
- */
64
- 'tuple((address,address,uint24,int24,address) poolKey, bool zeroForOne, uint128 amountIn, uint128 amountOutMinimum, bytes hookData)',
65
- ], [
66
- [
67
- [
68
- poolKey.currency0,
69
- poolKey.currency1,
70
- poolKey.fee,
71
- poolKey.tickSpacing,
72
- poolKey.hooks,
73
- ],
74
- exactInputSingleParams.zeroForOne,
75
- exactInputSingleParams.amountIn,
76
- exactInputSingleParams.amountOutMinimum,
77
- exactInputSingleParams.hookData,
78
- ],
79
- ]);
80
- // encode SETTLE
81
- const settle = ethers_1.ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bool'],
82
- // srcToken, amountIn (`OPEN_DELTA` to settle all needed funds), takeFundsFromMsgSender (Executor in our case)
83
- [srcToken, ActionConstants.OPEN_DELTA, true]);
84
- // encode TAKE
85
- const take = ethers_1.ethers.utils.defaultAbiCoder.encode(['address', 'address', 'uint256'],
86
- // destToken, recipient, amountOut (`OPEN_DELTA` to take all funds)
87
- [destToken, recipient, ActionConstants.OPEN_DELTA]);
88
- const input = ethers_1.ethers.utils.defaultAbiCoder.encode(['bytes', 'bytes[]'], [actions, [swap, settle, take]]);
89
- return routerIface.encodeFunctionData('execute(bytes,bytes[])', [
90
- command,
91
- [input],
92
- ]);
93
- }
94
- //# sourceMappingURL=encoder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/encoder.ts"],"names":[],"mappings":";;;;;;AAiDA,oEA8EC;AA/HD,mCAAgC;AAGhC,2FAA6D;AAC7D,4CAA+C;AAE/C,MAAM,WAAW,GAAG,IAAI,eAAS,CAAC,yBAAS,CAAC,CAAC;AAE7C,IAAK,QAEJ;AAFD,WAAK,QAAQ;IACX,8CAAY,CAAA;AACd,CAAC,EAFI,QAAQ,KAAR,QAAQ,QAEZ;AAED,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB,WAAW;IACX,qEAAwB,CAAA;IACxB,uDAAiB,CAAA;IACjB,uEAAyB,CAAA;IACzB,yDAAkB,CAAA;IAElB,0BAA0B;IAC1B,0CAAW,CAAA;IACX,kDAAe,CAAA;IACf,oDAAgB,CAAA;IAEhB,2BAA2B;IAC3B,sCAAS,CAAA;IACT,8CAAa,CAAA;IACb,sDAAiB,CAAA;IACjB,gDAAc,CAAA;AAChB,CAAC,EAjBW,OAAO,uBAAP,OAAO,QAiBlB;AAED,IAAK,eAQJ;AARD,WAAK,eAAe;IAClB,iEAAc,CAAA;IACd,qFAAqF;IACrF,qHAAkG,CAAA;IAClG,aAAa;IACb,4EAAyD,CAAA;IACzD,aAAa;IACb,8EAA2D,CAAA;AAC7D,CAAC,EARI,eAAe,KAAf,eAAe,QAQnB;AAUD,SAAgB,4BAA4B,CAC1C,QAAiB,EACjB,SAAkB,EAClB,OAAgB,EAChB,UAAmB,EACnB,QAAgB,EAChB,gBAAwB,EACxB,SAAkB;IAElB,MAAM,OAAO,GAAG,eAAM,CAAC,KAAK,CAAC,YAAY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nD,CAAC;IAEF,MAAM,KAAK,GAAG,eAAM,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAC/C,CAAC,OAAO,EAAE,SAAS,CAAC,EACpB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAChC,CAAC;IAEF,OAAO,WAAW,CAAC,kBAAkB,CAAC,wBAAwB,EAAE;QAC9D,OAAO;QACP,CAAC,KAAK,CAAC;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,30 +0,0 @@
1
- import { Address } from '../../types';
2
- export type PoolState = {
3
- id: string;
4
- token0: Address;
5
- token1: Address;
6
- tickSpacing: number;
7
- tick: number;
8
- };
9
- export type UniswapV4Data = {
10
- exchange: Address;
11
- zeroForOne: boolean;
12
- pool: Pool;
13
- };
14
- export type Pool = {
15
- id: string;
16
- key: PoolKey;
17
- };
18
- export type DexParams = {
19
- poolManager: Address;
20
- quoter: Address;
21
- router: Address;
22
- subgraphURL: string;
23
- };
24
- export type PoolKey = {
25
- currency0: Address;
26
- currency1: Address;
27
- fee: string;
28
- tickSpacing: string;
29
- hooks: Address;
30
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/types.ts"],"names":[],"mappings":""}
@@ -1,38 +0,0 @@
1
- import { AdapterExchangeParam, Address, DexExchangeParam, NumberAsString, Token } from '../../types';
2
- import { Logger } from 'log4js';
3
- import { Network, SwapSide } from '../../constants';
4
- import { IDexHelper } from '../../dex-helper';
5
- import { ExchangePrices, PoolPrices, PoolLiquidity } from '../../types';
6
- import { IDex } from '../idex';
7
- import { SimpleExchange } from '../simple-exchange';
8
- import { Pool, UniswapV4Data } from './types';
9
- import { Interface } from '@ethersproject/abi';
10
- export declare class UniswapV4 extends SimpleExchange implements IDex<UniswapV4Data> {
11
- protected network: Network;
12
- protected dexHelper: IDexHelper;
13
- protected router: string;
14
- protected quoter: string;
15
- protected poolManager: string;
16
- protected subgraph: string;
17
- readonly hasConstantPriceLargeAmounts = false;
18
- needWrapNative: boolean;
19
- logger: Logger;
20
- protected quoterIface: Interface;
21
- static dexKeysWithNetwork: {
22
- key: string;
23
- networks: Network[];
24
- }[];
25
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, router?: string, quoter?: string, poolManager?: string, subgraph?: string);
26
- getPoolIdentifiers(from: Token, to: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
27
- getPricesVolume(from: Token, to: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<ExchangePrices<UniswapV4Data> | null>;
28
- getCalldataGasCost(poolPrices: PoolPrices<UniswapV4Data>): number | number[];
29
- getAdapters(side: SwapSide): {
30
- name: string;
31
- index: number;
32
- }[] | null;
33
- getTopPoolsForToken(tokenAddress: Address, count: number): Promise<PoolLiquidity[]>;
34
- getAvailablePools(srcToken: Address, destToken: Address): Promise<Pool[]>;
35
- queryPrice(zeroForOne: boolean, amounts: bigint[], pool: Pool): Promise<bigint[]>;
36
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UniswapV4Data, side: SwapSide): DexExchangeParam;
37
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV4Data, side: SwapSide): AdapterExchangeParam;
38
- }
@@ -1,187 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.UniswapV4 = void 0;
40
- const constants_1 = require("../../constants");
41
- const utils_1 = require("../../utils");
42
- const simple_exchange_1 = require("../simple-exchange");
43
- const config_1 = require("./config");
44
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
45
- const quoter_abi_json_1 = __importDefault(require("../../abi/uniswap-v4/quoter.abi.json"));
46
- const bigint_constants_1 = require("../../bigint-constants");
47
- const abi_1 = require("@ethersproject/abi");
48
- const decoders_1 = require("../../lib/decoders");
49
- const encoder_1 = require("./encoder");
50
- class UniswapV4 extends simple_exchange_1.SimpleExchange {
51
- network;
52
- dexHelper;
53
- router;
54
- quoter;
55
- poolManager;
56
- subgraph;
57
- hasConstantPriceLargeAmounts = false;
58
- needWrapNative = false;
59
- logger;
60
- quoterIface;
61
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.UniswapV4Config);
62
- constructor(network, dexKey, dexHelper, router = config_1.UniswapV4Config[dexKey][network].router, quoter = config_1.UniswapV4Config[dexKey][network].quoter, poolManager = config_1.UniswapV4Config[dexKey][network].poolManager, subgraph = config_1.UniswapV4Config[dexKey][network].subgraphURL) {
63
- super(dexHelper, dexKey);
64
- this.network = network;
65
- this.dexHelper = dexHelper;
66
- this.router = router;
67
- this.quoter = quoter;
68
- this.poolManager = poolManager;
69
- this.subgraph = subgraph;
70
- this.logger = dexHelper.getLogger(dexKey);
71
- this.quoterIface = new abi_1.Interface(quoter_abi_json_1.default);
72
- }
73
- async getPoolIdentifiers(from, to, side, blockNumber) {
74
- const pools = await this.getAvailablePools(from.address.toLowerCase(), to.address.toLowerCase());
75
- return pools.map(pool => pool.id);
76
- }
77
- async getPricesVolume(from, to, amounts, side, blockNumber, limitPools) {
78
- if (side === constants_1.SwapSide.BUY)
79
- return null;
80
- const pools = await this.getAvailablePools(from.address.toLowerCase(), to.address.toLowerCase());
81
- const availablePools = limitPools?.filter(t => pools.find(p => p.id === t)) ??
82
- pools.map(t => t.id);
83
- const pricesPromises = availablePools.map(async (poolId) => {
84
- const pool = pools.find(p => p.id === poolId);
85
- const zeroForOne = from.address.toLowerCase() === pool.key.currency0.toLowerCase();
86
- const prices = await this.queryPrice(zeroForOne, amounts, pool);
87
- return {
88
- unit: bigint_constants_1.BI_POWS[to.decimals],
89
- prices,
90
- data: {
91
- exchange: this.dexKey,
92
- pool,
93
- zeroForOne,
94
- },
95
- poolAddresses: [this.poolManager],
96
- exchange: this.dexKey,
97
- gasCost: 100_000,
98
- poolIdentifier: poolId,
99
- };
100
- });
101
- const prices = await Promise.all(pricesPromises);
102
- return prices;
103
- }
104
- // Returns estimated gas cost of calldata for this DEX in multiSwap
105
- getCalldataGasCost(poolPrices) {
106
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
107
- }
108
- getAdapters(side) {
109
- return null;
110
- }
111
- async getTopPoolsForToken(tokenAddress, count) {
112
- return [];
113
- }
114
- async getAvailablePools(srcToken, destToken) {
115
- // fetch only pools with positive volumeUSD
116
- const availablePoolsQuery = `query ($token0: Bytes!, $token1: Bytes!, $hooks: Bytes!) {
117
- pools (where :{token0: $token0, token1: $token1, hooks: $hooks, volumeUSD_gt: 0}, orderBy: volumeUSD, orderDirection: desc) {
118
- id
119
- fee: feeTier
120
- tickSpacing
121
- hooks
122
- }
123
- }`;
124
- const [token0, token1] = parseInt(srcToken, 16) < parseInt(destToken, 16)
125
- ? [srcToken, destToken]
126
- : [destToken, srcToken];
127
- const { data } = await this.dexHelper.httpRequest.querySubgraph(this.subgraph,
128
- // at the moment, support only pools with no hooks
129
- {
130
- query: availablePoolsQuery,
131
- variables: { token0, token1, hooks: constants_1.NULL_ADDRESS },
132
- }, { timeout: constants_1.SUBGRAPH_TIMEOUT });
133
- return data.pools.map(pool => ({
134
- id: pool.id,
135
- key: {
136
- currency0: token0,
137
- currency1: token1,
138
- fee: pool.fee,
139
- tickSpacing: pool.tickSpacing,
140
- hooks: pool.hooks,
141
- },
142
- }));
143
- }
144
- async queryPrice(zeroForOne, amounts, pool) {
145
- const calls = amounts.map(amount => ({
146
- target: this.quoter,
147
- callData: this.quoterIface.encodeFunctionData('quoteExactInputSingle', [
148
- {
149
- poolKey: pool.key,
150
- zeroForOne,
151
- exactAmount: amount.toString(),
152
- hookData: '0x',
153
- },
154
- ]),
155
- decodeFunction: (result) => {
156
- // amountOut, gasEstimate
157
- return (0, decoders_1.generalDecoder)(result, ['uint256', 'uint256'], 0n, value => BigInt(value[0].toString()));
158
- },
159
- }));
160
- const results = await this.dexHelper.multiWrapper.tryAggregate(false, calls);
161
- return results.map(result => (result.success ? result.returnData : 0n));
162
- }
163
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
164
- const exchangeData = (0, encoder_1.swapExactInputSingleCalldata)(srcToken, destToken, data.pool.key, data.zeroForOne, BigInt(srcAmount),
165
- // destMinAmount (can be 0 on dex level)
166
- BigInt(0), recipient);
167
- return {
168
- needWrapNative: this.needWrapNative,
169
- dexFuncHasRecipient: true,
170
- exchangeData,
171
- targetExchange: this.router,
172
- permit2Approval: true,
173
- returnAmountPos: undefined,
174
- };
175
- }
176
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
177
- const { exchange } = data;
178
- const payload = '';
179
- return {
180
- targetExchange: exchange,
181
- payload,
182
- networkFee: '0',
183
- };
184
- }
185
- }
186
- exports.UniswapV4 = UniswapV4;
187
- //# sourceMappingURL=uniswap-v4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uniswap-v4.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/uniswap-v4.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,+CAMyB;AAGzB,uCAAoD;AAEpD,wDAAoD;AACpD,qCAA2C;AAG3C,2EAA6D;AAC7D,2FAA6D;AAC7D,6DAAiD;AACjD,4CAAgE;AAChE,iDAI4B;AAM5B,uCAAyD;AAEzD,MAAa,SAAU,SAAQ,gCAAc;IAW/B;IAEA;IACA;IACA;IACA;IACA;IAhBH,4BAA4B,GAAG,KAAK,CAAC;IAC9C,cAAc,GAAG,KAAK,CAAC;IAEvB,MAAM,CAAS;IACL,WAAW,CAAY;IAE1B,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,wBAAe,CAAC,CAAC;IAEzC,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB,EACrB,SAAS,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAChD,SAAS,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAChD,cAAc,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,EAC1D,WAAW,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW;QAEjE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QARf,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;QACrB,WAAM,G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UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;;AApOH,8BAqOC"}
@@ -1,17 +0,0 @@
1
- import { Address, NumberAsString, DexExchangeParam } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDexHelper } from '../../dex-helper/idex-helper';
4
- import { Interface } from '@ethersproject/abi';
5
- import { Usual } from './usual';
6
- export declare class UsualMSmartM extends Usual {
7
- readonly network: Network;
8
- readonly dexKey: string;
9
- readonly dexHelper: IDexHelper;
10
- static dexKeysWithNetwork: {
11
- key: string;
12
- networks: Network[];
13
- }[];
14
- usualMIface: Interface;
15
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
16
- getDexParam(srcToken: Address, destToken: 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.UsualMSmartM = void 0;
7
- const constants_1 = require("../../constants");
8
- const abi_1 = require("@ethersproject/abi");
9
- const usual_1 = require("./usual");
10
- const utils_1 = require("../../utils");
11
- const usualM_abi_json_1 = __importDefault(require("../../abi/usual-m-smart-m/usualM.abi.json"));
12
- const Config = {
13
- UsualMSmartM: {
14
- [constants_1.Network.MAINNET]: {
15
- fromToken: {
16
- address: '0x437cc33344a0b27a429f795ff6b469c72698b291',
17
- decimals: 6,
18
- },
19
- toToken: {
20
- address: '0xfe274c305b365dc38e188e8f01c4fae2171ce927',
21
- decimals: 6,
22
- },
23
- },
24
- },
25
- };
26
- class UsualMSmartM extends usual_1.Usual {
27
- constructor(network, dexKey, dexHelper) {
28
- super(network, dexKey, dexHelper, Config[dexKey][network]);
29
- this.network = network;
30
- this.dexKey = dexKey;
31
- this.dexHelper = dexHelper;
32
- this.usualMIface = new abi_1.Interface(usualM_abi_json_1.default);
33
- }
34
- async getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
35
- if (this.isFromToken(srcToken) && this.isToToken(destToken)) {
36
- const exchangeData = this.usualMIface.encodeFunctionData('wrap(address, uint256)', [recipient, srcAmount]);
37
- return {
38
- needWrapNative: false,
39
- dexFuncHasRecipient: true,
40
- exchangeData,
41
- targetExchange: this.config.toToken.address,
42
- returnAmountPos: undefined,
43
- };
44
- }
45
- throw new Error('LOGIC ERROR');
46
- }
47
- }
48
- exports.UsualMSmartM = UsualMSmartM;
49
- UsualMSmartM.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(Config);
50
- //# sourceMappingURL=usual-m-smart-m.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usual-m-smart-m.js","sourceRoot":"","sources":["../../../src/dex/usual/usual-m-smart-m.ts"],"names":[],"mappings":";;;;;;AAMA,+CAAoD;AAGpD,4CAA6D;AAC7D,mCAAgC;AAChC,uCAAoD;AACpD,gGAAmE;AAEnE,MAAM,MAAM,GAA4B;IACtC,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,SAAS,EAAE;gBACT,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,CAAC;aACZ;YACD,OAAO,EAAE;gBACP,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,CAAC;aACZ;SACF;KACF;CACF,CAAC;AAEF,MAAa,YAAa,SAAQ,aAAK;IAMrC,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAJlD,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QAG9B,IAAI,CAAC,WAAW,GAAG,IAAI,eAAS,CAAC,yBAA4B,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,WAAW,CACf,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,SAAkB,EAClB,IAAQ,EACR,IAAc;QAEd,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;YAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,CACtD,wBAAwB,EACxB,CAAC,SAAS,EAAE,SAAS,CAAC,CACvB,CAAC;YAEF,OAAO;gBACL,cAAc,EAAE,KAAK;gBACrB,mBAAmB,EAAE,IAAI;gBACzB,YAAY;gBACZ,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO;gBAC3C,eAAe,EAAE,SAAS;aAC3B,CAAC;SACH;QAED,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;;AAxCH,oCAyCC;AAxCe,+BAAkB,GAC9B,IAAA,6BAAqB,EAAC,MAAM,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap } from '../../types';
3
- export declare const UsualMSmartMConfig: DexConfigMap<DexParams>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsualMSmartMConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.UsualMSmartMConfig = {
6
- UsualMSmartM: {
7
- [constants_1.Network.MAINNET]: {
8
- smartMAddress: '0x437cc33344a0B27A429f795ff6B469C72698B291',
9
- usualMAddress: '0xFe274C305b365dC38e188E8f01c4FAe2171ce927',
10
- },
11
- },
12
- };
13
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/usual-m-smart-m/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,kBAAkB,GAA4B;IACzD,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,aAAa,EAAE,4CAA4C;YAC3D,aAAa,EAAE,4CAA4C;SAC5D;KACF;CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Address } from '../../types';
2
- export declare type PoolState = {};
3
- export declare type UsualMSmartMData = {};
4
- export declare type DexParams = {
5
- smartMAddress: Address;
6
- usualMAddress: Address;
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/usual-m-smart-m/types.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, NumberAsString, DexExchangeParam, PoolLiquidity } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex } from '../idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { UsualMSmartMData, DexParams } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- import { Interface } from '@ethersproject/abi';
8
- export declare class UsualMSmartM1 extends SimpleExchange implements IDex<UsualMSmartMData> {
9
- readonly network: Network;
10
- readonly dexKey: string;
11
- readonly dexHelper: IDexHelper;
12
- protected config: DexParams;
13
- readonly hasConstantPriceLargeAmounts = true;
14
- readonly needWrapNative = false;
15
- readonly isFeeOnTransferSupported = false;
16
- static dexKeysWithNetwork: {
17
- key: string;
18
- networks: Network[];
19
- }[];
20
- usualMIface: Interface;
21
- logger: Logger;
22
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
23
- initializePricing(blockNumber: number): Promise<void>;
24
- getConfig(): DexParams;
25
- is_smartM(token: string): boolean;
26
- is_usualM(token: string): boolean;
27
- is_usualM_swap_token(srcToken: string, destToken: string): boolean;
28
- getAdapters(): null;
29
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
30
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<UsualMSmartMData>>;
31
- getCalldataGasCost(poolPrices: PoolPrices<UsualMSmartMData>): number | number[];
32
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UsualMSmartMData, side: SwapSide): AdapterExchangeParam;
33
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UsualMSmartMData, side: SwapSide): Promise<DexExchangeParam>;
34
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
35
- }