@paraswap/dex-lib 4.1.9 → 4.1.10-pubsub

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 (363) 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/ekubo/core.json +1266 -0
  28. package/build/abi/ekubo/data-fetcher.json +161 -0
  29. package/build/abi/ekubo/router.json +803 -0
  30. package/build/abi/inception/inception-ineth-pool.json +1062 -0
  31. package/build/abi/inception/inception-ineth.json +609 -0
  32. package/build/abi/inception/inception-ratio-feed.json +329 -0
  33. package/build/abi/inception/inception-vault.json +991 -0
  34. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  35. package/build/abi/kyberdmm.abi.json +1148 -0
  36. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  37. package/build/abi/nerve/nerve-metapool.json +790 -0
  38. package/build/abi/platypus/asset.json +490 -0
  39. package/build/abi/platypus/avax-pool.json +820 -0
  40. package/build/abi/platypus/oracle.json +119 -0
  41. package/build/abi/platypus/pool.json +677 -0
  42. package/build/abi/smardex/all/smardex-router.json +648 -0
  43. package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
  44. package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
  45. package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
  46. package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
  47. package/build/abi/swaap-v1/pool.json +1346 -0
  48. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  49. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  50. package/build/dex/aave-v1/aave-v1.d.ts +34 -0
  51. package/build/dex/aave-v1/aave-v1.js +180 -0
  52. package/build/dex/aave-v1/aave-v1.js.map +1 -0
  53. package/build/dex/aave-v1/config.d.ts +11 -0
  54. package/build/dex/aave-v1/config.js +20 -0
  55. package/build/dex/aave-v1/config.js.map +1 -0
  56. package/build/dex/aave-v1/tokens-mainnet.json +134 -0
  57. package/build/dex/aave-v1/tokens.d.ts +3 -0
  58. package/build/dex/aave-v1/tokens.js +50 -0
  59. package/build/dex/aave-v1/tokens.js.map +1 -0
  60. package/build/dex/aave-v1/types.d.ts +12 -0
  61. package/build/dex/aave-v1/types.js +3 -0
  62. package/build/dex/aave-v1/types.js.map +1 -0
  63. package/build/dex/aave-v3-stata/config.js +8 -8
  64. package/build/dex/aave-v3-stata/config.js.map +1 -1
  65. package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js +2 -2
  66. package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js.map +1 -1
  67. package/build/dex/aave-v3-stata-v2/config.js +31 -24
  68. package/build/dex/aave-v3-stata-v2/config.js.map +1 -1
  69. package/build/dex/aave-v3-stata-v2/types.d.ts +3 -2
  70. package/build/dex/aave-v3-stata-v2/types.js.map +1 -1
  71. package/build/dex/aave-v3-stata-v2/utils.d.ts +2 -2
  72. package/build/dex/aave-v3-stata-v2/utils.js +7 -6
  73. package/build/dex/aave-v3-stata-v2/utils.js.map +1 -1
  74. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  75. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  76. package/build/dex/bebop/websocket-fetcher.js +87 -0
  77. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  78. package/build/dex/ekubo/config.d.ts +3 -0
  79. package/build/dex/ekubo/config.js +23 -0
  80. package/build/dex/ekubo/config.js.map +1 -0
  81. package/build/dex/ekubo/ekubo.d.ts +49 -0
  82. package/build/dex/ekubo/ekubo.js +418 -0
  83. package/build/dex/ekubo/ekubo.js.map +1 -0
  84. package/build/dex/ekubo/pools/base-pool.d.ts +47 -0
  85. package/build/dex/ekubo/pools/base-pool.js +184 -0
  86. package/build/dex/ekubo/pools/base-pool.js.map +1 -0
  87. package/build/dex/ekubo/pools/math/constants.d.ts +3 -0
  88. package/build/dex/ekubo/pools/math/constants.js +7 -0
  89. package/build/dex/ekubo/pools/math/constants.js.map +1 -0
  90. package/build/dex/ekubo/pools/math/delta.d.ts +2 -0
  91. package/build/dex/ekubo/pools/math/delta.js +51 -0
  92. package/build/dex/ekubo/pools/math/delta.js.map +1 -0
  93. package/build/dex/ekubo/pools/math/price.d.ts +7 -0
  94. package/build/dex/ekubo/pools/math/price.js +116 -0
  95. package/build/dex/ekubo/pools/math/price.js.map +1 -0
  96. package/build/dex/ekubo/pools/math/swap.d.ts +18 -0
  97. package/build/dex/ekubo/pools/math/swap.js +128 -0
  98. package/build/dex/ekubo/pools/math/swap.js.map +1 -0
  99. package/build/dex/ekubo/pools/math/tick.d.ts +7 -0
  100. package/build/dex/ekubo/pools/math/tick.js +112 -0
  101. package/build/dex/ekubo/pools/math/tick.js.map +1 -0
  102. package/build/dex/ekubo/pools/oracle-pool.d.ts +10 -0
  103. package/build/dex/ekubo/pools/oracle-pool.js +19 -0
  104. package/build/dex/ekubo/pools/oracle-pool.js.map +1 -0
  105. package/build/dex/ekubo/types.d.ts +88 -0
  106. package/build/dex/ekubo/types.js +238 -0
  107. package/build/dex/ekubo/types.js.map +1 -0
  108. package/build/dex/ekubo/utils.d.ts +6 -0
  109. package/build/dex/ekubo/utils.js +30 -0
  110. package/build/dex/ekubo/utils.js.map +1 -0
  111. package/build/dex/generic-rfq/generic-rfq.js +1 -2
  112. package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
  113. package/build/dex/generic-rfq/rate-fetcher.d.ts +4 -1
  114. package/build/dex/generic-rfq/rate-fetcher.js +84 -23
  115. package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
  116. package/build/dex/hashflow/hashflow.js +4 -0
  117. package/build/dex/hashflow/hashflow.js.map +1 -1
  118. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  119. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  120. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  121. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  122. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  123. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  124. package/build/dex/idle-dao/scripts.d.ts +9 -0
  125. package/build/dex/idle-dao/scripts.js +552 -0
  126. package/build/dex/idle-dao/scripts.js.map +1 -0
  127. package/build/dex/inception/config.d.ts +4 -0
  128. package/build/dex/inception/config.js +109 -0
  129. package/build/dex/inception/config.js.map +1 -0
  130. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  131. package/build/dex/inception/inception-event-pool.js +51 -0
  132. package/build/dex/inception/inception-event-pool.js.map +1 -0
  133. package/build/dex/inception/inception-native.d.ts +43 -0
  134. package/build/dex/inception/inception-native.js +131 -0
  135. package/build/dex/inception/inception-native.js.map +1 -0
  136. package/build/dex/inception/inception-pool.d.ts +18 -0
  137. package/build/dex/inception/inception-pool.js +32 -0
  138. package/build/dex/inception/inception-pool.js.map +1 -0
  139. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  140. package/build/dex/inception/inception-price-feed.js +51 -0
  141. package/build/dex/inception/inception-price-feed.js.map +1 -0
  142. package/build/dex/inception/inception.d.ts +43 -0
  143. package/build/dex/inception/inception.js +204 -0
  144. package/build/dex/inception/inception.js.map +1 -0
  145. package/build/dex/inception/tokens.d.ts +9 -0
  146. package/build/dex/inception/tokens.js +28 -0
  147. package/build/dex/inception/tokens.js.map +1 -0
  148. package/build/dex/inception/types.d.ts +22 -0
  149. package/build/dex/inception/types.js +3 -0
  150. package/build/dex/inception/types.js.map +1 -0
  151. package/build/dex/inception/utils.d.ts +6 -0
  152. package/build/dex/inception/utils.js +37 -0
  153. package/build/dex/inception/utils.js.map +1 -0
  154. package/build/dex/platypus/asset.d.ts +14 -0
  155. package/build/dex/platypus/asset.js +97 -0
  156. package/build/dex/platypus/asset.js.map +1 -0
  157. package/build/dex/platypus/config.d.ts +11 -0
  158. package/build/dex/platypus/config.js +69 -0
  159. package/build/dex/platypus/config.js.map +1 -0
  160. package/build/dex/platypus/platypus.d.ts +63 -0
  161. package/build/dex/platypus/platypus.js +473 -0
  162. package/build/dex/platypus/platypus.js.map +1 -0
  163. package/build/dex/platypus/pool-avax.d.ts +8 -0
  164. package/build/dex/platypus/pool-avax.js +54 -0
  165. package/build/dex/platypus/pool-avax.js.map +1 -0
  166. package/build/dex/platypus/pool-base.d.ts +19 -0
  167. package/build/dex/platypus/pool-base.js +86 -0
  168. package/build/dex/platypus/pool-base.js.map +1 -0
  169. package/build/dex/platypus/pool-pure.d.ts +8 -0
  170. package/build/dex/platypus/pool-pure.js +37 -0
  171. package/build/dex/platypus/pool-pure.js.map +1 -0
  172. package/build/dex/platypus/pool-subscriber.d.ts +14 -0
  173. package/build/dex/platypus/pool-subscriber.js +167 -0
  174. package/build/dex/platypus/pool-subscriber.js.map +1 -0
  175. package/build/dex/platypus/pool.d.ts +8 -0
  176. package/build/dex/platypus/pool.js +58 -0
  177. package/build/dex/platypus/pool.js.map +1 -0
  178. package/build/dex/platypus/types.d.ts +92 -0
  179. package/build/dex/platypus/types.js +10 -0
  180. package/build/dex/platypus/types.js.map +1 -0
  181. package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
  182. package/build/dex/quickswap/spiritswap-v3.js +19 -0
  183. package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
  184. package/build/dex/smardex/config.d.ts +4 -0
  185. package/build/dex/smardex/config.js +64 -0
  186. package/build/dex/smardex/config.js.map +1 -0
  187. package/build/dex/smardex/constants.d.ts +18 -0
  188. package/build/dex/smardex/constants.js +33 -0
  189. package/build/dex/smardex/constants.js.map +1 -0
  190. package/build/dex/smardex/sdk/constants.d.ts +6 -0
  191. package/build/dex/smardex/sdk/constants.js +13 -0
  192. package/build/dex/smardex/sdk/constants.js.map +1 -0
  193. package/build/dex/smardex/sdk/core.d.ts +113 -0
  194. package/build/dex/smardex/sdk/core.js +499 -0
  195. package/build/dex/smardex/sdk/core.js.map +1 -0
  196. package/build/dex/smardex/sdk/errors.d.ts +15 -0
  197. package/build/dex/smardex/sdk/errors.js +22 -0
  198. package/build/dex/smardex/sdk/errors.js.map +1 -0
  199. package/build/dex/smardex/sdk/types.d.ts +62 -0
  200. package/build/dex/smardex/sdk/types.js +3 -0
  201. package/build/dex/smardex/sdk/types.js.map +1 -0
  202. package/build/dex/smardex/sdk/utils.d.ts +44 -0
  203. package/build/dex/smardex/sdk/utils.js +133 -0
  204. package/build/dex/smardex/sdk/utils.js.map +1 -0
  205. package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
  206. package/build/dex/smardex/smardex-event-pool.js +119 -0
  207. package/build/dex/smardex/smardex-event-pool.js.map +1 -0
  208. package/build/dex/smardex/smardex.d.ts +65 -0
  209. package/build/dex/smardex/smardex.js +519 -0
  210. package/build/dex/smardex/smardex.js.map +1 -0
  211. package/build/dex/smardex/types.d.ts +55 -0
  212. package/build/dex/smardex/types.js +3 -0
  213. package/build/dex/smardex/types.js.map +1 -0
  214. package/build/dex/solidly/forks-override/cone.d.ts +22 -0
  215. package/build/dex/solidly/forks-override/cone.js +53 -0
  216. package/build/dex/solidly/forks-override/cone.js.map +1 -0
  217. package/build/dex/solidly/forks-override/solisnek.d.ts +8 -0
  218. package/build/dex/solidly/forks-override/solisnek.js +15 -0
  219. package/build/dex/solidly/forks-override/solisnek.js.map +1 -0
  220. package/build/dex/swaap-v1/config.d.ts +17 -0
  221. package/build/dex/swaap-v1/config.js +56 -0
  222. package/build/dex/swaap-v1/config.js.map +1 -0
  223. package/build/dex/swaap-v1/constants.d.ts +6 -0
  224. package/build/dex/swaap-v1/constants.js +17 -0
  225. package/build/dex/swaap-v1/constants.js.map +1 -0
  226. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +25 -0
  227. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +62 -0
  228. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +1 -0
  229. package/build/dex/swaap-v1/libraries/Const.d.ts +18 -0
  230. package/build/dex/swaap-v1/libraries/Const.js +26 -0
  231. package/build/dex/swaap-v1/libraries/Const.js.map +1 -0
  232. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +77 -0
  233. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +316 -0
  234. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +1 -0
  235. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +75 -0
  236. package/build/dex/swaap-v1/libraries/LogExpMath.js +418 -0
  237. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +1 -0
  238. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +185 -0
  239. package/build/dex/swaap-v1/libraries/MathMMM.js +453 -0
  240. package/build/dex/swaap-v1/libraries/MathMMM.js.map +1 -0
  241. package/build/dex/swaap-v1/libraries/Num.d.ts +31 -0
  242. package/build/dex/swaap-v1/libraries/Num.js +167 -0
  243. package/build/dex/swaap-v1/libraries/Num.js.map +1 -0
  244. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +23 -0
  245. package/build/dex/swaap-v1/libraries/PoolQuotations.js +131 -0
  246. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +1 -0
  247. package/build/dex/swaap-v1/libraries/Struct.d.ts +56 -0
  248. package/build/dex/swaap-v1/libraries/Struct.js +3 -0
  249. package/build/dex/swaap-v1/libraries/Struct.js.map +1 -0
  250. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +45 -0
  251. package/build/dex/swaap-v1/swaap-v1-pool.js +656 -0
  252. package/build/dex/swaap-v1/swaap-v1-pool.js.map +1 -0
  253. package/build/dex/swaap-v1/swaap-v1.d.ts +62 -0
  254. package/build/dex/swaap-v1/swaap-v1.js +379 -0
  255. package/build/dex/swaap-v1/swaap-v1.js.map +1 -0
  256. package/build/dex/swaap-v1/types.d.ts +106 -0
  257. package/build/dex/swaap-v1/types.js +9 -0
  258. package/build/dex/swaap-v1/types.js.map +1 -0
  259. package/build/dex/zerox/index.d.ts +1 -1
  260. package/build/dex/zerox/index.js.map +1 -1
  261. package/build/dex-helper/dummy-dex-helper.js +3 -0
  262. package/build/dex-helper/dummy-dex-helper.js.map +1 -1
  263. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  264. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  265. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  266. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  267. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  268. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  269. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  270. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  271. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  272. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  273. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  274. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  275. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  276. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  277. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  278. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  279. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  280. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  281. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  282. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  283. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  284. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  285. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  286. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  287. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  288. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  289. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  290. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  291. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  292. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  293. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  294. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  295. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  296. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  297. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  298. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  299. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  300. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  301. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  302. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  303. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  304. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  305. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  306. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  307. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  308. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  309. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  310. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  311. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  312. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  313. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  314. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  315. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  316. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  317. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  318. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  319. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  320. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  321. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  322. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  323. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  324. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  325. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  326. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  327. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  328. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  329. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  330. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  331. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  332. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  333. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  334. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  335. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  336. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  337. package/build/lib/pub-sub.d.ts +20 -0
  338. package/build/lib/pub-sub.js +112 -4
  339. package/build/lib/pub-sub.js.map +1 -1
  340. package/package.json +2 -2
  341. package/src/abi/balancer-v3/directionalFeeHook.json +677 -677
  342. package/src/abi/balancer-v3/stableSurgeHook.json +975 -975
  343. package/src/dex/aave-v3-stata/config.ts +8 -8
  344. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-e2e.test.ts +5 -5
  345. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2.ts +2 -2
  346. package/src/dex/aave-v3-stata-v2/config.ts +31 -24
  347. package/src/dex/aave-v3-stata-v2/types.ts +3 -2
  348. package/src/dex/aave-v3-stata-v2/utils.ts +18 -10
  349. package/src/dex/generic-rfq/generic-rfq.ts +1 -6
  350. package/src/dex/generic-rfq/rate-fetcher.ts +130 -58
  351. package/src/dex/hashflow/hashflow.ts +12 -0
  352. package/src/dex-helper/dummy-dex-helper.ts +10 -0
  353. package/src/lib/pub-sub.ts +145 -5
  354. package/tests/constants-e2e.ts +10 -0
  355. package/tests/utils-e2e.ts +0 -1
  356. package/.idea/codeStyles/Project.xml +0 -59
  357. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  358. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  359. package/.idea/modules.xml +0 -8
  360. package/.idea/paraswap-dex-lib.iml +0 -12
  361. package/.idea/prettier.xml +0 -7
  362. package/.idea/vcs.xml +0 -6
  363. package/scripts/get-uniswap-v3-dexes.ts +0 -64
@@ -11,6 +11,151 @@ type KeyValuePubSubMsg = {
11
11
 
12
12
  type SetPubSubMsg = string[];
13
13
 
14
+ export class ExpKeyValuePubSub {
15
+ channel: string;
16
+ network: Network;
17
+ localCache: NodeCache = new NodeCache();
18
+
19
+ logger: Logger;
20
+
21
+ private localCacheHits = 0;
22
+ private localCacheMisses = 0;
23
+ private redisCacheHits = 0;
24
+ private redisCacheMisses = 0;
25
+ private cacheLogInterval = parseInt(
26
+ process.env.CACHE_LOG_INTERVAL || '1000',
27
+ 10,
28
+ );
29
+
30
+ constructor(
31
+ private dexHelper: IDexHelper,
32
+ private dexKey: string,
33
+ channel: string,
34
+ private defaultValue?: any,
35
+ private defaultTTL?: number,
36
+ ) {
37
+ this.network = this.dexHelper.config.data.network;
38
+ this.channel = `${this.network}_${this.dexKey}_${channel}`;
39
+
40
+ this.logger = this.dexHelper.getLogger(`ExpKeyValuePubSub_${this.channel}`);
41
+ }
42
+
43
+ subscribe() {
44
+ this.logger.info(
45
+ `Subscribing to ${this.channel} with isSlave=${this.dexHelper.config.isSlave}`,
46
+ );
47
+
48
+ this.dexHelper.cache.subscribe(this.channel, (_, msg) => {
49
+ try {
50
+ const decodedMsg = JSON.parse(msg) as KeyValuePubSubMsg;
51
+ this.handleSubscription(decodedMsg);
52
+ } catch (error: any) {
53
+ this.logger.error(
54
+ `Failed to process pub/sub message: ${error?.message}`,
55
+ {
56
+ channel: this.channel,
57
+ messagePreview: msg.substring(0, 100),
58
+ },
59
+ );
60
+ }
61
+ });
62
+ }
63
+
64
+ publish(data: Record<string, unknown>, ttl: number) {
65
+ const expiresAt = Math.round(Date.now() / 1000) + ttl;
66
+ this.logger.debug(
67
+ `Publishing to ${this.channel} with keys: ${Object.keys(data).join(
68
+ ', ',
69
+ )}, TTL: ${ttl}`,
70
+ );
71
+ this.dexHelper.cache.publish(
72
+ this.channel,
73
+ JSON.stringify({ expiresAt, data }),
74
+ );
75
+ }
76
+
77
+ handleSubscription(msg: KeyValuePubSubMsg) {
78
+ const { expiresAt, data } = msg;
79
+
80
+ const now = Math.round(Date.now() / 1000);
81
+ // calculating ttl as message might come with the delay
82
+ const ttl = expiresAt - now;
83
+
84
+ if (ttl > 0) {
85
+ const keys = Object.keys(data);
86
+ for (const key of keys) {
87
+ this.logger.debug(`Setting local cache for ${key} with TTL ${ttl}`);
88
+ this.localCache.set(key, data[key], ttl);
89
+ }
90
+ } else {
91
+ this.logger.error('Message has expired', {
92
+ now,
93
+ expiresAt,
94
+ diffInSeconds: now - expiresAt,
95
+ keys: Object.keys(data),
96
+ channel: this.channel,
97
+ });
98
+ }
99
+ }
100
+
101
+ async getAndCache<T>(key: string): Promise<T | null> {
102
+ const localValue = this.localCache.get<T>(key);
103
+
104
+ if (localValue) {
105
+ this.localCacheHits++;
106
+ if (this.localCacheHits % this.cacheLogInterval === 0) {
107
+ this.logger.info(
108
+ `Cache stats for ${this.channel}: local hits=${this.localCacheHits}, local misses=${this.localCacheMisses}, redis hits=${this.redisCacheHits}, redis misses=${this.redisCacheMisses}`,
109
+ );
110
+ }
111
+ return localValue;
112
+ }
113
+
114
+ this.localCacheMisses++;
115
+ const cacheKey = `${this.dexKey}_${this.network}_${key}`;
116
+
117
+ this.logger.debug(`Cache miss for ${cacheKey} in local cache`);
118
+
119
+ try {
120
+ const [value, ttl] = await Promise.all([
121
+ this.dexHelper.cache.get(this.dexKey, this.network, key),
122
+ this.dexHelper.cache.ttl(this.dexKey, this.network, key),
123
+ ]);
124
+
125
+ if (value && ttl > 0) {
126
+ this.redisCacheHits++;
127
+ this.logger.debug(`Redis cache hit for ${cacheKey} with TTL ${ttl}`);
128
+ const parsedValue = JSON.parse(value);
129
+ this.localCache.set(key, parsedValue, ttl);
130
+ return parsedValue;
131
+ } else if (value) {
132
+ this.redisCacheMisses++;
133
+ this.logger.warn(
134
+ `Redis cache hit for ${cacheKey} but TTL is ${ttl} (expired)`,
135
+ );
136
+ } else {
137
+ this.redisCacheMisses++;
138
+ this.logger.debug(`Redis cache miss for ${cacheKey}`);
139
+ }
140
+
141
+ if (this.defaultValue && this.defaultTTL && this.defaultTTL > 0) {
142
+ this.logger.debug(
143
+ `Using default value for ${cacheKey} with TTL ${this.defaultTTL}`,
144
+ );
145
+ this.localCache.set(key, this.defaultValue, this.defaultTTL);
146
+ return this.defaultValue;
147
+ }
148
+
149
+ return null;
150
+ } catch (error: any) {
151
+ this.logger.error(
152
+ `Error fetching from Redis for ${cacheKey}: ${error.message}`,
153
+ );
154
+ return null;
155
+ }
156
+ }
157
+ }
158
+
14
159
  export class ExpStringPubSub {
15
160
  channel: string;
16
161
  network: Network;
@@ -193,8 +338,6 @@ export class NonExpSetPubSub {
193
338
  }
194
339
 
195
340
  async initializeAndSubscribe(initialSet: string[]) {
196
- this.logger.info(`initializeAndSubscribe with ${initialSet}`);
197
-
198
341
  for (const member of initialSet) {
199
342
  this.set.add(member);
200
343
  }
@@ -213,14 +356,11 @@ export class NonExpSetPubSub {
213
356
 
214
357
  publish(msg: SetPubSubMsg) {
215
358
  if (msg.length > 0) {
216
- this.logger.info(`Publishing msg: '${msg}'`);
217
359
  this.dexHelper.cache.publish(this.channel, JSON.stringify(msg));
218
360
  }
219
361
  }
220
362
 
221
363
  handleSubscription(set: SetPubSubMsg) {
222
- this.logger.info(`Received subscription msg: '${set}'`);
223
-
224
364
  for (const key of set) {
225
365
  this.set.add(key);
226
366
  }
@@ -1411,6 +1411,14 @@ export const Tokens: {
1411
1411
  address: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
1412
1412
  decimals: 6,
1413
1413
  },
1414
+ stataUSDC: {
1415
+ address: '0x41B334E9F2C0ED1f30fD7c351874a6071C53a78E',
1416
+ decimals: 6,
1417
+ },
1418
+ aOptUSDCn: {
1419
+ address: '0x38d693cE1dF5AaDF7bC62595A37D667aD57922e5',
1420
+ decimals: 6,
1421
+ },
1414
1422
  USDT: {
1415
1423
  address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
1416
1424
  decimals: 6,
@@ -2093,6 +2101,7 @@ export const Holders: {
2093
2101
  POPS: '0x3cbd9044aaabef08ce93a68448e093cff405ad76',
2094
2102
  USDCe: '0xdecc0c09c3b5f6e92ef4184125d5648a66e35298',
2095
2103
  USDC: '0x8aF3827a41c26C7F32C81E93bb66e837e0210D5c',
2104
+ aOptUSDCn: '0x38d693cE1dF5AaDF7bC62595A37D667aD57922e5',
2096
2105
  USDT: '0xf977814e90da44bfa03b6295a0616a897441acec',
2097
2106
  OP: '0xEBb8EA128BbdFf9a1780A4902A9380022371d466',
2098
2107
  aOptWETH: '0x7B7D80C40415F744864f051B806b466e2fbB8E68',
@@ -2112,6 +2121,7 @@ export const Holders: {
2112
2121
  LUSD: '0xf0a9abb11958a071e168f2ee5bcbacf1abbde9cf',
2113
2122
  GRAI: '0x92b051204816DC4fbA7AC1A68a2cf319A9a387CB',
2114
2123
  stataUSDT: '0xd55263b84685Ced7e10a77607C7fFD763D495B6e',
2124
+ stataUSDC: '0x450C01300B83bE379113256038b4Dd3b45d23B5e',
2115
2125
  aaveUSDT: '0x1Fd458C52fEb7Bb35097ebd9566DB6C269341FDD',
2116
2126
  tBTC: '0xf7b4531e52211CC44379102F719cad29411dB053',
2117
2127
  PSTAKE: '0xc45398444B83183b2018e0224B3D332b42D492Af',
@@ -490,7 +490,6 @@ export async function testE2E(
490
490
  }
491
491
 
492
492
  if (paraswap.dexHelper?.replaceProviderWithRPC) {
493
- console.log('ts.rpcURL: ', ts.rpcURL);
494
493
  paraswap.dexHelper?.replaceProviderWithRPC(ts.rpcURL);
495
494
  }
496
495
 
@@ -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>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myConfigurationMode" value="AUTOMATIC" />
5
- <option name="myRunOnSave" value="true" />
6
- </component>
7
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,64 +0,0 @@
1
- import { UniswapV3Config } from '../src/dex/uniswap-v3/config';
2
- import { PancakeswapV3Config } from '../src/dex/pancakeswap-v3/config';
3
- import { constructSimpleSDK } from '@paraswap/sdk';
4
- import { ParaSwapVersion } from '@paraswap/core';
5
- import axios from 'axios';
6
-
7
- const main = async () => {
8
- const network = 1;
9
- const userAddress = '0x75C94990D2Ad92D8da4E0a238d872D09ec16706E';
10
- const srcToken = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
11
- const destToken = '0xdAC17F958D2ee523a2206206994597C13D831ec7';
12
- const amount = '1000000'
13
- const partner = 'paraswap.io';
14
- const prodSdk = constructSimpleSDK({
15
- version: ParaSwapVersion.V6,
16
- chainId: network,
17
- axios,
18
- });
19
-
20
- const ordersSdk = constructSimpleSDK({
21
- version: ParaSwapVersion.V6,
22
- chainId: network,
23
- axios,
24
- apiURL:
25
- 'https://api.orders.paraswap.io'
26
- })
27
-
28
- const priceRoute = await prodSdk.swap.getRate({
29
- srcToken,
30
- destToken,
31
- amount,
32
- options: {
33
- partner
34
- }
35
- })
36
-
37
- console.log(priceRoute);
38
-
39
- const txOrders = await ordersSdk.swap.buildTx({
40
- priceRoute,
41
- srcToken,
42
- destToken,
43
- userAddress,
44
- srcAmount: amount,
45
- slippage: 50,
46
- partner
47
- })
48
-
49
- const txProd = await prodSdk.swap.buildTx({
50
- priceRoute,
51
- srcToken,
52
- destToken,
53
- userAddress,
54
- srcAmount: amount,
55
- slippage: 50,
56
- partner
57
- })
58
-
59
- console.log();
60
- console.log(txOrders);
61
- console.log(txProd);
62
-
63
- }
64
- main().catch(console.log)