@paraswap/dex-lib 2.42.22 → 2.42.23

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 (225) hide show
  1. package/build/abi/hashflow/HashflowRouter.abi.json +816 -246
  2. package/build/abi/kyberswap-elastic/IAntiSnipAttackPositionManager.json +1276 -0
  3. package/build/abi/kyberswap-elastic/IFactory.json +550 -0
  4. package/build/abi/kyberswap-elastic/IPool.json +1042 -0
  5. package/build/abi/kyberswap-elastic/IQuoterV2.json +226 -0
  6. package/build/abi/kyberswap-elastic/IRouter.json +239 -0
  7. package/build/abi/kyberswap-elastic/TicksFeesReader.json +142 -0
  8. package/build/abi/wombat/asset.json +769 -0
  9. package/build/abi/wombat/bmw.json +1247 -0
  10. package/build/abi/wombat/pool.json +1364 -0
  11. package/build/config.js +14 -14
  12. package/build/dex/baseswap-v3/baseswap-v3-factory.d.ts +26 -0
  13. package/build/dex/baseswap-v3/baseswap-v3-factory.js +44 -0
  14. package/build/dex/baseswap-v3/baseswap-v3-factory.js.map +1 -0
  15. package/build/dex/baseswap-v3/baseswap-v3-pool.d.ts +46 -0
  16. package/build/dex/baseswap-v3/baseswap-v3-pool.js +312 -0
  17. package/build/dex/baseswap-v3/baseswap-v3-pool.js.map +1 -0
  18. package/build/dex/baseswap-v3/baseswap-v3.d.ts +71 -0
  19. package/build/dex/baseswap-v3/baseswap-v3.js +752 -0
  20. package/build/dex/baseswap-v3/baseswap-v3.js.map +1 -0
  21. package/build/dex/baseswap-v3/config.d.ts +9 -0
  22. package/build/dex/baseswap-v3/config.js +48 -0
  23. package/build/dex/baseswap-v3/config.js.map +1 -0
  24. package/build/dex/baseswap-v3/constants.d.ts +28 -0
  25. package/build/dex/baseswap-v3/constants.js +35 -0
  26. package/build/dex/baseswap-v3/constants.js.map +1 -0
  27. package/build/dex/baseswap-v3/contract-math/BitMath.d.ts +4 -0
  28. package/build/dex/baseswap-v3/contract-math/BitMath.js +93 -0
  29. package/build/dex/baseswap-v3/contract-math/BitMath.js.map +1 -0
  30. package/build/dex/baseswap-v3/contract-math/FixedPoint128.d.ts +3 -0
  31. package/build/dex/baseswap-v3/contract-math/FixedPoint128.js +8 -0
  32. package/build/dex/baseswap-v3/contract-math/FixedPoint128.js.map +1 -0
  33. package/build/dex/baseswap-v3/contract-math/FixedPoint96.d.ts +4 -0
  34. package/build/dex/baseswap-v3/contract-math/FixedPoint96.js +9 -0
  35. package/build/dex/baseswap-v3/contract-math/FixedPoint96.js.map +1 -0
  36. package/build/dex/baseswap-v3/contract-math/FullMath.d.ts +4 -0
  37. package/build/dex/baseswap-v3/contract-math/FullMath.js +19 -0
  38. package/build/dex/baseswap-v3/contract-math/FullMath.js.map +1 -0
  39. package/build/dex/baseswap-v3/contract-math/LiquidityMath.d.ts +3 -0
  40. package/build/dex/baseswap-v3/contract-math/LiquidityMath.js +22 -0
  41. package/build/dex/baseswap-v3/contract-math/LiquidityMath.js.map +1 -0
  42. package/build/dex/baseswap-v3/contract-math/Oracle.d.ts +10 -0
  43. package/build/dex/baseswap-v3/contract-math/Oracle.js +133 -0
  44. package/build/dex/baseswap-v3/contract-math/Oracle.js.map +1 -0
  45. package/build/dex/baseswap-v3/contract-math/SqrtPriceMath.d.ts +10 -0
  46. package/build/dex/baseswap-v3/contract-math/SqrtPriceMath.js +91 -0
  47. package/build/dex/baseswap-v3/contract-math/SqrtPriceMath.js.map +1 -0
  48. package/build/dex/baseswap-v3/contract-math/SwapMath.d.ts +8 -0
  49. package/build/dex/baseswap-v3/contract-math/SwapMath.js +70 -0
  50. package/build/dex/baseswap-v3/contract-math/SwapMath.js.map +1 -0
  51. package/build/dex/baseswap-v3/contract-math/Tick.d.ts +7 -0
  52. package/build/dex/baseswap-v3/contract-math/Tick.js +45 -0
  53. package/build/dex/baseswap-v3/contract-math/Tick.js.map +1 -0
  54. package/build/dex/baseswap-v3/contract-math/TickBitMap.d.ts +7 -0
  55. package/build/dex/baseswap-v3/contract-math/TickBitMap.js +84 -0
  56. package/build/dex/baseswap-v3/contract-math/TickBitMap.js.map +1 -0
  57. package/build/dex/baseswap-v3/contract-math/TickMath.d.ts +8 -0
  58. package/build/dex/baseswap-v3/contract-math/TickMath.js +162 -0
  59. package/build/dex/baseswap-v3/contract-math/TickMath.js.map +1 -0
  60. package/build/dex/baseswap-v3/contract-math/UnsafeMath.d.ts +3 -0
  61. package/build/dex/baseswap-v3/contract-math/UnsafeMath.js +10 -0
  62. package/build/dex/baseswap-v3/contract-math/UnsafeMath.js.map +1 -0
  63. package/build/dex/baseswap-v3/contract-math/uniswap-v3-math.d.ts +37 -0
  64. package/build/dex/baseswap-v3/contract-math/uniswap-v3-math.js +393 -0
  65. package/build/dex/baseswap-v3/contract-math/uniswap-v3-math.js.map +1 -0
  66. package/build/dex/baseswap-v3/contract-math/utils.d.ts +7 -0
  67. package/build/dex/baseswap-v3/contract-math/utils.js +42 -0
  68. package/build/dex/baseswap-v3/contract-math/utils.js.map +1 -0
  69. package/build/dex/baseswap-v3/types.d.ts +164 -0
  70. package/build/dex/baseswap-v3/types.js +9 -0
  71. package/build/dex/baseswap-v3/types.js.map +1 -0
  72. package/build/dex/baseswap-v3/utils.d.ts +6 -0
  73. package/build/dex/baseswap-v3/utils.js +65 -0
  74. package/build/dex/baseswap-v3/utils.js.map +1 -0
  75. package/build/dex/hashflow/config.d.ts +1 -1
  76. package/build/dex/hashflow/config.js +6 -6
  77. package/build/dex/hashflow/config.js.map +1 -1
  78. package/build/dex/hashflow/hashflow.d.ts +7 -7
  79. package/build/dex/hashflow/hashflow.js +47 -54
  80. package/build/dex/hashflow/hashflow.js.map +1 -1
  81. package/build/dex/hashflow/rate-fetcher.d.ts +1 -1
  82. package/build/dex/hashflow/rate-fetcher.js +2 -4
  83. package/build/dex/hashflow/rate-fetcher.js.map +1 -1
  84. package/build/dex/hashflow/types.d.ts +5 -6
  85. package/build/dex/hashflow/types.js.map +1 -1
  86. package/build/dex/hashflow/validators.js +11 -4
  87. package/build/dex/hashflow/validators.js.map +1 -1
  88. package/build/dex/hello/config.d.ts +4 -0
  89. package/build/dex/hello/config.js +15 -0
  90. package/build/dex/hello/config.js.map +1 -0
  91. package/build/dex/hello/hello-pool.d.ts +39 -0
  92. package/build/dex/hello/hello-pool.js +64 -0
  93. package/build/dex/hello/hello-pool.js.map +1 -0
  94. package/build/dex/hello/hello.d.ts +37 -0
  95. package/build/dex/hello/hello.js +126 -0
  96. package/build/dex/hello/hello.js.map +1 -0
  97. package/build/dex/hello/types.d.ts +6 -0
  98. package/build/dex/hello/types.js +3 -0
  99. package/build/dex/hello/types.js.map +1 -0
  100. package/build/dex/kyberswap-elastic/config.d.ts +4 -0
  101. package/build/dex/kyberswap-elastic/config.js +80 -0
  102. package/build/dex/kyberswap-elastic/config.js.map +1 -0
  103. package/build/dex/kyberswap-elastic/constants.d.ts +17 -0
  104. package/build/dex/kyberswap-elastic/constants.js +42 -0
  105. package/build/dex/kyberswap-elastic/constants.js.map +1 -0
  106. package/build/dex/kyberswap-elastic/contract-math/FixedPoint96.d.ts +4 -0
  107. package/build/dex/kyberswap-elastic/contract-math/FixedPoint96.js +9 -0
  108. package/build/dex/kyberswap-elastic/contract-math/FixedPoint96.js.map +1 -0
  109. package/build/dex/kyberswap-elastic/contract-math/FullMath.d.ts +5 -0
  110. package/build/dex/kyberswap-elastic/contract-math/FullMath.js +22 -0
  111. package/build/dex/kyberswap-elastic/contract-math/FullMath.js.map +1 -0
  112. package/build/dex/kyberswap-elastic/contract-math/LiqDeltaMath.d.ts +3 -0
  113. package/build/dex/kyberswap-elastic/contract-math/LiqDeltaMath.js +12 -0
  114. package/build/dex/kyberswap-elastic/contract-math/LiqDeltaMath.js.map +1 -0
  115. package/build/dex/kyberswap-elastic/contract-math/LiquidityMath.d.ts +3 -0
  116. package/build/dex/kyberswap-elastic/contract-math/LiquidityMath.js +22 -0
  117. package/build/dex/kyberswap-elastic/contract-math/LiquidityMath.js.map +1 -0
  118. package/build/dex/kyberswap-elastic/contract-math/QtyDeltaMath.d.ts +5 -0
  119. package/build/dex/kyberswap-elastic/contract-math/QtyDeltaMath.js +25 -0
  120. package/build/dex/kyberswap-elastic/contract-math/QtyDeltaMath.js.map +1 -0
  121. package/build/dex/kyberswap-elastic/contract-math/QuadMath.d.ts +4 -0
  122. package/build/dex/kyberswap-elastic/contract-math/QuadMath.js +27 -0
  123. package/build/dex/kyberswap-elastic/contract-math/QuadMath.js.map +1 -0
  124. package/build/dex/kyberswap-elastic/contract-math/ReinvestmentMath.d.ts +3 -0
  125. package/build/dex/kyberswap-elastic/contract-math/ReinvestmentMath.js +14 -0
  126. package/build/dex/kyberswap-elastic/contract-math/ReinvestmentMath.js.map +1 -0
  127. package/build/dex/kyberswap-elastic/contract-math/SafeCast.d.ts +8 -0
  128. package/build/dex/kyberswap-elastic/contract-math/SafeCast.js +30 -0
  129. package/build/dex/kyberswap-elastic/contract-math/SafeCast.js.map +1 -0
  130. package/build/dex/kyberswap-elastic/contract-math/SqrtPriceMath.d.ts +10 -0
  131. package/build/dex/kyberswap-elastic/contract-math/SqrtPriceMath.js +91 -0
  132. package/build/dex/kyberswap-elastic/contract-math/SqrtPriceMath.js.map +1 -0
  133. package/build/dex/kyberswap-elastic/contract-math/SwapMath.d.ts +13 -0
  134. package/build/dex/kyberswap-elastic/contract-math/SwapMath.js +188 -0
  135. package/build/dex/kyberswap-elastic/contract-math/SwapMath.js.map +1 -0
  136. package/build/dex/kyberswap-elastic/contract-math/TickLinkedList.d.ts +6 -0
  137. package/build/dex/kyberswap-elastic/contract-math/TickLinkedList.js +41 -0
  138. package/build/dex/kyberswap-elastic/contract-math/TickLinkedList.js.map +1 -0
  139. package/build/dex/kyberswap-elastic/contract-math/TickMath.d.ts +9 -0
  140. package/build/dex/kyberswap-elastic/contract-math/TickMath.js +165 -0
  141. package/build/dex/kyberswap-elastic/contract-math/TickMath.js.map +1 -0
  142. package/build/dex/kyberswap-elastic/contract-math/UnsafeMath.d.ts +3 -0
  143. package/build/dex/kyberswap-elastic/contract-math/UnsafeMath.js +10 -0
  144. package/build/dex/kyberswap-elastic/contract-math/UnsafeMath.js.map +1 -0
  145. package/build/dex/kyberswap-elastic/contract-math/kyberswap-elastic-math.d.ts +28 -0
  146. package/build/dex/kyberswap-elastic/contract-math/kyberswap-elastic-math.js +502 -0
  147. package/build/dex/kyberswap-elastic/contract-math/kyberswap-elastic-math.js.map +1 -0
  148. package/build/dex/kyberswap-elastic/contract-math/utils.d.ts +3 -0
  149. package/build/dex/kyberswap-elastic/contract-math/utils.js +16 -0
  150. package/build/dex/kyberswap-elastic/contract-math/utils.js.map +1 -0
  151. package/build/dex/kyberswap-elastic/errors.d.ts +2 -0
  152. package/build/dex/kyberswap-elastic/errors.js +6 -0
  153. package/build/dex/kyberswap-elastic/errors.js.map +1 -0
  154. package/build/dex/kyberswap-elastic/kyberswap-elastic-pool.d.ts +80 -0
  155. package/build/dex/kyberswap-elastic/kyberswap-elastic-pool.js +458 -0
  156. package/build/dex/kyberswap-elastic/kyberswap-elastic-pool.js.map +1 -0
  157. package/build/dex/kyberswap-elastic/kyberswap-elastic.d.ts +53 -0
  158. package/build/dex/kyberswap-elastic/kyberswap-elastic.js +610 -0
  159. package/build/dex/kyberswap-elastic/kyberswap-elastic.js.map +1 -0
  160. package/build/dex/kyberswap-elastic/types.d.ts +134 -0
  161. package/build/dex/kyberswap-elastic/types.js +9 -0
  162. package/build/dex/kyberswap-elastic/types.js.map +1 -0
  163. package/build/dex/kyberswap-elastic/utils/decoders.d.ts +9 -0
  164. package/build/dex/kyberswap-elastic/utils/decoders.js +78 -0
  165. package/build/dex/kyberswap-elastic/utils/decoders.js.map +1 -0
  166. package/build/dex/morphex/config.d.ts +11 -0
  167. package/build/dex/morphex/config.js +43 -0
  168. package/build/dex/morphex/config.js.map +1 -0
  169. package/build/dex/morphex/morphex.d.ts +25 -0
  170. package/build/dex/morphex/morphex.js +19 -0
  171. package/build/dex/morphex/morphex.js.map +1 -0
  172. package/build/dex/my-test-dex/config.d.ts +4 -0
  173. package/build/dex/my-test-dex/config.js +15 -0
  174. package/build/dex/my-test-dex/config.js.map +1 -0
  175. package/build/dex/my-test-dex/my-test-dex-pool.d.ts +39 -0
  176. package/build/dex/my-test-dex/my-test-dex-pool.js +64 -0
  177. package/build/dex/my-test-dex/my-test-dex-pool.js.map +1 -0
  178. package/build/dex/my-test-dex/my-test-dex.d.ts +37 -0
  179. package/build/dex/my-test-dex/my-test-dex.js +126 -0
  180. package/build/dex/my-test-dex/my-test-dex.js.map +1 -0
  181. package/build/dex/my-test-dex/types.d.ts +6 -0
  182. package/build/dex/my-test-dex/types.js +3 -0
  183. package/build/dex/my-test-dex/types.js.map +1 -0
  184. package/build/dex/solidly/forks-override/fvm.d.ts +20 -0
  185. package/build/dex/solidly/forks-override/fvm.js +42 -0
  186. package/build/dex/solidly/forks-override/fvm.js.map +1 -0
  187. package/build/dex/wombat/config.d.ts +4 -0
  188. package/build/dex/wombat/config.js +99 -0
  189. package/build/dex/wombat/config.js.map +1 -0
  190. package/build/dex/wombat/types.d.ts +33 -0
  191. package/build/dex/wombat/types.js +3 -0
  192. package/build/dex/wombat/types.js.map +1 -0
  193. package/build/dex/wombat/utils.d.ts +9 -0
  194. package/build/dex/wombat/utils.js +66 -0
  195. package/build/dex/wombat/utils.js.map +1 -0
  196. package/build/dex/wombat/wombat-bmw.d.ts +40 -0
  197. package/build/dex/wombat/wombat-bmw.js +147 -0
  198. package/build/dex/wombat/wombat-bmw.js.map +1 -0
  199. package/build/dex/wombat/wombat-pool.d.ts +22 -0
  200. package/build/dex/wombat/wombat-pool.js +161 -0
  201. package/build/dex/wombat/wombat-pool.js.map +1 -0
  202. package/build/dex/wombat/wombat-quoter.d.ts +16 -0
  203. package/build/dex/wombat/wombat-quoter.js +176 -0
  204. package/build/dex/wombat/wombat-quoter.js.map +1 -0
  205. package/build/dex/wombat/wombat.d.ts +55 -0
  206. package/build/dex/wombat/wombat.js +290 -0
  207. package/build/dex/wombat/wombat.js.map +1 -0
  208. package/build/lib/fetcher/fetcher.d.ts +1 -1
  209. package/build/lib/fetcher/fetcher.js.map +1 -1
  210. package/package.json +2 -2
  211. package/src/abi/hashflow/HashflowRouter.abi.json +816 -246
  212. package/src/config.ts +14 -14
  213. package/src/dex/hashflow/config.ts +8 -8
  214. package/src/dex/hashflow/hashflow-e2e.test.ts +4 -4
  215. package/src/dex/hashflow/hashflow-integration.test.ts +9 -6
  216. package/src/dex/hashflow/hashflow.ts +70 -87
  217. package/src/dex/hashflow/rate-fetcher.ts +6 -8
  218. package/src/dex/hashflow/types.ts +5 -6
  219. package/src/dex/hashflow/validators.ts +11 -4
  220. package/src/lib/fetcher/fetcher.ts +2 -2
  221. package/tests/constants-e2e.ts +1 -1
  222. package/tests/tenderly-simulation.ts +5 -2
  223. package/.vscode/launch.json +0 -39
  224. package/.vscode/settings.json +0 -2
  225. package/.vscode/tasks.json +0 -15
package/src/config.ts CHANGED
@@ -51,9 +51,9 @@ const baseConfigs: { [network: number]: BaseConfig } = {
51
51
  adapterAddresses: {
52
52
  Adapter01: '0x9bE264469eF954c139Da4A45Cf76CbCC5e3A6A73',
53
53
  Adapter02: '0xFC2Ba6E830a04C25e207B8214b26d8C713F6881F',
54
- Adapter03: '0xfb2a3de6c7B8c77b520E3da16021f3D8A4E93168',
54
+ Adapter03: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
55
55
  Adapter04: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
56
- BuyAdapter: '0x1310dE2C69e9753bee19B5522bad39c5f788efd9',
56
+ BuyAdapter: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
57
57
  BuyAdapter02: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
58
58
  },
59
59
  uniswapV2ExchangeRouterAddress:
@@ -165,8 +165,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
165
165
  process.env[`HASHFLOW_DISABLED_MMS_56`]?.split(',') || [],
166
166
  adapterAddresses: {
167
167
  BscAdapter01: '0xA31d9C571DF00e0F428B0bD24c34D103E8112222',
168
- BscAdapter02: '0xEECA9223063bD13e8ca77ed9e39a07f2BD1923E6',
169
- BscBuyAdapter: '0x301c2813e3ceb43A448a12f21551EDBcdC37F157',
168
+ BscAdapter02: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
169
+ BscBuyAdapter: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
170
170
  },
171
171
  rpcPollingMaxAllowedStateDelayInBlocks: 1,
172
172
  rpcPollingBlocksBackToTriggerUpdate: 1,
@@ -193,8 +193,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
193
193
  process.env[`HASHFLOW_DISABLED_MMS_137`]?.split(',') || [],
194
194
  adapterAddresses: {
195
195
  PolygonAdapter01: '0xE44769f42E1e9592f86B82f206407a8f7C84b4ed',
196
- PolygonAdapter02: '0x654cD2Cf97D23059B3db4FaA38BB2b1F8351211d',
197
- PolygonBuyAdapter: '0x4426a1F87Ee7e366542c58e29c02AFa2b5878b37',
196
+ PolygonAdapter02: '0xEECA9223063bD13e8ca77ed9e39a07f2BD1923E6',
197
+ PolygonBuyAdapter: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
198
198
  },
199
199
  uniswapV2ExchangeRouterAddress:
200
200
  '0xf3938337F7294fEf84e9B2c6D548A93F956Cc281',
@@ -224,8 +224,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
224
224
  dexalotAuthToken: process.env.API_KEY_DEXALOT_AUTH_TOKEN || '',
225
225
  adapterAddresses: {
226
226
  AvalancheAdapter01: '0x745Ec73855CeC7249E5fF4c9DD81cc65b4D297a9',
227
- AvalancheAdapter02: '0x2cdB0cDc2a9321ac2ED5b741828a5216C265Be80',
228
- AvalancheBuyAdapter: '0x9Aa41A24A10af2a965A6D406b913a7Cd9C6886ea',
227
+ AvalancheAdapter02: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
228
+ AvalancheBuyAdapter: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
229
229
  },
230
230
  uniswapV2ExchangeRouterAddress:
231
231
  '0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
@@ -280,9 +280,9 @@ const baseConfigs: { [network: number]: BaseConfig } = {
280
280
  hashFlowDisabledMMs:
281
281
  process.env[`HASHFLOW_DISABLED_MMS_42161`]?.split(',') || [],
282
282
  adapterAddresses: {
283
- ArbitrumAdapter01: '0xD8134ACfc9c71Ab51452b5bA23A31354F4739032',
284
- ArbitrumAdapter02: '0x7b0c7f946c845bb0d43ad41ece7027e1fc11bea7',
285
- ArbitrumBuyAdapter: '0xEECA9223063bD13e8ca77ed9e39a07f2BD1923E6',
283
+ ArbitrumAdapter01: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
284
+ ArbitrumAdapter02: '0xe9166234DFB6d3ec05C82404109C02Ca82b16c22',
285
+ ArbitrumBuyAdapter: '0xe53d24CD81cC81bbf271AD7B02D0d67f851D727c',
286
286
  },
287
287
  uniswapV2ExchangeRouterAddress:
288
288
  '0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
@@ -310,8 +310,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
310
310
  process.env[`HASHFLOW_DISABLED_MMS_10`]?.split(',') || [],
311
311
 
312
312
  adapterAddresses: {
313
- OptimismAdapter01: '0x3ad7f275E27AC579cA88e0b4765828242A9E8C49',
314
- OptimismBuyAdapter: '0xfdDD975FE4c1af20c24A3Ad2b33e8609a62DDC73',
313
+ OptimismAdapter01: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
314
+ OptimismBuyAdapter: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
315
315
  },
316
316
  uniswapV2ExchangeRouterAddress:
317
317
  '0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
@@ -366,7 +366,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
366
366
  hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
367
367
  hashFlowDisabledMMs: [],
368
368
  adapterAddresses: {
369
- BaseAdapter01: '0x30F6B9b6485ff0B67E881f5ac80D3F1c70A4B23d',
369
+ BaseAdapter01: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
370
370
  BaseBuyAdapter: '0xB11bCA7B01b425afD0743A4D77B4f593883f94C0',
371
371
  },
372
372
  uniswapV2ExchangeRouterAddress:
@@ -1,26 +1,26 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap, AdapterMappings } from '../../types';
3
1
  import { Network, SwapSide } from '../../constants';
2
+ import { AdapterMappings, DexConfigMap } from '../../types';
3
+ import { DexParams } from './types';
4
4
 
5
5
  export const HashflowConfig: DexConfigMap<DexParams> = {
6
6
  Hashflow: {
7
7
  [Network.MAINNET]: {
8
- routerAddress: '0xf6a94dfd0e6ea9ddfdffe4762ad4236576136613',
8
+ routerAddress: '0x55084eE0fEf03f14a305cd24286359A35D735151',
9
9
  },
10
10
  [Network.POLYGON]: {
11
- routerAddress: '0x72550597dc0b2e0bec24e116add353599eff2e35',
11
+ routerAddress: '0x55084eE0fEf03f14a305cd24286359A35D735151',
12
12
  },
13
13
  [Network.BSC]: {
14
- routerAddress: '0x0acffb0fb2cddd9bd35d03d359f3d899e32facc9',
14
+ routerAddress: '0x55084eE0fEf03f14a305cd24286359A35D735151',
15
15
  },
16
16
  [Network.ARBITRUM]: {
17
- routerAddress: '0x1f772fa3bc263160ea09bb16ce1a6b8fc0fab36a',
17
+ routerAddress: '0x55084eE0fEf03f14a305cd24286359A35D735151',
18
18
  },
19
19
  [Network.AVALANCHE]: {
20
- routerAddress: '0x64d2f9f44fe26c157d552ae7eaa613ca6587b59e',
20
+ routerAddress: '0x55084eE0fEf03f14a305cd24286359A35D735151',
21
21
  },
22
22
  [Network.OPTIMISM]: {
23
- routerAddress: '0xb3999f658c0391d94a37f7ff328f3fec942bcadc',
23
+ routerAddress: '0xCa310B1B942A30Ff4b40a5E1b69AB4607eC79Bc1',
24
24
  },
25
25
  },
26
26
  };
@@ -1,15 +1,15 @@
1
1
  import dotenv from 'dotenv';
2
2
  dotenv.config();
3
3
 
4
- import { testE2E } from '../../../tests/utils-e2e';
4
+ import { StaticJsonRpcProvider } from '@ethersproject/providers';
5
5
  import {
6
- Tokens,
7
6
  Holders,
8
7
  NativeTokenSymbols,
8
+ Tokens,
9
9
  } from '../../../tests/constants-e2e';
10
- import { Network, ContractMethod, SwapSide } from '../../constants';
11
- import { StaticJsonRpcProvider } from '@ethersproject/providers';
10
+ import { testE2E } from '../../../tests/utils-e2e';
12
11
  import { generateConfig } from '../../config';
12
+ import { ContractMethod, Network, SwapSide } from '../../constants';
13
13
 
14
14
  // Give time for rate fetcher to fill the cache
15
15
  const sleepMs = 3000;
@@ -2,16 +2,17 @@
2
2
  import dotenv from 'dotenv';
3
3
  dotenv.config();
4
4
 
5
- import { DummyDexHelper } from '../../dex-helper/index';
6
- import { Network, SwapSide } from '../../constants';
7
- import { BI_POWS } from '../../bigint-constants';
8
- import { Hashflow } from './hashflow';
5
+ import { Tokens } from '../../../tests/constants-e2e';
9
6
  import {
7
+ checkConstantPoolPrices,
10
8
  checkPoolPrices,
11
9
  checkPoolsLiquidity,
12
- checkConstantPoolPrices,
10
+ sleep,
13
11
  } from '../../../tests/utils';
14
- import { Tokens } from '../../../tests/constants-e2e';
12
+ import { BI_POWS } from '../../bigint-constants';
13
+ import { Network, SwapSide } from '../../constants';
14
+ import { DummyDexHelper } from '../../dex-helper/index';
15
+ import { Hashflow } from './hashflow';
15
16
 
16
17
  async function testPricingOnNetwork(
17
18
  hashflow: Hashflow,
@@ -104,6 +105,8 @@ describe('Hashflow', function () {
104
105
  beforeAll(async () => {
105
106
  blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
106
107
  hashflow = new Hashflow(network, dexKey, dexHelper);
108
+ await hashflow.initializePricing(0);
109
+ await sleep(5000);
107
110
  });
108
111
 
109
112
  it('getPoolIdentifiers and getPricesVolume SELL', async function () {
@@ -1,62 +1,61 @@
1
+ import { ChainId, ZERO_ADDRESS } from '@hashflow/sdk';
2
+ import { Chain, ChainType, HashflowApi } from '@hashflow/taker-js';
1
3
  import {
2
- Token,
4
+ MarketMakersResponse,
5
+ PriceLevelsResponse,
6
+ RfqResponse,
7
+ } from '@hashflow/taker-js/dist/types/rest';
8
+ import BigNumber from 'bignumber.js';
9
+ import { Interface } from 'ethers/lib/utils';
10
+ import { assert } from 'ts-essentials';
11
+ import routerAbi from '../../abi/hashflow/HashflowRouter.abi.json';
12
+ import { BI_MAX_UINT256 } from '../../bigint-constants';
13
+ import { BN_0, BN_1, getBigNumberPow } from '../../bignumber-constants';
14
+ import * as CALLDATA_GAS_COST from '../../calldata-gas-cost';
15
+ import {
16
+ CACHE_PREFIX,
17
+ ETHER_ADDRESS,
18
+ Network,
19
+ SwapSide,
20
+ } from '../../constants';
21
+ import { IDexHelper } from '../../dex-helper/idex-helper';
22
+ import { IDex } from '../../dex/idex';
23
+ import {
24
+ AdapterExchangeParam,
3
25
  Address,
4
26
  ExchangePrices,
5
- PoolPrices,
6
- AdapterExchangeParam,
7
- SimpleExchangeParam,
8
- PoolLiquidity,
9
- Logger,
10
27
  ExchangeTxInfo,
28
+ Logger,
11
29
  OptimalSwapExchange,
30
+ PoolLiquidity,
31
+ PoolPrices,
12
32
  PreprocessTransactionOptions,
33
+ SimpleExchangeParam,
34
+ Token,
13
35
  } from '../../types';
14
- import {
15
- SwapSide,
16
- Network,
17
- ETHER_ADDRESS,
18
- CACHE_PREFIX,
19
- } from '../../constants';
20
- import * as CALLDATA_GAS_COST from '../../calldata-gas-cost';
21
36
  import { getDexKeysWithNetwork } from '../../utils';
22
- import { IDex } from '../../dex/idex';
23
- import { IDexHelper } from '../../dex-helper/idex-helper';
24
- import {
25
- HashflowData,
26
- PriceLevel,
27
- RfqError,
28
- RFQType,
29
- SlippageCheckError,
30
- } from './types';
37
+ import { TooStrictSlippageCheckError } from '../generic-rfq/types';
31
38
  import { SimpleExchange } from '../simple-exchange';
32
39
  import { Adapters, HashflowConfig } from './config';
33
- import { HashflowApi } from '@hashflow/taker-js';
34
- import { RateFetcher } from './rate-fetcher';
35
- import routerAbi from '../../abi/hashflow/HashflowRouter.abi.json';
36
- import BigNumber from 'bignumber.js';
37
- import { BN_0, BN_1, getBigNumberPow } from '../../bignumber-constants';
38
- import { Interface } from 'ethers/lib/utils';
39
- import { ChainId, ZERO_ADDRESS } from '@hashflow/sdk';
40
- import {
41
- MarketMakersResponse,
42
- PriceLevelsResponse,
43
- RfqResponse,
44
- } from '@hashflow/taker-js/dist/types/rest';
45
- import { assert } from 'ts-essentials';
46
40
  import {
47
- HASHFLOW_BLACKLIST_TTL_S,
48
- HASHFLOW_MM_RESTRICT_TTL_S,
49
41
  HASHFLOW_API_CLIENT_NAME,
50
- HASHFLOW_API_URL,
51
- HASHFLOW_API_PRICES_POLLING_INTERVAL_MS,
52
42
  HASHFLOW_API_MARKET_MAKERS_POLLING_INTERVAL_MS,
53
- HASHFLOW_PRICES_CACHES_TTL_S,
54
- HASHFLOW_MARKET_MAKERS_CACHES_TTL_S,
43
+ HASHFLOW_API_PRICES_POLLING_INTERVAL_MS,
44
+ HASHFLOW_API_URL,
45
+ HASHFLOW_BLACKLIST_TTL_S,
55
46
  HASHFLOW_GAS_COST,
47
+ HASHFLOW_MARKET_MAKERS_CACHES_TTL_S,
56
48
  HASHFLOW_MIN_SLIPPAGE_FACTOR_THRESHOLD_FOR_RESTRICTION,
49
+ HASHFLOW_MM_RESTRICT_TTL_S,
50
+ HASHFLOW_PRICES_CACHES_TTL_S,
57
51
  } from './constants';
58
- import { BI_MAX_UINT256 } from '../../bigint-constants';
59
- import { TooStrictSlippageCheckError } from '../generic-rfq/types';
52
+ import { RateFetcher } from './rate-fetcher';
53
+ import {
54
+ HashflowData,
55
+ PriceLevel,
56
+ RfqError,
57
+ SlippageCheckError,
58
+ } from './types';
60
59
 
61
60
  export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
62
61
  readonly isStatePollingDex = true;
@@ -121,19 +120,21 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
121
120
  markerMakersIntervalMs:
122
121
  HASHFLOW_API_MARKET_MAKERS_POLLING_INTERVAL_MS,
123
122
  marketMakersReqParams: {
124
- url: `${HASHFLOW_API_URL}/taker/v1/marketMakers`,
123
+ url: `${HASHFLOW_API_URL}/taker/v3/market-makers`,
125
124
  params: {
126
- networkId: this.network,
125
+ baseChainId: this.network,
127
126
  source: HASHFLOW_API_CLIENT_NAME,
127
+ baseChainType: 'evm',
128
128
  },
129
129
  headers: { Authorization: this.hashFlowAuthToken },
130
130
  },
131
131
  pricesReqParams: {
132
- url: `${HASHFLOW_API_URL}/taker/v2/price-levels`,
132
+ url: `${HASHFLOW_API_URL}/taker/v3/price-levels`,
133
133
  params: {
134
- networkId: this.network,
134
+ baseChainId: this.network,
135
135
  source: HASHFLOW_API_CLIENT_NAME,
136
136
  marketMakers: [],
137
+ baseChainType: 'evm',
137
138
  },
138
139
  headers: { Authorization: this.hashFlowAuthToken },
139
140
  },
@@ -321,8 +322,8 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
321
322
  priceLevels: PriceLevel[],
322
323
  ): { level: BigNumber; price: BigNumber }[] =>
323
324
  priceLevels.map(l => ({
324
- level: new BigNumber(l.level),
325
- price: new BigNumber(l.price),
325
+ level: new BigNumber(l.q),
326
+ price: new BigNumber(l.p),
326
327
  }));
327
328
 
328
329
  computeLevelsQuote(
@@ -488,7 +489,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
488
489
  new BigNumber(a.toString()).dividedBy(divider),
489
490
  );
490
491
  const firstLevelRaw = levels[0];
491
- const firstLevelAmountBN = new BigNumber(firstLevelRaw.level);
492
+ const firstLevelAmountBN = new BigNumber(firstLevelRaw.q);
492
493
 
493
494
  if (amountsRaw[amountsRaw.length - 1].lt(firstLevelAmountBN)) {
494
495
  return null;
@@ -496,7 +497,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
496
497
 
497
498
  if (firstLevelAmountBN.gt(0)) {
498
499
  // Add zero level for price computation
499
- levels.unshift({ level: '0', price: firstLevelRaw.price });
500
+ levels.unshift({ q: '0', p: firstLevelRaw.p });
500
501
  }
501
502
 
502
503
  const unitPrice = this.computePricesFromLevels(
@@ -565,14 +566,15 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
565
566
  `${this.dexKey}-${this.network}: MM was not provided in data`,
566
567
  );
567
568
  const chainId = this.network as ChainId;
568
-
569
+ let chainType: ChainType = 'evm';
570
+ const chain: Chain = { chainType, chainId };
569
571
  const normalizedSrcToken = this.normalizeToken(srcToken);
570
572
  const normalizedDestToken = this.normalizeToken(destToken);
571
573
 
572
574
  let rfq: RfqResponse;
573
575
  try {
574
576
  rfq = await this.api.requestQuote({
575
- chainId,
577
+ baseChain: chain,
576
578
  baseToken: normalizedSrcToken.address,
577
579
  quoteToken: normalizedDestToken.address,
578
580
  ...(side === SwapSide.SELL
@@ -594,7 +596,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
594
596
  )}: ${JSON.stringify(rfq)}`;
595
597
  this.logger.warn(message);
596
598
  throw new RfqError(message);
597
- } else if (!rfq.quoteData) {
599
+ } else if (!rfq.quotes[0].quoteData) {
598
600
  const message = `${this.dexKey}-${
599
601
  this.network
600
602
  }: Failed to fetch RFQ for ${this.getPairName(
@@ -603,7 +605,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
603
605
  )}. Missing quote data`;
604
606
  this.logger.warn(message);
605
607
  throw new RfqError(message);
606
- } else if (!rfq.signature) {
608
+ } else if (!rfq.quotes[0].signature) {
607
609
  const message = `${this.dexKey}-${
608
610
  this.network
609
611
  }: Failed to fetch RFQ for ${this.getPairName(
@@ -612,40 +614,22 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
612
614
  )}. Missing signature`;
613
615
  this.logger.warn(message);
614
616
  throw new RfqError(message);
615
- } else if (!rfq.gasEstimate) {
616
- const message = `${this.dexKey}-${
617
- this.network
618
- }: Failed to fetch RFQ for ${this.getPairName(
619
- normalizedSrcToken.address,
620
- normalizedDestToken.address,
621
- )}. No gas estimate.`;
622
- this.logger.warn(message);
623
- throw new RfqError(message);
624
- } else if (rfq.quoteData.rfqType !== RFQType.RFQT) {
625
- const message = `${this.dexKey}-${
626
- this.network
627
- }: Failed to fetch RFQ for ${this.getPairName(
628
- normalizedSrcToken.address,
629
- normalizedDestToken.address,
630
- )}. Invalid RFQ type.`;
631
- this.logger.warn(message);
632
- throw new RfqError(message);
633
617
  }
634
618
 
635
619
  assert(
636
- rfq.quoteData.baseToken === normalizedSrcToken.address,
637
- `QuoteData baseToken=${rfq.quoteData.baseToken} is different from srcToken=${normalizedSrcToken.address}`,
620
+ rfq.quotes[0].quoteData.baseToken === normalizedSrcToken.address,
621
+ `QuoteData baseToken=${rfq.quotes[0].quoteData.baseToken} is different from srcToken=${normalizedSrcToken.address}`,
638
622
  );
639
623
  assert(
640
- rfq.quoteData.quoteToken === normalizedDestToken.address,
641
- `QuoteData baseToken=${rfq.quoteData.quoteToken} is different from srcToken=${normalizedDestToken.address}`,
624
+ rfq.quotes[0].quoteData.quoteToken === normalizedDestToken.address,
625
+ `QuoteData baseToken=${rfq.quotes[0].quoteData.quoteToken} is different from srcToken=${normalizedDestToken.address}`,
642
626
  );
643
627
 
644
- const expiryAsBigInt = BigInt(rfq.quoteData.quoteExpiry);
628
+ const expiryAsBigInt = BigInt(rfq.quotes[0].quoteData.quoteExpiry);
645
629
  const minDeadline = expiryAsBigInt > 0 ? expiryAsBigInt : BI_MAX_UINT256;
646
630
 
647
- const baseTokenAmount = BigInt(rfq.quoteData.baseTokenAmount);
648
- const quoteTokenAmount = BigInt(rfq.quoteData.quoteTokenAmount);
631
+ const baseTokenAmount = BigInt(rfq.quotes[0].quoteData.baseTokenAmount);
632
+ const quoteTokenAmount = BigInt(rfq.quotes[0].quoteData.quoteTokenAmount);
649
633
 
650
634
  const srcAmount = BigInt(optimalSwapExchange.srcAmount);
651
635
  const destAmount = BigInt(optimalSwapExchange.destAmount);
@@ -721,9 +705,8 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
721
705
  ...optimalSwapExchange,
722
706
  data: {
723
707
  mm,
724
- quoteData: rfq.quoteData,
725
- signature: rfq.signature,
726
- gasEstimate: rfq.gasEstimate,
708
+ quoteData: rfq.quotes[0].quoteData,
709
+ signature: rfq.quotes[0].signature,
727
710
  },
728
711
  },
729
712
  { deadline: minDeadline },
@@ -818,7 +801,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
818
801
  {
819
802
  pool: quoteData.pool,
820
803
  quoteToken: quoteData.quoteToken,
821
- externalAccount: quoteData.eoa ?? ZERO_ADDRESS,
804
+ externalAccount: quoteData.externalAccount ?? ZERO_ADDRESS,
822
805
  baseTokenAmount: quoteData.baseTokenAmount,
823
806
  quoteTokenAmount: quoteData.quoteTokenAmount,
824
807
  quoteExpiry: quoteData.quoteExpiry,
@@ -879,10 +862,10 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
879
862
  );
880
863
 
881
864
  // Encode here the transaction arguments
882
- const swapData = this.routerInterface.encodeFunctionData('tradeSingleHop', [
865
+ const swapData = this.routerInterface.encodeFunctionData('tradeRFQT', [
883
866
  [
884
867
  quoteData.pool,
885
- quoteData.eoa ?? ZERO_ADDRESS,
868
+ quoteData.externalAccount ?? ZERO_ADDRESS,
886
869
  quoteData.trader,
887
870
  quoteData.effectiveTrader ?? quoteData.trader,
888
871
  quoteData.baseToken,
@@ -924,7 +907,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
924
907
  levels: PriceLevel[],
925
908
  baseTokenPriceUsd: number,
926
909
  ): number => {
927
- const maxLevel = new BigNumber(levels[levels.length - 1]?.level ?? '0');
910
+ const maxLevel = new BigNumber(levels[levels.length - 1]?.q ?? '0');
928
911
  return maxLevel.multipliedBy(baseTokenPriceUsd).toNumber();
929
912
  };
930
913
 
@@ -1,14 +1,14 @@
1
+ import { Network } from '../../constants';
1
2
  import { IDexHelper } from '../../dex-helper';
2
3
  import { Fetcher, SkippingRequest } from '../../lib/fetcher/fetcher';
3
4
  import { validateAndCast } from '../../lib/validators';
4
5
  import { Logger } from '../../types';
5
6
  import {
7
+ HashflowMarketMakersResponse,
6
8
  HashflowRateFetcherConfig,
7
9
  HashflowRatesResponse,
8
- HashflowMarketMakersResponse,
9
10
  } from './types';
10
- import { pricesResponseValidator, marketMakersValidator } from './validators';
11
- import { Network } from '../../constants';
11
+ import { marketMakersValidator, pricesResponseValidator } from './validators';
12
12
 
13
13
  export class RateFetcher {
14
14
  private rateFetcher: Fetcher<HashflowRatesResponse>;
@@ -30,7 +30,6 @@ export class RateFetcher {
30
30
  this.pricesCacheTTL = config.rateConfig.pricesCacheTTLSecs;
31
31
  this.marketMakersCacheKey = config.rateConfig.marketMakersCacheKey;
32
32
  this.marketMakersCacheTTL = config.rateConfig.marketMakersCacheTTLSecs;
33
-
34
33
  this.marketMakersFetcher = new Fetcher<HashflowMarketMakersResponse>(
35
34
  dexHelper.httpRequest,
36
35
  {
@@ -69,10 +68,9 @@ export class RateFetcher {
69
68
  );
70
69
  }
71
70
 
72
- const prices = await dexHelper.httpRequest.request({
73
- ...options,
74
- params: { ...options.params, marketMakers: filteredMarketMakers },
75
- });
71
+ options.params.marketMakers = filteredMarketMakers;
72
+
73
+ const prices = await dexHelper.httpRequest.request(options);
76
74
 
77
75
  return prices;
78
76
  },
@@ -1,11 +1,10 @@
1
- import { QuoteData } from '@hashflow/taker-js/dist/types/common';
1
+ import { Chain, QuoteData } from '@hashflow/taker-js/dist/types/common';
2
2
  import { RequestHeaders } from '../../dex-helper';
3
3
 
4
4
  export type HashflowData = {
5
5
  mm: string;
6
6
  quoteData?: QuoteData;
7
7
  signature?: string;
8
- gasEstimate?: number;
9
8
  };
10
9
 
11
10
  export type DexParams = {
@@ -13,8 +12,8 @@ export type DexParams = {
13
12
  };
14
13
 
15
14
  export interface PriceLevel {
16
- level: string;
17
- price: string;
15
+ q: string;
16
+ p: string;
18
17
  }
19
18
 
20
19
  export class RfqError extends Error {}
@@ -29,7 +28,6 @@ export class SlippageCheckError extends Error {}
29
28
  export type HashflowRatesLevel = {
30
29
  pair: Record<string, string>;
31
30
  levels: Array<Record<string, string>>;
32
- includesFees: boolean;
33
31
  };
34
32
 
35
33
  export type HashflowMarketMakersResponse = {
@@ -38,7 +36,8 @@ export type HashflowMarketMakersResponse = {
38
36
 
39
37
  export type HashflowRatesResponse = {
40
38
  status: string;
41
- networkId: string;
39
+ baseChain: Chain;
40
+ quoteChain: Chain;
42
41
  levels: Record<string, Array<HashflowRatesLevel>>;
43
42
  };
44
43
 
@@ -12,17 +12,24 @@ export const levelValidator = joi.array().items(
12
12
  }),
13
13
  levels: joi.array().items(
14
14
  joi.object({
15
- level: joi.string().min(1).required(),
16
- price: joi.string().min(1).required(),
15
+ q: joi.string().min(1).required(),
16
+ p: joi.string().min(1).required(),
17
17
  }),
18
18
  ),
19
- includesFees: joi.boolean().required(),
20
19
  }),
21
20
  );
22
21
 
23
22
  export const pricesResponseValidator = joi.object({
24
23
  status: joi.string().required(),
25
- networkId: joi.number().required(),
24
+ // networkId: joi.number().required(),
25
+ baseChain: joi.object({
26
+ chainType: joi.string().required(),
27
+ chainId: joi.number().required(),
28
+ }),
29
+ quoteChain: joi.object({
30
+ chainType: joi.string().required(),
31
+ chainId: joi.number().required(),
32
+ }),
26
33
  levels: joi.object().pattern(joi.string().min(1), levelValidator),
27
34
  });
28
35
 
@@ -1,7 +1,7 @@
1
- import { IRequestWrapper } from '../../dex-helper';
1
+ import { isFunction } from 'lodash';
2
2
  import { Logger } from 'log4js';
3
+ import { IRequestWrapper } from '../../dex-helper';
3
4
  import { RequestConfig, Response } from '../../dex-helper/irequest-wrapper';
4
- import { isFunction } from 'lodash';
5
5
 
6
6
  const FETCH_TIMEOUT_MS = 10 * 1000;
7
7
  const FETCH_FAIL_MAX_ATTEMPT = 5;
@@ -1178,7 +1178,7 @@ export const Holders: {
1178
1178
  DAI: '0x1337bedc9d22ecbe766df105c9623922a27963ec',
1179
1179
  WETH: '0x68F5C0A2DE713a54991E01858Fd27a3832401849',
1180
1180
  POPS: '0x3cbd9044aaabef08ce93a68448e093cff405ad76',
1181
- USDC: '0xEBb8EA128BbdFf9a1780A4902A9380022371d466',
1181
+ USDC: ' 0x9f7b6e20bc64f12adaabeb739ead802fc7765d03',
1182
1182
  USDT: '0xEBb8EA128BbdFf9a1780A4902A9380022371d466',
1183
1183
  OP: '0xEBb8EA128BbdFf9a1780A4902A9380022371d466',
1184
1184
  aOptWETH: '0x7B7D80C40415F744864f051B806b466e2fbB8E68',
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-console */
2
- import axios from 'axios';
3
- import { Address } from '@paraswap/core';
4
2
  import { Provider } from '@ethersproject/providers';
3
+ import { Address } from '@paraswap/core';
4
+ import axios from 'axios';
5
5
  import { TxObject } from '../src/types';
6
6
  import { StateOverrides, StateSimulateApiOverride } from './smart-tokens';
7
7
 
@@ -76,6 +76,7 @@ export class TenderlySimulation implements TransactionSimulator {
76
76
  }
77
77
 
78
78
  try {
79
+ await process.nextTick(() => {}); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
79
80
  let res = await axios.post(
80
81
  `https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork`,
81
82
  {
@@ -109,6 +110,7 @@ export class TenderlySimulation implements TransactionSimulator {
109
110
  };
110
111
  try {
111
112
  if (stateOverrides) {
113
+ await process.nextTick(() => {}); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
112
114
  const result = await axios.post(
113
115
  `
114
116
  https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/contracts/encode-states`,
@@ -133,6 +135,7 @@ export class TenderlySimulation implements TransactionSimulator {
133
135
  );
134
136
  }
135
137
 
138
+ await process.nextTick(() => {}); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
136
139
  const { data } = await axios.post(
137
140
  `https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork/${this.forkId}/simulate`,
138
141
  _params,
@@ -1,39 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Current",
8
- "program": "${file}",
9
- "preLaunchTask": "npm: build",
10
- "sourceMaps": true,
11
- "smartStep": true,
12
- "internalConsoleOptions": "openOnSessionStart",
13
- "outFiles": ["${workspaceFolder}/build/**/*.js"]
14
- },
15
- {
16
- "type": "node",
17
- "request": "launch",
18
- "name": "Debug Jest Tests",
19
- "program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
20
- "args": [
21
- "--project",
22
- "tsconfig.json",
23
- // "${workspaceFolder}/src/dex/algebra/scripts/validate-state.ts",
24
- "${workspaceFolder}/scripts/dex-integration.ts",
25
- "test",
26
- "algebra"
27
- ],
28
- "console": "integratedTerminal",
29
- "internalConsoleOptions": "neverOpen",
30
- // "disableOptimisticBPs": true,
31
- "runtimeArgs": ["--nolazy"],
32
- "sourceMaps": true,
33
- "smartStep": true,
34
- "skipFiles": ["<node_internals>/**"],
35
- "cwd": "${workspaceFolder}",
36
- // "protocol": "inspector"
37
- }
38
- ]
39
- }
@@ -1,2 +0,0 @@
1
- {
2
- }