@paraswap/dex-lib 4.1.19 → 4.1.20

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 (347) hide show
  1. package/build/abi/AaveV1_lending_pool.json +27 -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/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +1246 -0
  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-pool.json +1062 -0
  28. package/build/abi/inception/inception-ineth.json +609 -0
  29. package/build/abi/inception/inception-ratio-feed.json +329 -0
  30. package/build/abi/inception/inception-vault.json +991 -0
  31. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  32. package/build/abi/kyberdmm.abi.json +1148 -0
  33. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  34. package/build/abi/nerve/nerve-metapool.json +790 -0
  35. package/build/abi/platypus/asset.json +490 -0
  36. package/build/abi/platypus/avax-pool.json +820 -0
  37. package/build/abi/platypus/oracle.json +119 -0
  38. package/build/abi/platypus/pool.json +677 -0
  39. package/build/abi/smardex/all/smardex-router.json +648 -0
  40. package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
  41. package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
  42. package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
  43. package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
  44. package/build/abi/swaap-v1/pool.json +1346 -0
  45. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  46. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  47. package/build/dex/aave-v1/aave-v1.d.ts +34 -0
  48. package/build/dex/aave-v1/aave-v1.js +180 -0
  49. package/build/dex/aave-v1/aave-v1.js.map +1 -0
  50. package/build/dex/aave-v1/config.d.ts +11 -0
  51. package/build/dex/aave-v1/config.js +20 -0
  52. package/build/dex/aave-v1/config.js.map +1 -0
  53. package/build/dex/aave-v1/tokens-mainnet.json +134 -0
  54. package/build/dex/aave-v1/tokens.d.ts +3 -0
  55. package/build/dex/aave-v1/tokens.js +50 -0
  56. package/build/dex/aave-v1/tokens.js.map +1 -0
  57. package/build/dex/aave-v1/types.d.ts +12 -0
  58. package/build/dex/aave-v1/types.js +3 -0
  59. package/build/dex/aave-v1/types.js.map +1 -0
  60. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  61. package/build/dex/balancer-v3/balancer-test-helpers.d.ts +5 -0
  62. package/build/dex/balancer-v3/balancer-test-helpers.js +25 -1
  63. package/build/dex/balancer-v3/balancer-test-helpers.js.map +1 -1
  64. package/build/dex/balancer-v3/balancer-v3-pool.js +35 -7
  65. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
  66. package/build/dex/balancer-v3/balancer-v3.js +9 -2
  67. package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
  68. package/build/dex/balancer-v3/config.d.ts +2 -1
  69. package/build/dex/balancer-v3/config.js +7 -0
  70. package/build/dex/balancer-v3/config.js.map +1 -1
  71. package/build/dex/balancer-v3/getGasCost.js +3 -0
  72. package/build/dex/balancer-v3/getGasCost.js.map +1 -1
  73. package/build/dex/balancer-v3/getOnChainState.d.ts +5 -1
  74. package/build/dex/balancer-v3/getOnChainState.js +69 -9
  75. package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
  76. package/build/dex/balancer-v3/getPoolsApi.js +45 -7
  77. package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
  78. package/build/dex/balancer-v3/getTopPoolsApi.d.ts +4 -3
  79. package/build/dex/balancer-v3/getTopPoolsApi.js +17 -6
  80. package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -1
  81. package/build/dex/balancer-v3/gyroECLPPool.d.ts +11 -0
  82. package/build/dex/balancer-v3/gyroECLPPool.js +6 -0
  83. package/build/dex/balancer-v3/gyroECLPPool.js.map +1 -0
  84. package/build/dex/balancer-v3/hooks/directionalFeeHook.d.ts +2 -0
  85. package/build/dex/balancer-v3/hooks/directionalFeeHook.js +1 -0
  86. package/build/dex/balancer-v3/hooks/directionalFeeHook.js.map +1 -1
  87. package/build/dex/balancer-v3/hooks/stableSurgeHook.d.ts +2 -0
  88. package/build/dex/balancer-v3/hooks/stableSurgeHook.js +1 -0
  89. package/build/dex/balancer-v3/hooks/stableSurgeHook.js.map +1 -1
  90. package/build/dex/balancer-v3/types.d.ts +6 -2
  91. package/build/dex/balancer-v3/utils.d.ts +2 -0
  92. package/build/dex/balancer-v3/utils.js +11 -0
  93. package/build/dex/balancer-v3/utils.js.map +1 -0
  94. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  95. package/build/dex/bebop/websocket-fetcher.js +87 -0
  96. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  97. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  98. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  99. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  100. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  101. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  102. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  103. package/build/dex/idle-dao/scripts.d.ts +9 -0
  104. package/build/dex/idle-dao/scripts.js +552 -0
  105. package/build/dex/idle-dao/scripts.js.map +1 -0
  106. package/build/dex/inception/config.d.ts +4 -0
  107. package/build/dex/inception/config.js +109 -0
  108. package/build/dex/inception/config.js.map +1 -0
  109. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  110. package/build/dex/inception/inception-event-pool.js +51 -0
  111. package/build/dex/inception/inception-event-pool.js.map +1 -0
  112. package/build/dex/inception/inception-native.d.ts +43 -0
  113. package/build/dex/inception/inception-native.js +131 -0
  114. package/build/dex/inception/inception-native.js.map +1 -0
  115. package/build/dex/inception/inception-pool.d.ts +18 -0
  116. package/build/dex/inception/inception-pool.js +32 -0
  117. package/build/dex/inception/inception-pool.js.map +1 -0
  118. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  119. package/build/dex/inception/inception-price-feed.js +51 -0
  120. package/build/dex/inception/inception-price-feed.js.map +1 -0
  121. package/build/dex/inception/inception.d.ts +43 -0
  122. package/build/dex/inception/inception.js +204 -0
  123. package/build/dex/inception/inception.js.map +1 -0
  124. package/build/dex/inception/tokens.d.ts +9 -0
  125. package/build/dex/inception/tokens.js +28 -0
  126. package/build/dex/inception/tokens.js.map +1 -0
  127. package/build/dex/inception/types.d.ts +22 -0
  128. package/build/dex/inception/types.js +3 -0
  129. package/build/dex/inception/types.js.map +1 -0
  130. package/build/dex/inception/utils.d.ts +6 -0
  131. package/build/dex/inception/utils.js +37 -0
  132. package/build/dex/inception/utils.js.map +1 -0
  133. package/build/dex/platypus/asset.d.ts +14 -0
  134. package/build/dex/platypus/asset.js +97 -0
  135. package/build/dex/platypus/asset.js.map +1 -0
  136. package/build/dex/platypus/config.d.ts +11 -0
  137. package/build/dex/platypus/config.js +69 -0
  138. package/build/dex/platypus/config.js.map +1 -0
  139. package/build/dex/platypus/platypus.d.ts +63 -0
  140. package/build/dex/platypus/platypus.js +473 -0
  141. package/build/dex/platypus/platypus.js.map +1 -0
  142. package/build/dex/platypus/pool-avax.d.ts +8 -0
  143. package/build/dex/platypus/pool-avax.js +54 -0
  144. package/build/dex/platypus/pool-avax.js.map +1 -0
  145. package/build/dex/platypus/pool-base.d.ts +19 -0
  146. package/build/dex/platypus/pool-base.js +86 -0
  147. package/build/dex/platypus/pool-base.js.map +1 -0
  148. package/build/dex/platypus/pool-pure.d.ts +8 -0
  149. package/build/dex/platypus/pool-pure.js +37 -0
  150. package/build/dex/platypus/pool-pure.js.map +1 -0
  151. package/build/dex/platypus/pool-subscriber.d.ts +14 -0
  152. package/build/dex/platypus/pool-subscriber.js +167 -0
  153. package/build/dex/platypus/pool-subscriber.js.map +1 -0
  154. package/build/dex/platypus/pool.d.ts +8 -0
  155. package/build/dex/platypus/pool.js +58 -0
  156. package/build/dex/platypus/pool.js.map +1 -0
  157. package/build/dex/platypus/types.d.ts +92 -0
  158. package/build/dex/platypus/types.js +10 -0
  159. package/build/dex/platypus/types.js.map +1 -0
  160. package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
  161. package/build/dex/quickswap/spiritswap-v3.js +19 -0
  162. package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
  163. package/build/dex/smardex/config.d.ts +4 -0
  164. package/build/dex/smardex/config.js +64 -0
  165. package/build/dex/smardex/config.js.map +1 -0
  166. package/build/dex/smardex/constants.d.ts +18 -0
  167. package/build/dex/smardex/constants.js +33 -0
  168. package/build/dex/smardex/constants.js.map +1 -0
  169. package/build/dex/smardex/sdk/constants.d.ts +6 -0
  170. package/build/dex/smardex/sdk/constants.js +13 -0
  171. package/build/dex/smardex/sdk/constants.js.map +1 -0
  172. package/build/dex/smardex/sdk/core.d.ts +113 -0
  173. package/build/dex/smardex/sdk/core.js +499 -0
  174. package/build/dex/smardex/sdk/core.js.map +1 -0
  175. package/build/dex/smardex/sdk/errors.d.ts +15 -0
  176. package/build/dex/smardex/sdk/errors.js +22 -0
  177. package/build/dex/smardex/sdk/errors.js.map +1 -0
  178. package/build/dex/smardex/sdk/types.d.ts +62 -0
  179. package/build/dex/smardex/sdk/types.js +3 -0
  180. package/build/dex/smardex/sdk/types.js.map +1 -0
  181. package/build/dex/smardex/sdk/utils.d.ts +44 -0
  182. package/build/dex/smardex/sdk/utils.js +133 -0
  183. package/build/dex/smardex/sdk/utils.js.map +1 -0
  184. package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
  185. package/build/dex/smardex/smardex-event-pool.js +119 -0
  186. package/build/dex/smardex/smardex-event-pool.js.map +1 -0
  187. package/build/dex/smardex/smardex.d.ts +65 -0
  188. package/build/dex/smardex/smardex.js +519 -0
  189. package/build/dex/smardex/smardex.js.map +1 -0
  190. package/build/dex/smardex/types.d.ts +55 -0
  191. package/build/dex/smardex/types.js +3 -0
  192. package/build/dex/smardex/types.js.map +1 -0
  193. package/build/dex/solidly/forks-override/cone.d.ts +22 -0
  194. package/build/dex/solidly/forks-override/cone.js +53 -0
  195. package/build/dex/solidly/forks-override/cone.js.map +1 -0
  196. package/build/dex/solidly/forks-override/solisnek.d.ts +8 -0
  197. package/build/dex/solidly/forks-override/solisnek.js +15 -0
  198. package/build/dex/solidly/forks-override/solisnek.js.map +1 -0
  199. package/build/dex/swaap-v1/config.d.ts +17 -0
  200. package/build/dex/swaap-v1/config.js +56 -0
  201. package/build/dex/swaap-v1/config.js.map +1 -0
  202. package/build/dex/swaap-v1/constants.d.ts +6 -0
  203. package/build/dex/swaap-v1/constants.js +17 -0
  204. package/build/dex/swaap-v1/constants.js.map +1 -0
  205. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +25 -0
  206. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +62 -0
  207. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +1 -0
  208. package/build/dex/swaap-v1/libraries/Const.d.ts +18 -0
  209. package/build/dex/swaap-v1/libraries/Const.js +26 -0
  210. package/build/dex/swaap-v1/libraries/Const.js.map +1 -0
  211. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +77 -0
  212. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +316 -0
  213. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +1 -0
  214. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +75 -0
  215. package/build/dex/swaap-v1/libraries/LogExpMath.js +418 -0
  216. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +1 -0
  217. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +185 -0
  218. package/build/dex/swaap-v1/libraries/MathMMM.js +453 -0
  219. package/build/dex/swaap-v1/libraries/MathMMM.js.map +1 -0
  220. package/build/dex/swaap-v1/libraries/Num.d.ts +31 -0
  221. package/build/dex/swaap-v1/libraries/Num.js +167 -0
  222. package/build/dex/swaap-v1/libraries/Num.js.map +1 -0
  223. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +23 -0
  224. package/build/dex/swaap-v1/libraries/PoolQuotations.js +131 -0
  225. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +1 -0
  226. package/build/dex/swaap-v1/libraries/Struct.d.ts +56 -0
  227. package/build/dex/swaap-v1/libraries/Struct.js +3 -0
  228. package/build/dex/swaap-v1/libraries/Struct.js.map +1 -0
  229. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +45 -0
  230. package/build/dex/swaap-v1/swaap-v1-pool.js +656 -0
  231. package/build/dex/swaap-v1/swaap-v1-pool.js.map +1 -0
  232. package/build/dex/swaap-v1/swaap-v1.d.ts +62 -0
  233. package/build/dex/swaap-v1/swaap-v1.js +379 -0
  234. package/build/dex/swaap-v1/swaap-v1.js.map +1 -0
  235. package/build/dex/swaap-v1/types.d.ts +106 -0
  236. package/build/dex/swaap-v1/types.js +9 -0
  237. package/build/dex/swaap-v1/types.js.map +1 -0
  238. package/build/dex/zerox/index.d.ts +1 -1
  239. package/build/dex/zerox/index.js.map +1 -1
  240. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  241. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  242. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  243. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  244. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  245. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  246. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  247. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  248. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  249. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  250. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  251. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  252. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  253. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  254. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  255. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  256. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  257. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  258. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  259. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  260. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  261. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  262. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  263. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  264. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  265. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  266. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  267. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  268. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  269. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  270. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  271. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  272. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  273. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  274. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  275. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  276. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  277. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  278. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  279. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  280. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  281. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  282. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  283. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  284. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  285. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  286. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  287. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  288. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  289. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  290. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  291. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  292. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  293. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  294. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  295. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  296. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  297. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  298. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  299. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  300. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  301. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  302. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  303. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  304. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  305. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  306. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  307. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  308. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  309. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  310. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  311. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  312. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  313. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  314. package/package.json +2 -2
  315. package/src/dex/balancer-v3/balancer-api.test.ts +122 -0
  316. package/src/dex/balancer-v3/balancer-buffer.test.ts +75 -0
  317. package/src/dex/balancer-v3/balancer-gyroECLP.test.ts +76 -0
  318. package/src/dex/balancer-v3/balancer-stableSurge.test.ts +54 -52
  319. package/src/dex/balancer-v3/balancer-test-helpers.ts +52 -0
  320. package/src/dex/balancer-v3/balancer-test-weighted.test.ts +96 -0
  321. package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +49 -2
  322. package/src/dex/balancer-v3/balancer-v3-events.test.ts +162 -1
  323. package/src/dex/balancer-v3/balancer-v3-pool.ts +50 -15
  324. package/src/dex/balancer-v3/balancer-v3.ts +14 -4
  325. package/src/dex/balancer-v3/config.ts +7 -0
  326. package/src/dex/balancer-v3/getGasCost.ts +3 -0
  327. package/src/dex/balancer-v3/getOnChainState.ts +101 -12
  328. package/src/dex/balancer-v3/getPoolsApi.ts +55 -12
  329. package/src/dex/balancer-v3/getTopPoolsApi.ts +29 -11
  330. package/src/dex/balancer-v3/gyroECLPPool.ts +17 -0
  331. package/src/dex/balancer-v3/hooks/directionalFeeHook.ts +2 -0
  332. package/src/dex/balancer-v3/hooks/stableSurgeHook.ts +2 -0
  333. package/src/dex/balancer-v3/types.ts +6 -2
  334. package/src/dex/balancer-v3/utils.ts +11 -0
  335. package/tests/constants-e2e.ts +9 -0
  336. package/tests/token-storage-slots.json +40 -0
  337. package/.idea/codeStyles/Project.xml +0 -59
  338. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  339. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  340. package/.idea/modules.xml +0 -8
  341. package/.idea/paraswap-dex-lib.iml +0 -12
  342. package/.idea/prettier.xml +0 -7
  343. package/.idea/vcs.xml +0 -6
  344. package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
  345. package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
  346. package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
  347. package/scripts/get-uniswap-v3-dexes.ts +0 -64
@@ -86,7 +86,10 @@ const poolOnChain: Record<
86
86
  poolAddress: string,
87
87
  data: any,
88
88
  startIndex: number,
89
- ): Omit<CommonMutableState, 'erc4626Rates'> => {
89
+ ): Omit<
90
+ CommonMutableState,
91
+ 'erc4626Rates' | 'erc4626MaxDeposit' | 'erc4626MaxMint'
92
+ > => {
90
93
  const resultTokenRates = decodeThrowError(
91
94
  contractInterface,
92
95
  'getPoolTokenRates',
@@ -241,6 +244,26 @@ const poolOnChain: Record<
241
244
  };
242
245
  },
243
246
  },
247
+ // nothing to encode/decode for this pool
248
+ // as all of the values are immutable and returned from the API
249
+ ['GYROE']: {
250
+ count: 0,
251
+ ['encode']: (
252
+ network: number,
253
+ contractInterface: Interface,
254
+ address: string,
255
+ ): callData[] => {
256
+ return [];
257
+ },
258
+ ['decode']: (
259
+ contractInterface: Interface,
260
+ poolAddress: string,
261
+ data: any,
262
+ startIndex: number,
263
+ ) => {
264
+ return {};
265
+ },
266
+ },
244
267
  };
245
268
 
246
269
  export function decodeThrowError(
@@ -271,12 +294,30 @@ export function getErc4626MultiCallData(
271
294
  );
272
295
 
273
296
  // query result for 1e18 (this maintains correct scaling for different token decimals in maths)
274
- const erc4626MultiCallData: callData[] = uniqueErc4626Tokens.map(token => {
275
- return {
276
- target: token,
277
- callData: erc4626Interface.encodeFunctionData('convertToAssets', [WAD]),
278
- };
279
- });
297
+ const erc4626MultiCallData: callData[] = uniqueErc4626Tokens.flatMap(
298
+ token => {
299
+ return [
300
+ {
301
+ target: token,
302
+ callData: erc4626Interface.encodeFunctionData('convertToAssets', [
303
+ WAD,
304
+ ]),
305
+ },
306
+ {
307
+ target: token,
308
+ callData: erc4626Interface.encodeFunctionData('maxDeposit', [
309
+ '0x0000000000000000000000000000000000000000',
310
+ ]),
311
+ },
312
+ {
313
+ target: token,
314
+ callData: erc4626Interface.encodeFunctionData('maxMint', [
315
+ '0x0000000000000000000000000000000000000000',
316
+ ]),
317
+ },
318
+ ];
319
+ },
320
+ );
280
321
  return erc4626MultiCallData;
281
322
  }
282
323
 
@@ -285,12 +326,22 @@ export function decodeErc4626MultiCallData(
285
326
  erc4626MultiCallData: callData[],
286
327
  dataResultErc4626: any[],
287
328
  ) {
329
+ // We only need to process third of the erc4626MultiCallData entries
330
+ // since each entry corresponds to three results
331
+ const thirdLength = Math.floor(erc4626MultiCallData.length / 3);
332
+
288
333
  return Object.fromEntries(
289
- erc4626MultiCallData.map((multiCallData, i) => {
334
+ Array.from({ length: thirdLength }).map((_, i) => {
335
+ const rateIndex = i * 3;
336
+ const maxDepositIndex = i * 3 + 1;
337
+ const maxMintIndex = i * 3 + 2;
338
+ const multiCallData = erc4626MultiCallData[rateIndex];
339
+
340
+ // Decode convertToAssets
290
341
  const rate = decodeThrowError(
291
342
  erc4626Interface,
292
343
  'convertToAssets',
293
- dataResultErc4626[i],
344
+ dataResultErc4626[rateIndex],
294
345
  multiCallData.target,
295
346
  );
296
347
  if (!rate)
@@ -298,11 +349,41 @@ export function decodeErc4626MultiCallData(
298
349
  `Failed to get result for convertToAssets for ${multiCallData.target}`,
299
350
  );
300
351
 
301
- return [multiCallData.target, BigInt(rate[0])];
352
+ // Decode maxDeposit
353
+ const maxDeposit = decodeThrowError(
354
+ erc4626Interface,
355
+ 'maxDeposit',
356
+ dataResultErc4626[maxDepositIndex],
357
+ multiCallData.target,
358
+ );
359
+ if (!maxDeposit)
360
+ throw new Error(
361
+ `Failed to get result for maxDeposit for ${multiCallData.target}`,
362
+ );
363
+
364
+ // Decode maxMint
365
+ const maxMint = decodeThrowError(
366
+ erc4626Interface,
367
+ 'maxMint',
368
+ dataResultErc4626[maxMintIndex],
369
+ multiCallData.target,
370
+ );
371
+ if (!maxMint)
372
+ throw new Error(
373
+ `Failed to get result for maxMint for ${multiCallData.target}`,
374
+ );
375
+
376
+ return [
377
+ multiCallData.target,
378
+ {
379
+ rate: BigInt(rate[0]),
380
+ maxDeposit: BigInt(maxDeposit[0]),
381
+ maxMint: BigInt(maxMint[0]),
382
+ },
383
+ ];
302
384
  }),
303
385
  );
304
386
  }
305
-
306
387
  // Any data from API will be immutable. Mutable data such as balances, etc will be fetched via onchain/event state.
307
388
  export async function getOnChainState(
308
389
  network: number,
@@ -387,7 +468,15 @@ export async function getOnChainState(
387
468
  ...poolMutableData,
388
469
  erc4626Rates: pool.tokens.map(t => {
389
470
  if (!tokensWithRates[t]) return null;
390
- return tokensWithRates[t];
471
+ return tokensWithRates[t].rate;
472
+ }),
473
+ erc4626MaxDeposit: pool.tokens.map(t => {
474
+ if (!tokensWithRates[t]) return null;
475
+ return tokensWithRates[t].maxDeposit;
476
+ }),
477
+ erc4626MaxMint: pool.tokens.map(t => {
478
+ if (!tokensWithRates[t]) return null;
479
+ return tokensWithRates[t].maxMint;
391
480
  }),
392
481
  },
393
482
  ];
@@ -8,34 +8,36 @@ import {
8
8
  import { CommonImmutablePoolState, ImmutablePoolStateMap } from './types';
9
9
  import { parseUnits } from 'ethers/lib/utils';
10
10
  import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
11
-
11
+ import { getUniqueHookNames } from './utils';
12
+ import { GyroECLPImmutableString } from './gyroECLPPool';
12
13
  interface PoolToken {
13
14
  address: string;
14
15
  weight: string | null;
15
- isErc4626: boolean;
16
+ canUseBufferForSwaps: boolean | null;
16
17
  underlyingToken: {
17
18
  address: string;
18
19
  } | null;
19
20
  }
20
21
 
21
- interface Pool {
22
+ type Pool = {
22
23
  id: string;
23
24
  type: string;
24
25
  poolTokens: PoolToken[];
25
26
  hook: {
26
27
  address: string;
27
28
  } | null;
28
- }
29
+ } & GyroECLPImmutableString;
29
30
 
30
31
  interface QueryResponse {
31
32
  data: {
32
- poolGetAggregatorPools: Pool[];
33
+ aggregatorPools: Pool[];
33
34
  };
34
35
  }
35
36
 
36
37
  function createQuery(
37
38
  networkId: number,
38
39
  poolTypes: SUPPORTED_POOLS[],
40
+ hooks: string,
39
41
  timestamp?: number,
40
42
  ): string {
41
43
  const poolTypesString = poolTypes.map(type => `${type}`).join(', ');
@@ -51,6 +53,7 @@ function createQuery(
51
53
  poolTypeIn: `[${poolTypesString}]`,
52
54
  ...(timestamp && { createTime: `{lt: ${timestamp}}` }),
53
55
  ...(disabledPoolIdsString && { idNotIn: `[${disabledPoolIdsString}]` }),
56
+ includeHooks: `[${hooks}]`,
54
57
  };
55
58
 
56
59
  // Convert where clause to string, filtering out undefined values
@@ -59,7 +62,7 @@ function createQuery(
59
62
  .join(', ');
60
63
  return `
61
64
  query MyQuery {
62
- poolGetAggregatorPools(
65
+ aggregatorPools(
63
66
  where: {${whereString}}
64
67
  ) {
65
68
  id
@@ -67,7 +70,7 @@ function createQuery(
67
70
  poolTokens {
68
71
  address
69
72
  weight
70
- isErc4626
73
+ canUseBufferForSwaps
71
74
  underlyingToken {
72
75
  address
73
76
  }
@@ -75,6 +78,20 @@ function createQuery(
75
78
  hook {
76
79
  address
77
80
  }
81
+ alpha
82
+ beta
83
+ c
84
+ s
85
+ lambda
86
+ tauAlphaX
87
+ tauAlphaY
88
+ tauBetaX
89
+ tauBetaY
90
+ u
91
+ v
92
+ w
93
+ z
94
+ dSq
78
95
  }
79
96
  }
80
97
  `;
@@ -97,17 +114,34 @@ function toImmutablePoolStateMap(
97
114
  poolAddress: pool.id,
98
115
  tokens: pool.poolTokens.map(t => t.address),
99
116
  tokensUnderlying: pool.poolTokens.map(t =>
100
- t.underlyingToken ? t.underlyingToken.address : null,
101
- ),
102
- weights: pool.poolTokens.map(t =>
103
- t.weight ? parseUnits(t.weight, 18).toBigInt() : 0n,
117
+ t.underlyingToken && t.canUseBufferForSwaps
118
+ ? t.underlyingToken.address
119
+ : null,
104
120
  ),
121
+ weights: pool.poolTokens.map(t => scaleOrDefault(t.weight, 18, 0n)),
105
122
  poolType: pool.type,
106
123
  hookAddress: pool.hook ? pool.hook.address.toLowerCase() : undefined,
107
124
  hookType: pool.hook
108
125
  ? hooksConfigMap[pool.hook.address.toLowerCase()].type
109
126
  : undefined,
110
127
  supportsUnbalancedLiquidity: true, // can default to true as only required for add/remove maths which we don't use
128
+ // GyroECLP
129
+ // Parameters to configure the E-CLP pool, with 18 decimals
130
+ paramsAlpha: scaleOrDefault(pool.alpha, 18, 0n),
131
+ paramsBeta: scaleOrDefault(pool.beta, 18, 0n),
132
+ paramsC: scaleOrDefault(pool.c, 18, 0n),
133
+ paramsS: scaleOrDefault(pool.s, 18, 0n),
134
+ paramsLambda: scaleOrDefault(pool.lambda, 18, 0n),
135
+ // Parameters calculated off-chain based on eclpParams. 38 decimals for higher precision
136
+ tauAlphaX: scaleOrDefault(pool.tauAlphaX, 38, 0n),
137
+ tauAlphaY: scaleOrDefault(pool.tauAlphaY, 38, 0n),
138
+ tauBetaX: scaleOrDefault(pool.tauBetaX, 38, 0n),
139
+ tauBetaY: scaleOrDefault(pool.tauBetaY, 38, 0n),
140
+ u: scaleOrDefault(pool.u, 38, 0n),
141
+ v: scaleOrDefault(pool.v, 38, 0n),
142
+ w: scaleOrDefault(pool.w, 38, 0n),
143
+ z: scaleOrDefault(pool.z, 38, 0n),
144
+ dSq: scaleOrDefault(pool.dSq, 38, 0n),
111
145
  };
112
146
  map[pool.id] = immutablePoolState;
113
147
  return map;
@@ -115,6 +149,14 @@ function toImmutablePoolStateMap(
115
149
  );
116
150
  }
117
151
 
152
+ function scaleOrDefault(
153
+ original: string | null,
154
+ decimals: number,
155
+ defaultValue: bigint,
156
+ ): bigint {
157
+ return original ? parseUnits(original, decimals).toBigInt() : defaultValue;
158
+ }
159
+
118
160
  // Any data from API will be immutable. Mutable data such as balances, etc will be fetched via onchain/event state.
119
161
  export async function getPoolsApi(
120
162
  network: number,
@@ -125,6 +167,7 @@ export async function getPoolsApi(
125
167
  const query = createQuery(
126
168
  network,
127
169
  Object.values(SUPPORTED_POOLS),
170
+ getUniqueHookNames(hooksConfigMap),
128
171
  timestamp,
129
172
  );
130
173
  const response = await axios.post<QueryResponse>(
@@ -139,7 +182,7 @@ export async function getPoolsApi(
139
182
  },
140
183
  );
141
184
 
142
- const pools = response.data.data.poolGetAggregatorPools;
185
+ const pools = response.data.data.aggregatorPools;
143
186
  return toImmutablePoolStateMap(pools, hooksConfigMap);
144
187
  } catch (error) {
145
188
  // console.error('Error executing GraphQL query:', error);
@@ -1,14 +1,16 @@
1
1
  import axios from 'axios';
2
2
  import { apiUrl, BalancerV3Config, disabledPoolIds } from './config';
3
3
  import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
4
+ import { getUniqueHookNames } from './utils';
4
5
 
5
6
  interface PoolToken {
6
7
  address: string;
7
8
  decimals: number;
8
- underlyingToken?: {
9
+ canUseBufferForSwaps: boolean | null;
10
+ underlyingToken: {
9
11
  address: string;
10
12
  decimals: number;
11
- };
13
+ } | null;
12
14
  }
13
15
 
14
16
  export interface Pool {
@@ -24,13 +26,14 @@ export interface Pool {
24
26
 
25
27
  interface QueryResponse {
26
28
  data: {
27
- poolGetAggregatorPools: Pool[];
29
+ aggregatorPools: Pool[];
28
30
  };
29
31
  }
30
32
 
31
33
  function createQuery(
32
34
  networkId: number,
33
35
  poolsFilter: string[],
36
+ hooks: string,
34
37
  count: number,
35
38
  ): string {
36
39
  const disabledPoolIdsString = disabledPoolIds.BalancerV3[networkId]
@@ -45,6 +48,7 @@ function createQuery(
45
48
  protocolVersionIn: 3,
46
49
  idIn: `[${poolIdString}]`,
47
50
  ...(disabledPoolIdsString && { idNotIn: `[${disabledPoolIdsString}]` }),
51
+ includeHooks: `[${hooks}]`,
48
52
  };
49
53
 
50
54
  // Convert where clause to string, filtering out undefined values
@@ -53,7 +57,7 @@ function createQuery(
53
57
  .join(', ');
54
58
  return `
55
59
  query MyQuery {
56
- poolGetAggregatorPools(
60
+ aggregatorPools(
57
61
  where: {${whereString}}
58
62
  first: ${count}
59
63
  orderBy: totalLiquidity
@@ -63,6 +67,7 @@ function createQuery(
63
67
  poolTokens {
64
68
  address
65
69
  decimals
70
+ canUseBufferForSwaps
66
71
  underlyingToken {
67
72
  address
68
73
  decimals
@@ -83,10 +88,15 @@ export async function getTopPoolsApi(
83
88
  networkId: number,
84
89
  poolsFilter: string[],
85
90
  count: number,
86
- hooksTypeMap: HooksConfigMap,
91
+ hooksConfigMap: HooksConfigMap,
87
92
  ): Promise<Pool[]> {
88
93
  try {
89
- const query = createQuery(networkId, poolsFilter, count);
94
+ const query = createQuery(
95
+ networkId,
96
+ poolsFilter,
97
+ getUniqueHookNames(hooksConfigMap),
98
+ count,
99
+ );
90
100
  const response = await axios.post<QueryResponse>(
91
101
  apiUrl,
92
102
  {
@@ -99,11 +109,19 @@ export async function getTopPoolsApi(
99
109
  },
100
110
  );
101
111
 
102
- const pools = response.data.data.poolGetAggregatorPools.filter(
103
- pool =>
104
- !pool.hook ||
105
- (pool.hook && pool.hook.address.toLowerCase() in hooksTypeMap),
106
- );
112
+ const pools = response.data.data.aggregatorPools
113
+ .filter(
114
+ pool =>
115
+ !pool.hook ||
116
+ (pool.hook && pool.hook.address.toLowerCase() in hooksConfigMap),
117
+ )
118
+ .map(pool => ({
119
+ ...pool,
120
+ poolTokens: pool.poolTokens.map(t => ({
121
+ ...t,
122
+ underlyingToken: t.canUseBufferForSwaps ? t.underlyingToken : null,
123
+ })),
124
+ }));
107
125
  return pools;
108
126
  } catch (error) {
109
127
  // console.error('Error executing GraphQL query:', error);
@@ -0,0 +1,17 @@
1
+ import { GyroECLPImmutable } from '@balancer-labs/balancer-maths';
2
+
3
+ // https://sepolia.etherscan.io/tx/0x222800381cfc60b6af18c0f533149b6a3b4cda6c05aafb92cfbac42eb281bf76
4
+ export const GYROECLP_GAS_COST = 214120;
5
+
6
+ export type GyroECLPImmutableString = {
7
+ [K in keyof Omit<
8
+ GyroECLPImmutable,
9
+ 'paramsAlpha' | 'paramsBeta' | 'paramsC' | 'paramsS' | 'paramsLambda'
10
+ >]: string;
11
+ } & {
12
+ alpha: string;
13
+ beta: string;
14
+ c: string;
15
+ s: string;
16
+ lambda: string;
17
+ };
@@ -8,10 +8,12 @@ import { HookStateMap } from './balancer-hook-event-subscriber';
8
8
 
9
9
  export const DirectionalFee = {
10
10
  type: 'DirectionalFee' as const,
11
+ apiName: 'DIRECTIONAL_FEE' as const,
11
12
  };
12
13
 
13
14
  export type DirectionalFeeConfig = {
14
15
  type: typeof DirectionalFee.type;
16
+ apiName: typeof DirectionalFee.apiName;
15
17
  address: string;
16
18
  };
17
19
 
@@ -10,10 +10,12 @@ import { Logger } from 'log4js';
10
10
 
11
11
  export const StableSurge = {
12
12
  type: 'StableSurge' as const,
13
+ apiName: 'STABLE_SURGE' as const,
13
14
  };
14
15
 
15
16
  export type StableSurgeConfig = {
16
17
  type: typeof StableSurge.type;
18
+ apiName: typeof StableSurge.apiName;
17
19
  factory: string;
18
20
  address: string;
19
21
  };
@@ -1,4 +1,4 @@
1
- import { BufferState } from '@balancer-labs/balancer-maths';
1
+ import { BufferState, GyroECLPImmutable } from '@balancer-labs/balancer-maths';
2
2
  import { Address } from '../../types';
3
3
  import { HookConfig } from './hooks/balancer-hook-event-subscriber';
4
4
 
@@ -16,12 +16,14 @@ export type CommonImmutablePoolState = {
16
16
  hookAddress: string | undefined;
17
17
  hookType: string | undefined;
18
18
  supportsUnbalancedLiquidity: boolean;
19
- };
19
+ } & GyroECLPImmutable;
20
20
 
21
21
  // Mutable data types available on all pools (Available via onchain calls/events)
22
22
  export interface CommonMutableState {
23
23
  tokenRates: bigint[];
24
24
  erc4626Rates: (bigint | null)[];
25
+ erc4626MaxDeposit: (bigint | null)[];
26
+ erc4626MaxMint: (bigint | null)[];
25
27
  balancesLiveScaled18: bigint[];
26
28
  swapFee: bigint;
27
29
  aggregateSwapFee: bigint;
@@ -86,4 +88,6 @@ export type TokenInfo = {
86
88
  mainToken: string;
87
89
  index: number;
88
90
  rate: bigint;
91
+ maxDeposit: bigint;
92
+ maxMint: bigint;
89
93
  };
@@ -0,0 +1,11 @@
1
+ import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
2
+
3
+ export function getUniqueHookNames(hooksConfigMap: HooksConfigMap): string {
4
+ // Use Object.values to get all HookConfig objects
5
+ // Then map to extract just the names
6
+ // Use Set to get unique names
7
+ // Convert back to array and join with comma
8
+ return Array.from(
9
+ new Set(Object.values(hooksConfigMap).map(hook => hook.apiName)),
10
+ ).join(', ');
11
+ }
@@ -1367,6 +1367,10 @@ export const Tokens: {
1367
1367
  address: '0xe98fc055c99decd8da0c111b090885d5d15c774e',
1368
1368
  decimals: 18,
1369
1369
  },
1370
+ eBTC: {
1371
+ address: '0x657e8c867d8b37dcc18fa4caead9c45eb088c642',
1372
+ decimals: 8,
1373
+ },
1370
1374
  USDS: {
1371
1375
  address: '0x6491c05A82219b8D1479057361ff1654749b876b',
1372
1376
  decimals: 18,
@@ -1769,6 +1773,10 @@ export const Tokens: {
1769
1773
  address: `0x978206fae13faf5a8d293fb614326b237684b750`,
1770
1774
  decimals: 6,
1771
1775
  },
1776
+ DAI: {
1777
+ address: `0xB77EB1A70A96fDAAeB31DB1b42F2b8b5846b2613`,
1778
+ decimals: 18,
1779
+ },
1772
1780
  },
1773
1781
  };
1774
1782
 
@@ -2191,6 +2199,7 @@ export const Holders: {
2191
2199
  stataUSDC: '0x75D06bae37a9c349142fE7cee77804900b1C0EC3',
2192
2200
  stataUSDT: '0x75D06bae37a9c349142fE7cee77804900b1C0EC3',
2193
2201
  usdcAave: '0xdD5De55eA6804EFb283f43b0C091C25000a6486c',
2202
+ DAI: '0x90347b9CC81a4a28aAc74E8B134040d5ce2eaB6D',
2194
2203
  },
2195
2204
  };
2196
2205
 
@@ -579,6 +579,18 @@
579
579
  "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d": {
580
580
  "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
581
581
  "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000004"
582
+ },
583
+ "0x177127622c4a00f3d409b75571e12cb3c8973d3c": {
584
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
585
+ "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000005"
586
+ },
587
+ "0x57f664882f762fa37903fc864e2b633d384b411a": {
588
+ "balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
589
+ "allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
590
+ },
591
+ "0x773cda0cade2a3d86e6d4e30699d40bb95174ff2": {
592
+ "balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
593
+ "allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
582
594
  }
583
595
  },
584
596
  "137": {
@@ -629,6 +641,34 @@
629
641
  "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca": {
630
642
  "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000033",
631
643
  "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000034"
644
+ },
645
+ "0x4200000000000000000000000000000000000006": {
646
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
647
+ "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000004"
648
+ },
649
+ "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913": {
650
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000009",
651
+ "allowanceSlot": "0x000000000000000000000000000000000000000000000000000000000000000a"
652
+ },
653
+ "0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452": {
654
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000001",
655
+ "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000002"
656
+ },
657
+ "0x5875eee11cf8398102fdad704c9e96607675467a": {
658
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000002",
659
+ "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003"
660
+ },
661
+ "0x616a4e1db48e22028f6bbf20444cd3b8e3273738": {
662
+ "balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000000",
663
+ "allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000001"
664
+ },
665
+ "0x88b1cd4b430d95b406e382c3cdbae54697a0286e": {
666
+ "balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
667
+ "allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
668
+ },
669
+ "0xc768c589647798a6ee01a91fde98ef2ed046dbd6": {
670
+ "balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
671
+ "allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
632
672
  }
633
673
  },
634
674
  "42161": {
@@ -1,59 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- </HTMLCodeStyleSettings>
6
- <JSCodeStyleSettings version="0">
7
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
- <option name="USE_DOUBLE_QUOTES" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="USE_DOUBLE_QUOTES" value="false" />
19
- <option name="FORCE_QUOTE_STYlE" value="true" />
20
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
21
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
- </TypeScriptCodeStyleSettings>
24
- <VueCodeStyleSettings>
25
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
- </VueCodeStyleSettings>
28
- <codeStyleSettings language="HTML">
29
- <option name="SOFT_MARGINS" value="80" />
30
- <indentOptions>
31
- <option name="INDENT_SIZE" value="2" />
32
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
- <option name="TAB_SIZE" value="2" />
34
- </indentOptions>
35
- </codeStyleSettings>
36
- <codeStyleSettings language="JavaScript">
37
- <option name="SOFT_MARGINS" value="80" />
38
- <indentOptions>
39
- <option name="INDENT_SIZE" value="2" />
40
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
- <option name="TAB_SIZE" value="2" />
42
- </indentOptions>
43
- </codeStyleSettings>
44
- <codeStyleSettings language="TypeScript">
45
- <option name="SOFT_MARGINS" value="80" />
46
- <indentOptions>
47
- <option name="INDENT_SIZE" value="2" />
48
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
- <option name="TAB_SIZE" value="2" />
50
- </indentOptions>
51
- </codeStyleSettings>
52
- <codeStyleSettings language="Vue">
53
- <option name="SOFT_MARGINS" value="80" />
54
- <indentOptions>
55
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
- </indentOptions>
57
- </codeStyleSettings>
58
- </code_scheme>
59
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" filepath="$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" />
6
- </modules>
7
- </component>
8
- </project>