@paraswap/dex-lib 4.2.3-1 → 4.2.3-3

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 (343) hide show
  1. package/build/abi/miro-migrator/MiroMigrator.abi.json +540 -0
  2. package/build/dex/maverick-v1/maverick-v1.d.ts +1 -0
  3. package/build/dex/maverick-v1/maverick-v1.js +80 -4
  4. package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
  5. package/build/dex/{usual-m-smart-m → miro-migrator}/config.d.ts +1 -1
  6. package/build/dex/miro-migrator/config.js +14 -0
  7. package/build/dex/miro-migrator/config.js.map +1 -0
  8. package/build/dex/miro-migrator/constants.d.ts +2 -0
  9. package/build/dex/miro-migrator/constants.js +6 -0
  10. package/build/dex/miro-migrator/constants.js.map +1 -0
  11. package/build/dex/miro-migrator/miro-migrator-pool.d.ts +27 -0
  12. package/build/dex/miro-migrator/miro-migrator-pool.js +89 -0
  13. package/build/dex/miro-migrator/miro-migrator-pool.js.map +1 -0
  14. package/build/dex/{aave-v1/aave-v1.d.ts → miro-migrator/miro-migrator.d.ts} +23 -15
  15. package/build/dex/miro-migrator/miro-migrator.js +174 -0
  16. package/build/dex/miro-migrator/miro-migrator.js.map +1 -0
  17. package/build/dex/miro-migrator/types.d.ts +13 -0
  18. package/build/dex/miro-migrator/types.js +8 -0
  19. package/build/dex/miro-migrator/types.js.map +1 -0
  20. package/build/dex/uniswap-v4/optimizer.d.ts +2 -0
  21. package/build/dex/uniswap-v4/optimizer.js +47 -0
  22. package/build/dex/uniswap-v4/optimizer.js.map +1 -0
  23. package/package.json +1 -1
  24. package/build/abi/AaveV1_lending_pool.json +0 -27
  25. package/build/abi/BProtocol.json +0 -1155
  26. package/build/abi/Jarvis.json +0 -1172
  27. package/build/abi/MStableAsset.json +0 -1545
  28. package/build/abi/OneInchLp.json +0 -1304
  29. package/build/abi/Onebit.json +0 -736
  30. package/build/abi/Shell.json +0 -1294
  31. package/build/abi/TraderJoeV2Router.json +0 -50
  32. package/build/abi/inception/inception-ineth-pool.json +0 -1062
  33. package/build/abi/inception/inception-ratio-feed.json +0 -329
  34. package/build/abi/inception/inception-vault.json +0 -991
  35. package/build/abi/platypus/asset.json +0 -490
  36. package/build/abi/platypus/avax-pool.json +0 -820
  37. package/build/abi/platypus/oracle.json +0 -119
  38. package/build/abi/platypus/pool.json +0 -677
  39. package/build/abi/smardex/all/smardex-router.json +0 -648
  40. package/build/abi/smardex/layer-1/smardex-factory.json +0 -242
  41. package/build/abi/smardex/layer-1/smardex-pool.json +0 -506
  42. package/build/abi/smardex/layer-2/smardex-factory.json +0 -185
  43. package/build/abi/smardex/layer-2/smardex-pool.json +0 -578
  44. package/build/abi/swaap-v1/pool.json +0 -1346
  45. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
  46. package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
  47. package/build/abi/wUSDM.json +0 -757
  48. package/build/abi/wombat/pool.json +0 -1289
  49. package/build/abi/zrx.v2.json +0 -1967
  50. package/build/abi/zrx.v3.json +0 -3454
  51. package/build/abi/zrx.v4.json +0 -2193
  52. package/build/dex/OneInchLp.d.ts +0 -24
  53. package/build/dex/OneInchLp.js +0 -43
  54. package/build/dex/OneInchLp.js.map +0 -1
  55. package/build/dex/aave-v1/aave-v1.js +0 -181
  56. package/build/dex/aave-v1/aave-v1.js.map +0 -1
  57. package/build/dex/aave-v1/config.d.ts +0 -11
  58. package/build/dex/aave-v1/config.js +0 -20
  59. package/build/dex/aave-v1/config.js.map +0 -1
  60. package/build/dex/aave-v1/tokens-mainnet.json +0 -134
  61. package/build/dex/aave-v1/tokens.d.ts +0 -3
  62. package/build/dex/aave-v1/tokens.js +0 -50
  63. package/build/dex/aave-v1/tokens.js.map +0 -1
  64. package/build/dex/aave-v1/types.d.ts +0 -12
  65. package/build/dex/aave-v1/types.js +0 -3
  66. package/build/dex/aave-v1/types.js.map +0 -1
  67. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  68. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  69. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  70. package/build/dex/bProtocol/bProtocol.d.ts +0 -15
  71. package/build/dex/bProtocol/bProtocol.js +0 -56
  72. package/build/dex/bProtocol/bProtocol.js.map +0 -1
  73. package/build/dex/bProtocol/types.d.ts +0 -11
  74. package/build/dex/bProtocol/types.js +0 -8
  75. package/build/dex/bProtocol/types.js.map +0 -1
  76. package/build/dex/bProtocol.d.ts +0 -18
  77. package/build/dex/bProtocol.js +0 -39
  78. package/build/dex/bProtocol.js.map +0 -1
  79. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
  80. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
  81. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
  82. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
  83. package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
  84. package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
  85. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
  86. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
  87. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
  88. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
  89. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
  90. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
  91. package/build/dex/bancor.d.ts +0 -26
  92. package/build/dex/bancor.js +0 -58
  93. package/build/dex/bancor.js.map +0 -1
  94. package/build/dex/compound.d.ts +0 -18
  95. package/build/dex/compound.js +0 -46
  96. package/build/dex/compound.js.map +0 -1
  97. package/build/dex/curve-v2.d.ts +0 -58
  98. package/build/dex/curve-v2.js +0 -180
  99. package/build/dex/curve-v2.js.map +0 -1
  100. package/build/dex/dodo-v1.d.ts +0 -33
  101. package/build/dex/dodo-v1.js +0 -63
  102. package/build/dex/dodo-v1.js.map +0 -1
  103. package/build/dex/erc4626/scripts/validate-state.d.ts +0 -0
  104. package/build/dex/erc4626/scripts/validate-state.js +0 -146
  105. package/build/dex/erc4626/scripts/validate-state.js.map +0 -1
  106. package/build/dex/inception/config.d.ts +0 -4
  107. package/build/dex/inception/config.js +0 -109
  108. package/build/dex/inception/config.js.map +0 -1
  109. package/build/dex/inception/inception-event-pool.d.ts +0 -16
  110. package/build/dex/inception/inception-event-pool.js +0 -49
  111. package/build/dex/inception/inception-event-pool.js.map +0 -1
  112. package/build/dex/inception/inception.d.ts +0 -43
  113. package/build/dex/inception/inception.js +0 -180
  114. package/build/dex/inception/inception.js.map +0 -1
  115. package/build/dex/inception/tokens.d.ts +0 -9
  116. package/build/dex/inception/tokens.js +0 -28
  117. package/build/dex/inception/tokens.js.map +0 -1
  118. package/build/dex/inception/types.d.ts +0 -22
  119. package/build/dex/inception/types.js +0 -3
  120. package/build/dex/inception/types.js.map +0 -1
  121. package/build/dex/inception/utils.d.ts +0 -7
  122. package/build/dex/inception/utils.js +0 -58
  123. package/build/dex/inception/utils.js.map +0 -1
  124. package/build/dex/jarvis.d.ts +0 -56
  125. package/build/dex/jarvis.js +0 -163
  126. package/build/dex/jarvis.js.map +0 -1
  127. package/build/dex/lido.d.ts +0 -19
  128. package/build/dex/lido.js +0 -42
  129. package/build/dex/lido.js.map +0 -1
  130. package/build/dex/mStable.d.ts +0 -44
  131. package/build/dex/mStable.js +0 -75
  132. package/build/dex/mStable.js.map +0 -1
  133. package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
  134. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  135. package/build/dex/maker-psm/scripts/validate-state.js +0 -185
  136. package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
  137. package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
  138. package/build/dex/onebit/onebit.d.ts +0 -16
  139. package/build/dex/onebit/onebit.js +0 -61
  140. package/build/dex/onebit/onebit.js.map +0 -1
  141. package/build/dex/onebit/types.d.ts +0 -14
  142. package/build/dex/onebit/types.js +0 -8
  143. package/build/dex/onebit/types.js.map +0 -1
  144. package/build/dex/onebit.d.ts +0 -25
  145. package/build/dex/onebit.js +0 -42
  146. package/build/dex/onebit.js.map +0 -1
  147. package/build/dex/platypus/asset.d.ts +0 -14
  148. package/build/dex/platypus/asset.js +0 -97
  149. package/build/dex/platypus/asset.js.map +0 -1
  150. package/build/dex/platypus/config.d.ts +0 -11
  151. package/build/dex/platypus/config.js +0 -69
  152. package/build/dex/platypus/config.js.map +0 -1
  153. package/build/dex/platypus/platypus.d.ts +0 -63
  154. package/build/dex/platypus/platypus.js +0 -487
  155. package/build/dex/platypus/platypus.js.map +0 -1
  156. package/build/dex/platypus/pool-avax.d.ts +0 -8
  157. package/build/dex/platypus/pool-avax.js +0 -54
  158. package/build/dex/platypus/pool-avax.js.map +0 -1
  159. package/build/dex/platypus/pool-base.d.ts +0 -19
  160. package/build/dex/platypus/pool-base.js +0 -86
  161. package/build/dex/platypus/pool-base.js.map +0 -1
  162. package/build/dex/platypus/pool-pure.d.ts +0 -8
  163. package/build/dex/platypus/pool-pure.js +0 -37
  164. package/build/dex/platypus/pool-pure.js.map +0 -1
  165. package/build/dex/platypus/pool-subscriber.d.ts +0 -14
  166. package/build/dex/platypus/pool-subscriber.js +0 -167
  167. package/build/dex/platypus/pool-subscriber.js.map +0 -1
  168. package/build/dex/platypus/pool.d.ts +0 -8
  169. package/build/dex/platypus/pool.js +0 -58
  170. package/build/dex/platypus/pool.js.map +0 -1
  171. package/build/dex/platypus/types.d.ts +0 -92
  172. package/build/dex/platypus/types.js +0 -10
  173. package/build/dex/platypus/types.js.map +0 -1
  174. package/build/dex/quickswap/spiritswap-v3.d.ts +0 -6
  175. package/build/dex/quickswap/spiritswap-v3.js +0 -19
  176. package/build/dex/quickswap/spiritswap-v3.js.map +0 -1
  177. package/build/dex/shell.d.ts +0 -25
  178. package/build/dex/shell.js +0 -41
  179. package/build/dex/shell.js.map +0 -1
  180. package/build/dex/smardex/config.d.ts +0 -4
  181. package/build/dex/smardex/config.js +0 -64
  182. package/build/dex/smardex/config.js.map +0 -1
  183. package/build/dex/smardex/constants.d.ts +0 -18
  184. package/build/dex/smardex/constants.js +0 -33
  185. package/build/dex/smardex/constants.js.map +0 -1
  186. package/build/dex/smardex/sdk/constants.d.ts +0 -6
  187. package/build/dex/smardex/sdk/constants.js +0 -13
  188. package/build/dex/smardex/sdk/constants.js.map +0 -1
  189. package/build/dex/smardex/sdk/core.d.ts +0 -113
  190. package/build/dex/smardex/sdk/core.js +0 -499
  191. package/build/dex/smardex/sdk/core.js.map +0 -1
  192. package/build/dex/smardex/sdk/errors.d.ts +0 -15
  193. package/build/dex/smardex/sdk/errors.js +0 -22
  194. package/build/dex/smardex/sdk/errors.js.map +0 -1
  195. package/build/dex/smardex/sdk/types.d.ts +0 -62
  196. package/build/dex/smardex/sdk/types.js +0 -3
  197. package/build/dex/smardex/sdk/types.js.map +0 -1
  198. package/build/dex/smardex/sdk/utils.d.ts +0 -44
  199. package/build/dex/smardex/sdk/utils.js +0 -133
  200. package/build/dex/smardex/sdk/utils.js.map +0 -1
  201. package/build/dex/smardex/smardex-event-pool.d.ts +0 -28
  202. package/build/dex/smardex/smardex-event-pool.js +0 -119
  203. package/build/dex/smardex/smardex-event-pool.js.map +0 -1
  204. package/build/dex/smardex/smardex.d.ts +0 -65
  205. package/build/dex/smardex/smardex.js +0 -519
  206. package/build/dex/smardex/smardex.js.map +0 -1
  207. package/build/dex/smardex/types.d.ts +0 -55
  208. package/build/dex/smardex/types.js +0 -3
  209. package/build/dex/smardex/types.js.map +0 -1
  210. package/build/dex/smoothy.d.ts +0 -26
  211. package/build/dex/smoothy.js +0 -48
  212. package/build/dex/smoothy.js.map +0 -1
  213. package/build/dex/solidly/forks-override/cone.d.ts +0 -22
  214. package/build/dex/solidly/forks-override/cone.js +0 -53
  215. package/build/dex/solidly/forks-override/cone.js.map +0 -1
  216. package/build/dex/solidly/forks-override/solisnek.d.ts +0 -8
  217. package/build/dex/solidly/forks-override/solisnek.js +0 -15
  218. package/build/dex/solidly/forks-override/solisnek.js.map +0 -1
  219. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
  220. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
  221. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
  222. package/build/dex/stable-pool.d.ts +0 -28
  223. package/build/dex/stable-pool.js +0 -55
  224. package/build/dex/stable-pool.js.map +0 -1
  225. package/build/dex/swaap-v1/config.d.ts +0 -17
  226. package/build/dex/swaap-v1/config.js +0 -56
  227. package/build/dex/swaap-v1/config.js.map +0 -1
  228. package/build/dex/swaap-v1/constants.d.ts +0 -6
  229. package/build/dex/swaap-v1/constants.js +0 -17
  230. package/build/dex/swaap-v1/constants.js.map +0 -1
  231. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +0 -25
  232. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +0 -62
  233. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +0 -1
  234. package/build/dex/swaap-v1/libraries/Const.d.ts +0 -18
  235. package/build/dex/swaap-v1/libraries/Const.js +0 -26
  236. package/build/dex/swaap-v1/libraries/Const.js.map +0 -1
  237. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +0 -77
  238. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +0 -316
  239. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +0 -1
  240. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +0 -75
  241. package/build/dex/swaap-v1/libraries/LogExpMath.js +0 -418
  242. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +0 -1
  243. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +0 -185
  244. package/build/dex/swaap-v1/libraries/MathMMM.js +0 -453
  245. package/build/dex/swaap-v1/libraries/MathMMM.js.map +0 -1
  246. package/build/dex/swaap-v1/libraries/Num.d.ts +0 -31
  247. package/build/dex/swaap-v1/libraries/Num.js +0 -167
  248. package/build/dex/swaap-v1/libraries/Num.js.map +0 -1
  249. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +0 -23
  250. package/build/dex/swaap-v1/libraries/PoolQuotations.js +0 -131
  251. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +0 -1
  252. package/build/dex/swaap-v1/libraries/Struct.d.ts +0 -56
  253. package/build/dex/swaap-v1/libraries/Struct.js +0 -3
  254. package/build/dex/swaap-v1/libraries/Struct.js.map +0 -1
  255. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +0 -45
  256. package/build/dex/swaap-v1/swaap-v1-pool.js +0 -656
  257. package/build/dex/swaap-v1/swaap-v1-pool.js.map +0 -1
  258. package/build/dex/swaap-v1/swaap-v1.d.ts +0 -62
  259. package/build/dex/swaap-v1/swaap-v1.js +0 -383
  260. package/build/dex/swaap-v1/swaap-v1.js.map +0 -1
  261. package/build/dex/swaap-v1/types.d.ts +0 -106
  262. package/build/dex/swaap-v1/types.js +0 -9
  263. package/build/dex/swaap-v1/types.js.map +0 -1
  264. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  265. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  266. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  267. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  268. package/build/dex/trader-joe-v2.1.js +0 -79
  269. package/build/dex/trader-joe-v2.1.js.map +0 -1
  270. package/build/dex/trader-joe-v2.d.ts +0 -40
  271. package/build/dex/trader-joe-v2.js +0 -74
  272. package/build/dex/trader-joe-v2.js.map +0 -1
  273. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
  274. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
  275. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
  276. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
  277. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
  278. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
  279. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
  280. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
  281. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
  282. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
  283. package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
  284. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
  285. package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
  286. package/build/dex/usual/usual-m-smart-m.js +0 -50
  287. package/build/dex/usual/usual-m-smart-m.js.map +0 -1
  288. package/build/dex/usual-bond/config.d.ts +0 -3
  289. package/build/dex/usual-bond/config.js +0 -13
  290. package/build/dex/usual-bond/config.js.map +0 -1
  291. package/build/dex/usual-bond/types.d.ts +0 -7
  292. package/build/dex/usual-bond/types.js +0 -3
  293. package/build/dex/usual-bond/types.js.map +0 -1
  294. package/build/dex/usual-bond/usual-bond.d.ts +0 -35
  295. package/build/dex/usual-bond/usual-bond.js +0 -176
  296. package/build/dex/usual-bond/usual-bond.js.map +0 -1
  297. package/build/dex/usual-m-smart-m/config.js +0 -13
  298. package/build/dex/usual-m-smart-m/config.js.map +0 -1
  299. package/build/dex/usual-m-smart-m/types.d.ts +0 -7
  300. package/build/dex/usual-m-smart-m/types.js +0 -3
  301. package/build/dex/usual-m-smart-m/types.js.map +0 -1
  302. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
  303. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
  304. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
  305. package/build/dex/usual-m-usd0/config.d.ts +0 -3
  306. package/build/dex/usual-m-usd0/config.js +0 -14
  307. package/build/dex/usual-m-usd0/config.js.map +0 -1
  308. package/build/dex/usual-m-usd0/types.d.ts +0 -8
  309. package/build/dex/usual-m-usd0/types.js +0 -3
  310. package/build/dex/usual-m-usd0/types.js.map +0 -1
  311. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
  312. package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
  313. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
  314. package/build/dex/wusdm/config.d.ts +0 -3
  315. package/build/dex/wusdm/config.js +0 -43
  316. package/build/dex/wusdm/config.js.map +0 -1
  317. package/build/dex/wusdm/constants.d.ts +0 -2
  318. package/build/dex/wusdm/constants.js +0 -6
  319. package/build/dex/wusdm/constants.js.map +0 -1
  320. package/build/dex/wusdm/types.d.ts +0 -18
  321. package/build/dex/wusdm/types.js +0 -11
  322. package/build/dex/wusdm/types.js.map +0 -1
  323. package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
  324. package/build/dex/wusdm/wusdm-pool.js +0 -74
  325. package/build/dex/wusdm/wusdm-pool.js.map +0 -1
  326. package/build/dex/wusdm/wusdm.d.ts +0 -46
  327. package/build/dex/wusdm/wusdm.js +0 -243
  328. package/build/dex/wusdm/wusdm.js.map +0 -1
  329. package/build/dex/zerox/config.d.ts +0 -2
  330. package/build/dex/zerox/config.js +0 -33
  331. package/build/dex/zerox/config.js.map +0 -1
  332. package/build/dex/zerox/index.d.ts +0 -22
  333. package/build/dex/zerox/index.js +0 -225
  334. package/build/dex/zerox/index.js.map +0 -1
  335. package/build/dex/zerox/order.d.ts +0 -88
  336. package/build/dex/zerox/order.js +0 -53
  337. package/build/dex/zerox/order.js.map +0 -1
  338. package/build/dex/zerox/types.d.ts +0 -73
  339. package/build/dex/zerox/types.js +0 -21
  340. package/build/dex/zerox/types.js.map +0 -1
  341. /package/build/dex/uniswap-v4/contract-math/{TickBitmap.d.ts → TickBitMap.d.ts} +0 -0
  342. /package/build/dex/uniswap-v4/contract-math/{TickBitmap.js → TickBitMap.js} +0 -0
  343. /package/build/dex/uniswap-v4/contract-math/{TickBitmap.js.map → TickBitMap.js.map} +0 -0
@@ -0,0 +1,540 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "components": [
6
+ { "internalType": "address", "name": "xyz", "type": "address" },
7
+ { "internalType": "address", "name": "weth", "type": "address" },
8
+ {
9
+ "internalType": "address",
10
+ "name": "bridgeStaking",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "internalType": "uint256",
15
+ "name": "destChainId",
16
+ "type": "uint256"
17
+ }
18
+ ],
19
+ "internalType": "struct IMiroMigrator.BridgeConfig[]",
20
+ "name": "_bridgeConfigs",
21
+ "type": "tuple[]"
22
+ },
23
+ { "internalType": "address", "name": "sePSP1", "type": "address" },
24
+ { "internalType": "address", "name": "sePSP2", "type": "address" },
25
+ { "internalType": "address", "name": "seXYZ", "type": "address" },
26
+ {
27
+ "internalType": "contract IAcrossSpokePool",
28
+ "name": "spokePool",
29
+ "type": "address"
30
+ }
31
+ ],
32
+ "stateMutability": "nonpayable",
33
+ "type": "constructor"
34
+ },
35
+ { "inputs": [], "name": "EnforcedPause", "type": "error" },
36
+ { "inputs": [], "name": "ExpectedPause", "type": "error" },
37
+ { "inputs": [], "name": "InsufficientMsgValue", "type": "error" },
38
+ { "inputs": [], "name": "InvalidDestinationChainId", "type": "error" },
39
+ {
40
+ "inputs": [
41
+ { "internalType": "address", "name": "owner", "type": "address" }
42
+ ],
43
+ "name": "OwnableInvalidOwner",
44
+ "type": "error"
45
+ },
46
+ {
47
+ "inputs": [
48
+ { "internalType": "address", "name": "account", "type": "address" }
49
+ ],
50
+ "name": "OwnableUnauthorizedAccount",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "anonymous": false,
55
+ "inputs": [
56
+ {
57
+ "indexed": true,
58
+ "internalType": "address",
59
+ "name": "user",
60
+ "type": "address"
61
+ },
62
+ {
63
+ "indexed": true,
64
+ "internalType": "uint256",
65
+ "name": "amount",
66
+ "type": "uint256"
67
+ }
68
+ ],
69
+ "name": "Migrated",
70
+ "type": "event"
71
+ },
72
+ {
73
+ "anonymous": false,
74
+ "inputs": [
75
+ {
76
+ "indexed": true,
77
+ "internalType": "address",
78
+ "name": "previousOwner",
79
+ "type": "address"
80
+ },
81
+ {
82
+ "indexed": true,
83
+ "internalType": "address",
84
+ "name": "newOwner",
85
+ "type": "address"
86
+ }
87
+ ],
88
+ "name": "OwnershipTransferred",
89
+ "type": "event"
90
+ },
91
+ {
92
+ "anonymous": false,
93
+ "inputs": [
94
+ {
95
+ "indexed": false,
96
+ "internalType": "address",
97
+ "name": "account",
98
+ "type": "address"
99
+ }
100
+ ],
101
+ "name": "Paused",
102
+ "type": "event"
103
+ },
104
+ {
105
+ "anonymous": false,
106
+ "inputs": [
107
+ {
108
+ "indexed": true,
109
+ "internalType": "address",
110
+ "name": "user",
111
+ "type": "address"
112
+ },
113
+ {
114
+ "indexed": true,
115
+ "internalType": "uint256",
116
+ "name": "xyzAmount",
117
+ "type": "uint256"
118
+ },
119
+ {
120
+ "indexed": true,
121
+ "internalType": "uint256",
122
+ "name": "wethAmount",
123
+ "type": "uint256"
124
+ },
125
+ {
126
+ "indexed": false,
127
+ "internalType": "uint256",
128
+ "name": "destChainId",
129
+ "type": "uint256"
130
+ },
131
+ {
132
+ "indexed": false,
133
+ "internalType": "bytes",
134
+ "name": "message",
135
+ "type": "bytes"
136
+ }
137
+ ],
138
+ "name": "StakeBridgingInitiated",
139
+ "type": "event"
140
+ },
141
+ {
142
+ "anonymous": false,
143
+ "inputs": [
144
+ {
145
+ "indexed": false,
146
+ "internalType": "address",
147
+ "name": "account",
148
+ "type": "address"
149
+ }
150
+ ],
151
+ "name": "Unpaused",
152
+ "type": "event"
153
+ },
154
+ {
155
+ "inputs": [],
156
+ "name": "BURN_ADDR",
157
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
158
+ "stateMutability": "view",
159
+ "type": "function"
160
+ },
161
+ {
162
+ "inputs": [],
163
+ "name": "PSP",
164
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
165
+ "stateMutability": "view",
166
+ "type": "function"
167
+ },
168
+ {
169
+ "inputs": [],
170
+ "name": "SE_PSP1",
171
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
172
+ "stateMutability": "view",
173
+ "type": "function"
174
+ },
175
+ {
176
+ "inputs": [],
177
+ "name": "SE_PSP2",
178
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
179
+ "stateMutability": "view",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "inputs": [],
184
+ "name": "SE_XYZ",
185
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
186
+ "stateMutability": "view",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "inputs": [],
191
+ "name": "SPOKE_POOL",
192
+ "outputs": [
193
+ {
194
+ "internalType": "contract IAcrossSpokePool",
195
+ "name": "",
196
+ "type": "address"
197
+ }
198
+ ],
199
+ "stateMutability": "view",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [],
204
+ "name": "WETH",
205
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
206
+ "stateMutability": "view",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "inputs": [],
211
+ "name": "XYZ",
212
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
213
+ "stateMutability": "view",
214
+ "type": "function"
215
+ },
216
+ {
217
+ "inputs": [
218
+ { "internalType": "uint256", "name": "chainId", "type": "uint256" }
219
+ ],
220
+ "name": "bridgeConfigs",
221
+ "outputs": [
222
+ { "internalType": "address", "name": "xyz", "type": "address" },
223
+ { "internalType": "address", "name": "weth", "type": "address" },
224
+ { "internalType": "address", "name": "bridgeStaking", "type": "address" },
225
+ { "internalType": "uint256", "name": "destChainId", "type": "uint256" }
226
+ ],
227
+ "stateMutability": "view",
228
+ "type": "function"
229
+ },
230
+ {
231
+ "inputs": [
232
+ { "internalType": "uint256", "name": "xyzAmount", "type": "uint256" },
233
+ { "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
234
+ { "internalType": "uint256", "name": "destChainId", "type": "uint256" },
235
+ {
236
+ "internalType": "uint256",
237
+ "name": "minDestBptAmount",
238
+ "type": "uint256"
239
+ },
240
+ { "internalType": "address", "name": "beneficiary", "type": "address" },
241
+ {
242
+ "components": [
243
+ {
244
+ "internalType": "uint256",
245
+ "name": "relayerFee",
246
+ "type": "uint256"
247
+ },
248
+ {
249
+ "internalType": "address",
250
+ "name": "exclusiveRelayer",
251
+ "type": "address"
252
+ },
253
+ {
254
+ "internalType": "uint32",
255
+ "name": "quoteTimestamp",
256
+ "type": "uint32"
257
+ },
258
+ {
259
+ "internalType": "uint32",
260
+ "name": "fillDeadline",
261
+ "type": "uint32"
262
+ },
263
+ {
264
+ "internalType": "uint32",
265
+ "name": "exclusivityDeadline",
266
+ "type": "uint32"
267
+ }
268
+ ],
269
+ "internalType": "struct IMiroMigrator.BridgeData",
270
+ "name": "xyzBridgeData",
271
+ "type": "tuple"
272
+ },
273
+ {
274
+ "components": [
275
+ {
276
+ "internalType": "uint256",
277
+ "name": "relayerFee",
278
+ "type": "uint256"
279
+ },
280
+ {
281
+ "internalType": "address",
282
+ "name": "exclusiveRelayer",
283
+ "type": "address"
284
+ },
285
+ {
286
+ "internalType": "uint32",
287
+ "name": "quoteTimestamp",
288
+ "type": "uint32"
289
+ },
290
+ {
291
+ "internalType": "uint32",
292
+ "name": "fillDeadline",
293
+ "type": "uint32"
294
+ },
295
+ {
296
+ "internalType": "uint32",
297
+ "name": "exclusivityDeadline",
298
+ "type": "uint32"
299
+ }
300
+ ],
301
+ "internalType": "struct IMiroMigrator.BridgeData",
302
+ "name": "wethBridgeData",
303
+ "type": "tuple"
304
+ },
305
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
306
+ ],
307
+ "name": "bridgeXYZAndStake",
308
+ "outputs": [],
309
+ "stateMutability": "payable",
310
+ "type": "function"
311
+ },
312
+ {
313
+ "inputs": [
314
+ { "internalType": "uint256", "name": "pspAmount", "type": "uint256" },
315
+ { "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
316
+ { "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
317
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
318
+ ],
319
+ "name": "migratePSPtoSeXYZ",
320
+ "outputs": [],
321
+ "stateMutability": "payable",
322
+ "type": "function"
323
+ },
324
+ {
325
+ "inputs": [
326
+ { "internalType": "uint256", "name": "pspAmount", "type": "uint256" },
327
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
328
+ ],
329
+ "name": "migratePSPtoXYZ",
330
+ "outputs": [],
331
+ "stateMutability": "nonpayable",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [
336
+ { "internalType": "uint256", "name": "sePSP1Amount", "type": "uint256" },
337
+ { "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
338
+ { "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
339
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
340
+ ],
341
+ "name": "migrateSePSP1toSeXYZ",
342
+ "outputs": [],
343
+ "stateMutability": "payable",
344
+ "type": "function"
345
+ },
346
+ {
347
+ "inputs": [
348
+ { "internalType": "uint256", "name": "sePSP1Amount", "type": "uint256" },
349
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
350
+ ],
351
+ "name": "migrateSePSP1toXYZ",
352
+ "outputs": [],
353
+ "stateMutability": "nonpayable",
354
+ "type": "function"
355
+ },
356
+ {
357
+ "inputs": [
358
+ { "internalType": "uint256", "name": "sePSP2Amount", "type": "uint256" },
359
+ { "internalType": "uint256", "name": "minPspAmount", "type": "uint256" },
360
+ { "internalType": "uint256", "name": "minWethAmount", "type": "uint256" },
361
+ { "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
362
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
363
+ ],
364
+ "name": "migrateSePSP2toSeXYZ",
365
+ "outputs": [],
366
+ "stateMutability": "nonpayable",
367
+ "type": "function"
368
+ },
369
+ {
370
+ "inputs": [
371
+ { "internalType": "uint256", "name": "sePSP2Amount", "type": "uint256" },
372
+ { "internalType": "uint256", "name": "minPspAmount", "type": "uint256" },
373
+ { "internalType": "uint256", "name": "minWethAmount", "type": "uint256" },
374
+ { "internalType": "uint256", "name": "destChainId", "type": "uint256" },
375
+ {
376
+ "internalType": "uint256",
377
+ "name": "minDestBptAmount",
378
+ "type": "uint256"
379
+ },
380
+ { "internalType": "address", "name": "beneficiary", "type": "address" },
381
+ {
382
+ "components": [
383
+ {
384
+ "internalType": "uint256",
385
+ "name": "relayerFee",
386
+ "type": "uint256"
387
+ },
388
+ {
389
+ "internalType": "address",
390
+ "name": "exclusiveRelayer",
391
+ "type": "address"
392
+ },
393
+ {
394
+ "internalType": "uint32",
395
+ "name": "quoteTimestamp",
396
+ "type": "uint32"
397
+ },
398
+ {
399
+ "internalType": "uint32",
400
+ "name": "fillDeadline",
401
+ "type": "uint32"
402
+ },
403
+ {
404
+ "internalType": "uint32",
405
+ "name": "exclusivityDeadline",
406
+ "type": "uint32"
407
+ }
408
+ ],
409
+ "internalType": "struct IMiroMigrator.BridgeData",
410
+ "name": "xyzBridgeData",
411
+ "type": "tuple"
412
+ },
413
+ {
414
+ "components": [
415
+ {
416
+ "internalType": "uint256",
417
+ "name": "relayerFee",
418
+ "type": "uint256"
419
+ },
420
+ {
421
+ "internalType": "address",
422
+ "name": "exclusiveRelayer",
423
+ "type": "address"
424
+ },
425
+ {
426
+ "internalType": "uint32",
427
+ "name": "quoteTimestamp",
428
+ "type": "uint32"
429
+ },
430
+ {
431
+ "internalType": "uint32",
432
+ "name": "fillDeadline",
433
+ "type": "uint32"
434
+ },
435
+ {
436
+ "internalType": "uint32",
437
+ "name": "exclusivityDeadline",
438
+ "type": "uint32"
439
+ }
440
+ ],
441
+ "internalType": "struct IMiroMigrator.BridgeData",
442
+ "name": "wethBridgeData",
443
+ "type": "tuple"
444
+ },
445
+ { "internalType": "bytes", "name": "permitData", "type": "bytes" }
446
+ ],
447
+ "name": "migrateSePSP2toSeXYZAndBridge",
448
+ "outputs": [],
449
+ "stateMutability": "nonpayable",
450
+ "type": "function"
451
+ },
452
+ {
453
+ "inputs": [],
454
+ "name": "owner",
455
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
456
+ "stateMutability": "view",
457
+ "type": "function"
458
+ },
459
+ {
460
+ "inputs": [],
461
+ "name": "pause",
462
+ "outputs": [],
463
+ "stateMutability": "nonpayable",
464
+ "type": "function"
465
+ },
466
+ {
467
+ "inputs": [],
468
+ "name": "paused",
469
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
470
+ "stateMutability": "view",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [
475
+ { "internalType": "address", "name": "token", "type": "address" },
476
+ { "internalType": "address", "name": "to", "type": "address" }
477
+ ],
478
+ "name": "reClaimERC20",
479
+ "outputs": [],
480
+ "stateMutability": "nonpayable",
481
+ "type": "function"
482
+ },
483
+ {
484
+ "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],
485
+ "name": "reClaimETH",
486
+ "outputs": [],
487
+ "stateMutability": "nonpayable",
488
+ "type": "function"
489
+ },
490
+ {
491
+ "inputs": [],
492
+ "name": "renounceOwnership",
493
+ "outputs": [],
494
+ "stateMutability": "nonpayable",
495
+ "type": "function"
496
+ },
497
+ {
498
+ "inputs": [
499
+ {
500
+ "components": [
501
+ { "internalType": "address", "name": "xyz", "type": "address" },
502
+ { "internalType": "address", "name": "weth", "type": "address" },
503
+ {
504
+ "internalType": "address",
505
+ "name": "bridgeStaking",
506
+ "type": "address"
507
+ },
508
+ {
509
+ "internalType": "uint256",
510
+ "name": "destChainId",
511
+ "type": "uint256"
512
+ }
513
+ ],
514
+ "internalType": "struct IMiroMigrator.BridgeConfig[]",
515
+ "name": "_bridgeConfigs",
516
+ "type": "tuple[]"
517
+ }
518
+ ],
519
+ "name": "setBridgeConfigs",
520
+ "outputs": [],
521
+ "stateMutability": "nonpayable",
522
+ "type": "function"
523
+ },
524
+ {
525
+ "inputs": [
526
+ { "internalType": "address", "name": "newOwner", "type": "address" }
527
+ ],
528
+ "name": "transferOwnership",
529
+ "outputs": [],
530
+ "stateMutability": "nonpayable",
531
+ "type": "function"
532
+ },
533
+ {
534
+ "inputs": [],
535
+ "name": "unpause",
536
+ "outputs": [],
537
+ "stateMutability": "nonpayable",
538
+ "type": "function"
539
+ }
540
+ ]
@@ -44,4 +44,5 @@ export declare class MaverickV1 extends SimpleExchange implements IDex<MaverickV
44
44
  getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MaverickV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
45
45
  private _querySubgraph;
46
46
  getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
47
+ private _getPoolBalances;
47
48
  }
@@ -50,6 +50,8 @@ const subgraph_queries_1 = require("./subgraph-queries");
50
50
  const constants_2 = require("../../constants");
51
51
  const router_json_1 = __importDefault(require("../../abi/maverick-v1/router.json"));
52
52
  const utils_2 = require("../../executor/utils");
53
+ const utils_3 = require("ethers/lib/utils");
54
+ const decoders_1 = require("../../lib/decoders");
53
55
  const MAX_POOL_CNT = 1000;
54
56
  const EFFICIENCY_FACTOR = 3;
55
57
  class MaverickV1 extends simple_exchange_1.SimpleExchange {
@@ -354,7 +356,7 @@ class MaverickV1 extends simple_exchange_1.SimpleExchange {
354
356
  decimals: parseInt(pool.tokenB.decimals),
355
357
  },
356
358
  ],
357
- liquidityUSD: parseFloat(pool.balanceUSD) * EFFICIENCY_FACTOR,
359
+ liquidityUSD: parseFloat(pool.balanceUSD),
358
360
  }));
359
361
  const pools1 = lodash_1.default.map(res.pools1, pool => ({
360
362
  exchange: this.dexKey,
@@ -365,10 +367,84 @@ class MaverickV1 extends simple_exchange_1.SimpleExchange {
365
367
  decimals: parseInt(pool.tokenA.decimals),
366
368
  },
367
369
  ],
368
- liquidityUSD: parseFloat(pool.balanceUSD) * EFFICIENCY_FACTOR,
370
+ liquidityUSD: parseFloat(pool.balanceUSD),
369
371
  }));
370
- const pools = lodash_1.default.slice(lodash_1.default.sortBy(lodash_1.default.concat(pools0, pools1), [pool => -1 * pool.liquidityUSD]), 0, limit);
371
- return pools;
372
+ const allPools = pools0.concat(pools1);
373
+ const tokenDecimals = allPools.reduce((a, c) => ({
374
+ ...a,
375
+ [c.connectorTokens[0].address]: c.connectorTokens[0].decimals,
376
+ }), {});
377
+ const tokenDecimal = res.pools0?.[0]?.tokenA?.decimals ?? res.pools1?.[0]?.tokenB?.decimals;
378
+ tokenDecimals[_tokenAddress] = parseInt(tokenDecimal);
379
+ // just to optimize in case same tokens are used in multiple pools
380
+ const normalizedUsdPrices = await Promise.all(Object.keys(tokenDecimals).map(t => this.dexHelper.getTokenUSDPrice({
381
+ address: t,
382
+ decimals: tokenDecimals[t],
383
+ }, BigInt(1 * 10 ** tokenDecimals[t]))));
384
+ const usdPrices = Object.fromEntries(Object.keys(tokenDecimals).map((t, i) => [t, normalizedUsdPrices[i]]));
385
+ const poolBalances = await this._getPoolBalances(allPools.map(p => [
386
+ p.address,
387
+ tokenAddress,
388
+ p.connectorTokens[0].address,
389
+ ]));
390
+ const pools = allPools.map((pool, i) => {
391
+ const _connectorTokenAddress = pool.connectorTokens[0].address;
392
+ const tokenBalance = poolBalances[i][0];
393
+ const connectorTokenBalance = poolBalances[i][1];
394
+ const tokenUsdPrice = usdPrices[_tokenAddress];
395
+ const connectorTokenUsdPrice = usdPrices[_connectorTokenAddress];
396
+ // by default use liquidityUSD from subgraph
397
+ let tokenUsdLiquidity = pool.liquidityUSD / 2;
398
+ if (tokenBalance && tokenUsdPrice && tokenDecimals[_tokenAddress]) {
399
+ const amount = (0, utils_3.formatUnits)(tokenBalance, tokenDecimals[_tokenAddress]);
400
+ tokenUsdLiquidity = Number(amount) * tokenUsdPrice * EFFICIENCY_FACTOR;
401
+ }
402
+ // by default use liquidityUSD from subgraph
403
+ let connectorTokenUsdLiquidity = pool.liquidityUSD / 2;
404
+ if (connectorTokenBalance &&
405
+ connectorTokenUsdPrice &&
406
+ tokenDecimals[_connectorTokenAddress]) {
407
+ const amount = (0, utils_3.formatUnits)(connectorTokenBalance, tokenDecimals[_connectorTokenAddress]);
408
+ connectorTokenUsdLiquidity =
409
+ Number(amount) * connectorTokenUsdPrice * EFFICIENCY_FACTOR;
410
+ }
411
+ return {
412
+ ...pool,
413
+ liquidityUSD: tokenUsdLiquidity + connectorTokenUsdLiquidity,
414
+ };
415
+ });
416
+ return pools.slice(0, limit);
417
+ }
418
+ async _getPoolBalances(pools) {
419
+ const callData = pools
420
+ .map(pool => [
421
+ {
422
+ target: pool[1],
423
+ callData: this.erc20Interface.encodeFunctionData('balanceOf', [
424
+ pool[0],
425
+ ]),
426
+ decodeFunction: decoders_1.uint256ToBigInt,
427
+ },
428
+ {
429
+ target: pool[2],
430
+ callData: this.erc20Interface.encodeFunctionData('balanceOf', [
431
+ pool[0],
432
+ ]),
433
+ decodeFunction: decoders_1.uint256ToBigInt,
434
+ },
435
+ ])
436
+ .flat();
437
+ const balanceOfCalls = await this.dexHelper.multiWrapper.tryAggregate(false, callData);
438
+ const balances = [];
439
+ for (let i = 0; i < balanceOfCalls.length; i += 2) {
440
+ const balanceToken0 = balanceOfCalls[i];
441
+ const balanceToken1 = balanceOfCalls[i + 1];
442
+ balances.push([
443
+ balanceToken0.success ? balanceToken0.returnData : null,
444
+ balanceToken1.success ? balanceToken1.returnData : null,
445
+ ]);
446
+ }
447
+ return balances;
372
448
  }
373
449
  }
374
450
  exports.MaverickV1 = MaverickV1;