@paraswap/dex-lib 4.2.5 → 4.2.7

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 (369) hide show
  1. package/build/constants.js +1 -1
  2. package/build/dex/uniswap-v4/constants.d.ts +1 -2
  3. package/build/dex/uniswap-v4/constants.js +2 -3
  4. package/build/dex/uniswap-v4/constants.js.map +1 -1
  5. package/build/dex/uniswap-v4/contract-math/Tick.d.ts +1 -1
  6. package/build/dex/uniswap-v4/contract-math/Tick.js +13 -9
  7. package/build/dex/uniswap-v4/contract-math/Tick.js.map +1 -1
  8. package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js +6 -5
  9. package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js.map +1 -1
  10. package/build/dex/uniswap-v4/optimizer.d.ts +2 -0
  11. package/build/dex/uniswap-v4/optimizer.js +47 -0
  12. package/build/dex/uniswap-v4/optimizer.js.map +1 -0
  13. package/build/dex/uniswap-v4/uniswap-v4-pool.js +14 -6
  14. package/build/dex/uniswap-v4/uniswap-v4-pool.js.map +1 -1
  15. package/build/dex/uniswap-v4/uniswap-v4.js +7 -1
  16. package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -1
  17. package/package.json +1 -1
  18. package/build/abi/AaveV1_lending_pool.json +0 -27
  19. package/build/abi/Aave_GSM.json +0 -751
  20. package/build/abi/BProtocol.json +0 -1155
  21. package/build/abi/Balancer.json +0 -257
  22. package/build/abi/BalancerV2.json +0 -1179
  23. package/build/abi/Jarvis.json +0 -1172
  24. package/build/abi/MStableAsset.json +0 -1545
  25. package/build/abi/OneInchLp.json +0 -1304
  26. package/build/abi/Onebit.json +0 -736
  27. package/build/abi/RamsesV2Pool.abi.json +0 -1554
  28. package/build/abi/RamsesV2Quoter.abi.json +0 -274
  29. package/build/abi/Shell.json +0 -1294
  30. package/build/abi/TraderJoeV2Router.json +0 -50
  31. package/build/abi/USDM.json +0 -807
  32. package/build/abi/UniswapV2Router.json +0 -397
  33. package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +0 -1246
  34. package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +0 -509
  35. package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
  36. package/build/abi/curve-v1/CurveTokenV1.json +0 -305
  37. package/build/abi/curve-v1/CurveTokenV2.json +0 -318
  38. package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
  39. package/build/abi/curve-v1/CurveV2Swap.json +0 -700
  40. package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
  41. package/build/abi/curve-v1/FactoryRegistry.json +0 -508
  42. package/build/abi/curve-v1/StableSwapAave.json +0 -1152
  43. package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
  44. package/build/abi/curve-v1/StableSwapCompound.json +0 -814
  45. package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
  46. package/build/abi/curve-v1/StableSwapPax.json +0 -865
  47. package/build/abi/curve-v1/StableSwapSnow.json +0 -900
  48. package/build/abi/curve-v1/StableSwapUSDN.json +0 -1004
  49. package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
  50. package/build/abi/curve-v1/StableSwapY.json +0 -814
  51. package/build/abi/inception/inception-ineth-pool.json +0 -1062
  52. package/build/abi/inception/inception-ineth.json +0 -609
  53. package/build/abi/inception/inception-ratio-feed.json +0 -329
  54. package/build/abi/inception/inception-vault.json +0 -991
  55. package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
  56. package/build/abi/kyberdmm.abi.json +0 -1148
  57. package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
  58. package/build/abi/nerve/nerve-metapool.json +0 -790
  59. package/build/abi/platypus/asset.json +0 -490
  60. package/build/abi/platypus/avax-pool.json +0 -820
  61. package/build/abi/platypus/oracle.json +0 -119
  62. package/build/abi/platypus/pool.json +0 -677
  63. package/build/abi/smardex/all/smardex-router.json +0 -648
  64. package/build/abi/smardex/layer-1/smardex-factory.json +0 -242
  65. package/build/abi/smardex/layer-1/smardex-pool.json +0 -506
  66. package/build/abi/smardex/layer-2/smardex-factory.json +0 -185
  67. package/build/abi/smardex/layer-2/smardex-pool.json +0 -578
  68. package/build/abi/swaap-v1/pool.json +0 -1346
  69. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  70. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
  71. package/build/abi/wUSDM.json +0 -757
  72. package/build/abi/zrx.v2.json +0 -1967
  73. package/build/abi/zrx.v3.json +0 -3454
  74. package/build/abi/zrx.v4.json +0 -2193
  75. package/build/dex/OneInchLp.d.ts +0 -24
  76. package/build/dex/OneInchLp.js +0 -43
  77. package/build/dex/OneInchLp.js.map +0 -1
  78. package/build/dex/aave-v1/aave-v1.d.ts +0 -34
  79. package/build/dex/aave-v1/aave-v1.js +0 -180
  80. package/build/dex/aave-v1/aave-v1.js.map +0 -1
  81. package/build/dex/aave-v1/config.d.ts +0 -11
  82. package/build/dex/aave-v1/config.js +0 -20
  83. package/build/dex/aave-v1/config.js.map +0 -1
  84. package/build/dex/aave-v1/tokens-mainnet.json +0 -134
  85. package/build/dex/aave-v1/tokens.d.ts +0 -3
  86. package/build/dex/aave-v1/tokens.js +0 -50
  87. package/build/dex/aave-v1/tokens.js.map +0 -1
  88. package/build/dex/aave-v1/types.d.ts +0 -12
  89. package/build/dex/aave-v1/types.js +0 -3
  90. package/build/dex/aave-v1/types.js.map +0 -1
  91. package/build/dex/bProtocol/bProtocol.d.ts +0 -15
  92. package/build/dex/bProtocol/bProtocol.js +0 -56
  93. package/build/dex/bProtocol/bProtocol.js.map +0 -1
  94. package/build/dex/bProtocol/types.d.ts +0 -11
  95. package/build/dex/bProtocol/types.js +0 -8
  96. package/build/dex/bProtocol/types.js.map +0 -1
  97. package/build/dex/balancer-v1/balancer-pools.json +0 -33333
  98. package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
  99. package/build/dex/bebop/websocket-fetcher.js +0 -87
  100. package/build/dex/bebop/websocket-fetcher.js.map +0 -1
  101. package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
  102. package/build/dex/idle-dao/idle-dao-pool.js +0 -176
  103. package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
  104. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
  105. package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
  106. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
  107. package/build/dex/idle-dao/scripts.d.ts +0 -9
  108. package/build/dex/idle-dao/scripts.js +0 -552
  109. package/build/dex/idle-dao/scripts.js.map +0 -1
  110. package/build/dex/inception/config.d.ts +0 -4
  111. package/build/dex/inception/config.js +0 -109
  112. package/build/dex/inception/config.js.map +0 -1
  113. package/build/dex/inception/inception-event-pool.d.ts +0 -16
  114. package/build/dex/inception/inception-event-pool.js +0 -51
  115. package/build/dex/inception/inception-event-pool.js.map +0 -1
  116. package/build/dex/inception/inception-native.d.ts +0 -43
  117. package/build/dex/inception/inception-native.js +0 -131
  118. package/build/dex/inception/inception-native.js.map +0 -1
  119. package/build/dex/inception/inception-pool.d.ts +0 -18
  120. package/build/dex/inception/inception-pool.js +0 -32
  121. package/build/dex/inception/inception-pool.js.map +0 -1
  122. package/build/dex/inception/inception-price-feed.d.ts +0 -19
  123. package/build/dex/inception/inception-price-feed.js +0 -51
  124. package/build/dex/inception/inception-price-feed.js.map +0 -1
  125. package/build/dex/inception/inception.d.ts +0 -43
  126. package/build/dex/inception/inception.js +0 -204
  127. package/build/dex/inception/inception.js.map +0 -1
  128. package/build/dex/inception/tokens.d.ts +0 -9
  129. package/build/dex/inception/tokens.js +0 -28
  130. package/build/dex/inception/tokens.js.map +0 -1
  131. package/build/dex/inception/types.d.ts +0 -22
  132. package/build/dex/inception/types.js +0 -3
  133. package/build/dex/inception/types.js.map +0 -1
  134. package/build/dex/inception/utils.d.ts +0 -6
  135. package/build/dex/inception/utils.js +0 -37
  136. package/build/dex/inception/utils.js.map +0 -1
  137. package/build/dex/jarvis.d.ts +0 -56
  138. package/build/dex/jarvis.js +0 -163
  139. package/build/dex/jarvis.js.map +0 -1
  140. package/build/dex/mStable.d.ts +0 -44
  141. package/build/dex/mStable.js +0 -75
  142. package/build/dex/mStable.js.map +0 -1
  143. package/build/dex/onebit/onebit.d.ts +0 -16
  144. package/build/dex/onebit/onebit.js +0 -61
  145. package/build/dex/onebit/onebit.js.map +0 -1
  146. package/build/dex/onebit/types.d.ts +0 -14
  147. package/build/dex/onebit/types.js +0 -8
  148. package/build/dex/onebit/types.js.map +0 -1
  149. package/build/dex/platypus/asset.d.ts +0 -14
  150. package/build/dex/platypus/asset.js +0 -97
  151. package/build/dex/platypus/asset.js.map +0 -1
  152. package/build/dex/platypus/config.d.ts +0 -11
  153. package/build/dex/platypus/config.js +0 -69
  154. package/build/dex/platypus/config.js.map +0 -1
  155. package/build/dex/platypus/platypus.d.ts +0 -63
  156. package/build/dex/platypus/platypus.js +0 -473
  157. package/build/dex/platypus/platypus.js.map +0 -1
  158. package/build/dex/platypus/pool-avax.d.ts +0 -8
  159. package/build/dex/platypus/pool-avax.js +0 -54
  160. package/build/dex/platypus/pool-avax.js.map +0 -1
  161. package/build/dex/platypus/pool-base.d.ts +0 -19
  162. package/build/dex/platypus/pool-base.js +0 -86
  163. package/build/dex/platypus/pool-base.js.map +0 -1
  164. package/build/dex/platypus/pool-pure.d.ts +0 -8
  165. package/build/dex/platypus/pool-pure.js +0 -37
  166. package/build/dex/platypus/pool-pure.js.map +0 -1
  167. package/build/dex/platypus/pool-subscriber.d.ts +0 -14
  168. package/build/dex/platypus/pool-subscriber.js +0 -167
  169. package/build/dex/platypus/pool-subscriber.js.map +0 -1
  170. package/build/dex/platypus/pool.d.ts +0 -8
  171. package/build/dex/platypus/pool.js +0 -58
  172. package/build/dex/platypus/pool.js.map +0 -1
  173. package/build/dex/platypus/types.d.ts +0 -92
  174. package/build/dex/platypus/types.js +0 -10
  175. package/build/dex/platypus/types.js.map +0 -1
  176. package/build/dex/quickswap/spiritswap-v3.d.ts +0 -6
  177. package/build/dex/quickswap/spiritswap-v3.js +0 -19
  178. package/build/dex/quickswap/spiritswap-v3.js.map +0 -1
  179. package/build/dex/shell.d.ts +0 -25
  180. package/build/dex/shell.js +0 -41
  181. package/build/dex/shell.js.map +0 -1
  182. package/build/dex/smardex/config.d.ts +0 -4
  183. package/build/dex/smardex/config.js +0 -64
  184. package/build/dex/smardex/config.js.map +0 -1
  185. package/build/dex/smardex/constants.d.ts +0 -18
  186. package/build/dex/smardex/constants.js +0 -33
  187. package/build/dex/smardex/constants.js.map +0 -1
  188. package/build/dex/smardex/sdk/constants.d.ts +0 -6
  189. package/build/dex/smardex/sdk/constants.js +0 -13
  190. package/build/dex/smardex/sdk/constants.js.map +0 -1
  191. package/build/dex/smardex/sdk/core.d.ts +0 -113
  192. package/build/dex/smardex/sdk/core.js +0 -499
  193. package/build/dex/smardex/sdk/core.js.map +0 -1
  194. package/build/dex/smardex/sdk/errors.d.ts +0 -15
  195. package/build/dex/smardex/sdk/errors.js +0 -22
  196. package/build/dex/smardex/sdk/errors.js.map +0 -1
  197. package/build/dex/smardex/sdk/types.d.ts +0 -62
  198. package/build/dex/smardex/sdk/types.js +0 -3
  199. package/build/dex/smardex/sdk/types.js.map +0 -1
  200. package/build/dex/smardex/sdk/utils.d.ts +0 -44
  201. package/build/dex/smardex/sdk/utils.js +0 -133
  202. package/build/dex/smardex/sdk/utils.js.map +0 -1
  203. package/build/dex/smardex/smardex-event-pool.d.ts +0 -28
  204. package/build/dex/smardex/smardex-event-pool.js +0 -119
  205. package/build/dex/smardex/smardex-event-pool.js.map +0 -1
  206. package/build/dex/smardex/smardex.d.ts +0 -65
  207. package/build/dex/smardex/smardex.js +0 -519
  208. package/build/dex/smardex/smardex.js.map +0 -1
  209. package/build/dex/smardex/types.d.ts +0 -55
  210. package/build/dex/smardex/types.js +0 -3
  211. package/build/dex/smardex/types.js.map +0 -1
  212. package/build/dex/solidly/forks-override/cone.d.ts +0 -22
  213. package/build/dex/solidly/forks-override/cone.js +0 -53
  214. package/build/dex/solidly/forks-override/cone.js.map +0 -1
  215. package/build/dex/solidly/forks-override/solisnek.d.ts +0 -8
  216. package/build/dex/solidly/forks-override/solisnek.js +0 -15
  217. package/build/dex/solidly/forks-override/solisnek.js.map +0 -1
  218. package/build/dex/swaap-v1/config.d.ts +0 -17
  219. package/build/dex/swaap-v1/config.js +0 -56
  220. package/build/dex/swaap-v1/config.js.map +0 -1
  221. package/build/dex/swaap-v1/constants.d.ts +0 -6
  222. package/build/dex/swaap-v1/constants.js +0 -17
  223. package/build/dex/swaap-v1/constants.js.map +0 -1
  224. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +0 -25
  225. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +0 -62
  226. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +0 -1
  227. package/build/dex/swaap-v1/libraries/Const.d.ts +0 -18
  228. package/build/dex/swaap-v1/libraries/Const.js +0 -26
  229. package/build/dex/swaap-v1/libraries/Const.js.map +0 -1
  230. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +0 -77
  231. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +0 -316
  232. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +0 -1
  233. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +0 -75
  234. package/build/dex/swaap-v1/libraries/LogExpMath.js +0 -418
  235. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +0 -1
  236. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +0 -185
  237. package/build/dex/swaap-v1/libraries/MathMMM.js +0 -453
  238. package/build/dex/swaap-v1/libraries/MathMMM.js.map +0 -1
  239. package/build/dex/swaap-v1/libraries/Num.d.ts +0 -31
  240. package/build/dex/swaap-v1/libraries/Num.js +0 -167
  241. package/build/dex/swaap-v1/libraries/Num.js.map +0 -1
  242. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +0 -23
  243. package/build/dex/swaap-v1/libraries/PoolQuotations.js +0 -131
  244. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +0 -1
  245. package/build/dex/swaap-v1/libraries/Struct.d.ts +0 -56
  246. package/build/dex/swaap-v1/libraries/Struct.js +0 -3
  247. package/build/dex/swaap-v1/libraries/Struct.js.map +0 -1
  248. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +0 -45
  249. package/build/dex/swaap-v1/swaap-v1-pool.js +0 -656
  250. package/build/dex/swaap-v1/swaap-v1-pool.js.map +0 -1
  251. package/build/dex/swaap-v1/swaap-v1.d.ts +0 -62
  252. package/build/dex/swaap-v1/swaap-v1.js +0 -379
  253. package/build/dex/swaap-v1/swaap-v1.js.map +0 -1
  254. package/build/dex/swaap-v1/types.d.ts +0 -106
  255. package/build/dex/swaap-v1/types.js +0 -9
  256. package/build/dex/swaap-v1/types.js.map +0 -1
  257. package/build/dex/trader-joe-v2.d.ts +0 -40
  258. package/build/dex/trader-joe-v2.js +0 -74
  259. package/build/dex/trader-joe-v2.js.map +0 -1
  260. package/build/dex/usual-bond/config.d.ts +0 -3
  261. package/build/dex/usual-bond/config.js +0 -13
  262. package/build/dex/usual-bond/config.js.map +0 -1
  263. package/build/dex/usual-bond/types.d.ts +0 -7
  264. package/build/dex/usual-bond/types.js +0 -3
  265. package/build/dex/usual-bond/types.js.map +0 -1
  266. package/build/dex/usual-bond/usual-bond.d.ts +0 -35
  267. package/build/dex/usual-bond/usual-bond.js +0 -176
  268. package/build/dex/usual-bond/usual-bond.js.map +0 -1
  269. package/build/dex/wusdm/config.d.ts +0 -3
  270. package/build/dex/wusdm/config.js +0 -43
  271. package/build/dex/wusdm/config.js.map +0 -1
  272. package/build/dex/wusdm/constants.d.ts +0 -2
  273. package/build/dex/wusdm/constants.js +0 -6
  274. package/build/dex/wusdm/constants.js.map +0 -1
  275. package/build/dex/wusdm/types.d.ts +0 -18
  276. package/build/dex/wusdm/types.js +0 -11
  277. package/build/dex/wusdm/types.js.map +0 -1
  278. package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
  279. package/build/dex/wusdm/wusdm-pool.js +0 -74
  280. package/build/dex/wusdm/wusdm-pool.js.map +0 -1
  281. package/build/dex/wusdm/wusdm.d.ts +0 -46
  282. package/build/dex/wusdm/wusdm.js +0 -243
  283. package/build/dex/wusdm/wusdm.js.map +0 -1
  284. package/build/dex/zerox/config.d.ts +0 -2
  285. package/build/dex/zerox/config.js +0 -33
  286. package/build/dex/zerox/config.js.map +0 -1
  287. package/build/dex/zerox/index.d.ts +0 -22
  288. package/build/dex/zerox/index.js +0 -225
  289. package/build/dex/zerox/index.js.map +0 -1
  290. package/build/dex/zerox/order.d.ts +0 -88
  291. package/build/dex/zerox/order.js +0 -53
  292. package/build/dex/zerox/order.js.map +0 -1
  293. package/build/dex/zerox/types.d.ts +0 -73
  294. package/build/dex/zerox/types.js +0 -21
  295. package/build/dex/zerox/types.js.map +0 -1
  296. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
  297. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
  298. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
  299. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
  300. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
  301. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
  302. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
  303. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
  304. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
  305. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
  306. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
  307. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
  308. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
  309. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
  310. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
  311. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
  312. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
  313. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
  314. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
  315. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
  316. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
  317. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
  318. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
  319. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
  320. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
  321. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
  322. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
  323. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
  324. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
  325. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
  326. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
  327. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
  328. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
  329. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
  330. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
  331. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
  332. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
  333. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
  334. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
  335. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
  336. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
  337. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
  338. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
  339. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
  340. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
  341. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
  342. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
  343. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
  344. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
  345. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
  346. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
  347. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
  348. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
  349. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
  350. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
  351. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
  352. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
  353. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
  354. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
  355. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
  356. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
  357. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
  358. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
  359. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
  360. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
  361. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
  362. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
  363. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
  364. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
  365. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
  366. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
  367. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
  368. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
  369. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
@@ -1,40 +0,0 @@
1
- import { SwapSide } from '../constants';
2
- import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
3
- import { IDexTxBuilder } from './idex';
4
- import { IDexHelper } from '../dex-helper';
5
- import { SimpleExchange } from './simple-exchange';
6
- import { NumberAsString } from '@paraswap/core';
7
- import { AsyncOrSync } from 'ts-essentials';
8
- import { Interface } from '@ethersproject/abi';
9
- declare type TraderJoeV2RouterSellParams = [
10
- _amountIn: NumberAsString,
11
- _amountOutMin: NumberAsString,
12
- _pairBinSteps: NumberAsString[],
13
- _tokenPath: Address[],
14
- to: Address,
15
- _deadline: number
16
- ];
17
- declare type TraderJoeV2RouterBuyParams = [
18
- _amountOut: NumberAsString,
19
- _amountInMax: NumberAsString,
20
- _pairBinSteps: NumberAsString[],
21
- _tokenPath: Address[],
22
- to: Address,
23
- _deadline: string
24
- ];
25
- declare type TraderJoeV2RouterParam = TraderJoeV2RouterSellParams | TraderJoeV2RouterBuyParams;
26
- export declare type TraderJoeV2Data = {
27
- tokenIn: string;
28
- tokenOut: string;
29
- binStep: string;
30
- };
31
- export declare class TraderJoeV2 extends SimpleExchange implements IDexTxBuilder<TraderJoeV2Data, TraderJoeV2RouterParam> {
32
- static dexKeys: string[];
33
- protected routerAddress: string;
34
- exchangeRouterInterface: Interface;
35
- needWrapNative: boolean;
36
- constructor(dexHelper: IDexHelper);
37
- getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AdapterExchangeParam;
38
- getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AsyncOrSync<SimpleExchangeParam>;
39
- }
40
- export {};
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TraderJoeV2 = void 0;
7
- const constants_1 = require("../constants");
8
- const simple_exchange_1 = require("./simple-exchange");
9
- const abi_1 = require("@ethersproject/abi");
10
- const TraderJoeV2Router_json_1 = __importDefault(require("../abi/TraderJoeV2Router.json"));
11
- const TRADERJOE_V2_ROUTER_ADDRESS = {
12
- [constants_1.Network.AVALANCHE]: '0xE3Ffc583dC176575eEA7FD9dF2A7c65F7E23f4C3',
13
- [constants_1.Network.ARBITRUM]: '0x7BFd7192E76D950832c77BB412aaE841049D8D9B',
14
- [constants_1.Network.BSC]: '0xb66A2704a0dabC1660941628BE987B4418f7a9E8',
15
- };
16
- var TraderJoeV2RouterFunctions;
17
- (function (TraderJoeV2RouterFunctions) {
18
- TraderJoeV2RouterFunctions["swapExactTokensForTokens"] = "swapExactTokensForTokens";
19
- TraderJoeV2RouterFunctions["swapTokensForExactTokens"] = "swapTokensForExactTokens";
20
- })(TraderJoeV2RouterFunctions || (TraderJoeV2RouterFunctions = {}));
21
- class TraderJoeV2 extends simple_exchange_1.SimpleExchange {
22
- constructor(dexHelper) {
23
- super(dexHelper, 'traderjoev2');
24
- this.needWrapNative = true;
25
- this.routerAddress =
26
- TRADERJOE_V2_ROUTER_ADDRESS[dexHelper.config.data.network];
27
- this.exchangeRouterInterface = new abi_1.Interface(TraderJoeV2Router_json_1.default);
28
- }
29
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
30
- const payload = this.abiCoder.encodeParameter({
31
- ParentStruct: {
32
- _pairBinSteps: 'uint256[]',
33
- _tokenPath: 'address[]',
34
- _deadline: 'uint256',
35
- },
36
- }, {
37
- _pairBinSteps: [data.binStep],
38
- _tokenPath: [data.tokenIn, data.tokenOut],
39
- _deadline: (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(), // FIXME: more gas efficient to pass block.timestamp in adapter
40
- });
41
- return {
42
- targetExchange: this.routerAddress,
43
- payload,
44
- networkFee: '0',
45
- };
46
- }
47
- getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
48
- const swapFunction = side === constants_1.SwapSide.SELL
49
- ? TraderJoeV2RouterFunctions.swapExactTokensForTokens
50
- : TraderJoeV2RouterFunctions.swapTokensForExactTokens;
51
- const swapFunctionParams = side === constants_1.SwapSide.SELL
52
- ? [
53
- srcAmount,
54
- destAmount,
55
- [data.binStep],
56
- [srcToken, destToken],
57
- this.augustusAddress,
58
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
59
- ]
60
- : [
61
- destAmount,
62
- srcAmount,
63
- [data.binStep],
64
- [srcToken, destToken],
65
- this.augustusAddress,
66
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
67
- ];
68
- const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
69
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.routerAddress);
70
- }
71
- }
72
- exports.TraderJoeV2 = TraderJoeV2;
73
- TraderJoeV2.dexKeys = ['traderjoev2'];
74
- //# sourceMappingURL=trader-joe-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trader-joe-v2.js","sourceRoot":"","sources":["../../src/dex/trader-joe-v2.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAiD;AAIjD,uDAG2B;AAG3B,4CAA6D;AAC7D,2FAAiE;AAEjE,MAAM,2BAA2B,GAAmC;IAClE,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE,4CAA4C;IACjE,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IAChE,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE,4CAA4C;CAC5D,CAAC;AA8BF,IAAK,0BAGJ;AAHD,WAAK,0BAA0B;IAC7B,mFAAqD,CAAA;IACrD,mFAAqD,CAAA;AACvD,CAAC,EAHI,0BAA0B,KAA1B,0BAA0B,QAG9B;AAED,MAAa,WACX,SAAQ,gCAAc;IAQtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAHlC,mBAAc,GAAG,IAAI,CAAC;QAKpB,IAAI,CAAC,aAAa;YAChB,2BAA2B,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1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xC,CAAC;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;;AA9FH,kCA+FC;AA3FQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap } from '../../types';
3
- export declare const UsualBondConfig: DexConfigMap<DexParams>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsualBondConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.UsualBondConfig = {
6
- UsualBond: {
7
- [constants_1.Network.MAINNET]: {
8
- usd0Address: '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5',
9
- usd0ppAddress: '0x35D8949372D46B7a3D5A56006AE77B215fc69bC0',
10
- },
11
- },
12
- };
13
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,eAAe,GAA4B;IACtD,SAAS,EAAE;QACT,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,WAAW,EAAE,4CAA4C;YACzD,aAAa,EAAE,4CAA4C;SAC5D;KACF;CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Address } from '../../types';
2
- export type PoolState = {};
3
- export type UsualBondData = {};
4
- export type DexParams = {
5
- usd0Address: Address;
6
- usd0ppAddress: Address;
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/types.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, NumberAsString, DexExchangeParam, PoolLiquidity } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex } from '../idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { UsualBondData, DexParams } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- import { Interface } from '@ethersproject/abi';
8
- export declare class UsualBond extends SimpleExchange implements IDex<UsualBondData> {
9
- readonly network: Network;
10
- readonly dexKey: string;
11
- readonly dexHelper: IDexHelper;
12
- protected config: DexParams;
13
- readonly hasConstantPriceLargeAmounts = true;
14
- readonly needWrapNative = false;
15
- readonly isFeeOnTransferSupported = false;
16
- static dexKeysWithNetwork: {
17
- key: string;
18
- networks: Network[];
19
- }[];
20
- usd0ppIface: Interface;
21
- logger: Logger;
22
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
23
- initializePricing(blockNumber: number): Promise<void>;
24
- getConfig(): DexParams;
25
- is_usd0(token: string): boolean;
26
- is_usd0pp(token: string): boolean;
27
- is_usd0_swap_token(srcToken: string, destToken: string): boolean;
28
- getAdapters(): null;
29
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
30
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<UsualBondData>>;
31
- getCalldataGasCost(poolPrices: PoolPrices<UsualBondData>): number | number[];
32
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UsualBondData, side: SwapSide): AdapterExchangeParam;
33
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UsualBondData, side: SwapSide): Promise<DexExchangeParam>;
34
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
35
- }
@@ -1,176 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.UsualBond = void 0;
40
- const constants_1 = require("../../constants");
41
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
42
- const utils_1 = require("../../utils");
43
- const simple_exchange_1 = require("../simple-exchange");
44
- const config_1 = require("./config");
45
- const abi_1 = require("@ethersproject/abi");
46
- const usd0pp_abi_json_1 = __importDefault(require("../../abi/usual-bond/usd0pp.abi.json"));
47
- const bigint_constants_1 = require("../../bigint-constants");
48
- class UsualBond extends simple_exchange_1.SimpleExchange {
49
- network;
50
- dexKey;
51
- dexHelper;
52
- config;
53
- hasConstantPriceLargeAmounts = true;
54
- needWrapNative = false;
55
- isFeeOnTransferSupported = false;
56
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.UsualBondConfig);
57
- usd0ppIface;
58
- logger;
59
- constructor(network, dexKey, dexHelper) {
60
- super(dexHelper, dexKey);
61
- this.network = network;
62
- this.dexKey = dexKey;
63
- this.dexHelper = dexHelper;
64
- const config = config_1.UsualBondConfig[dexKey][network];
65
- this.usd0ppIface = new abi_1.Interface(usd0pp_abi_json_1.default);
66
- this.config = {
67
- usd0Address: config.usd0Address.toLowerCase(),
68
- usd0ppAddress: config.usd0ppAddress.toLowerCase(),
69
- };
70
- this.logger = dexHelper.getLogger(dexKey);
71
- }
72
- async initializePricing(blockNumber) {
73
- // No initialization needed for constant price
74
- }
75
- getConfig() {
76
- return this.config;
77
- }
78
- is_usd0(token) {
79
- return token.toLowerCase() === this.config.usd0Address.toLowerCase();
80
- }
81
- is_usd0pp(token) {
82
- return token.toLowerCase() === this.config.usd0ppAddress.toLowerCase();
83
- }
84
- is_usd0_swap_token(srcToken, destToken) {
85
- return this.is_usd0(srcToken) && this.is_usd0pp(destToken);
86
- }
87
- getAdapters() {
88
- return null;
89
- }
90
- async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
91
- if (!srcToken || !destToken) {
92
- this.logger.error('Source or destination token is undefined');
93
- return [];
94
- }
95
- const srcTokenAddress = srcToken.address?.toLowerCase();
96
- const destTokenAddress = destToken.address?.toLowerCase();
97
- if (!srcTokenAddress || !destTokenAddress) {
98
- this.logger.error('Source or destination token address is undefined');
99
- return [];
100
- }
101
- if (this.is_usd0_swap_token(srcTokenAddress, destTokenAddress)) {
102
- return [`${this.dexKey}_${this.config.usd0ppAddress}`];
103
- }
104
- return [];
105
- }
106
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
107
- if (side === constants_1.SwapSide.BUY) {
108
- return null;
109
- }
110
- const isUSD0SwapToken = this.is_usd0_swap_token(srcToken.address, destToken.address);
111
- if (!isUSD0SwapToken) {
112
- return null;
113
- }
114
- const unitOut = bigint_constants_1.BI_POWS[18]; // 1:1 swap
115
- const amountsOut = amounts; // 1:1 swap, so output amounts are the same as input
116
- return [
117
- {
118
- unit: unitOut,
119
- prices: amountsOut,
120
- data: {},
121
- poolAddresses: [this.config.usd0ppAddress],
122
- exchange: this.dexKey,
123
- gasCost: 70000,
124
- poolIdentifier: this.dexKey,
125
- },
126
- ];
127
- }
128
- getCalldataGasCost(poolPrices) {
129
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
130
- }
131
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
132
- const payload = '0x';
133
- return {
134
- targetExchange: this.config.usd0ppAddress,
135
- payload,
136
- networkFee: '0',
137
- };
138
- }
139
- async getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
140
- if (this.is_usd0(srcToken) && this.is_usd0pp(destToken)) {
141
- const exchangeData = this.usd0ppIface.encodeFunctionData('mint', [
142
- srcAmount,
143
- ]);
144
- return {
145
- needWrapNative: false,
146
- dexFuncHasRecipient: false,
147
- exchangeData,
148
- targetExchange: this.config.usd0ppAddress,
149
- returnAmountPos: undefined,
150
- };
151
- }
152
- throw new Error('LOGIC ERROR');
153
- }
154
- async getTopPoolsForToken(tokenAddress, limit) {
155
- const isUsd0 = this.is_usd0(tokenAddress);
156
- if (!isUsd0 && !this.is_usd0pp(tokenAddress))
157
- return [];
158
- return [
159
- {
160
- exchange: this.dexKey,
161
- address: this.config.usd0ppAddress,
162
- connectorTokens: [
163
- {
164
- decimals: 18,
165
- address: isUsd0
166
- ? this.config.usd0ppAddress
167
- : this.config.usd0Address,
168
- },
169
- ],
170
- liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
171
- },
172
- ];
173
- }
174
- }
175
- exports.UsualBond = UsualBond;
176
- //# sourceMappingURL=usual-bond.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usual-bond.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/usual-bond.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2C;AAC3C,4CAA6D;AAC7D,2FAA8D;AAC9D,6DAAiD;AAEjD,MAAa,SAAU,SAAQ,gCAAc;IAchC;IACA;IACA;IAfD,MAAM,CAAY;IAEnB,4BAA4B,GAAG,IAAI,CAAC;IACpC,cAAc,GAAG,KAAK,CAAC;IACvB,wBAAwB,GAAG,KAAK,CAAC;IAEnC,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,wBAAe,CAAC,CAAC;IAEzC,WAAW,CAAY;IACvB,MAAM,CAAS;IAEf,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QAG9B,MAAM,MAAM,GAAG,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,IAAI,eAAS,CAAC,yBAA4B,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG;YACZ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE;YAC7C,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE;SAClD,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,WAAmB;QACzC,8CAA8C;IAChD,CAAC;IAED,SAAS;QACP,OAAO,IAAI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AAC,QAAQ,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YACxD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,MAAM,EAAE;gBAC/D,SAAS;aACV,CAAC,CAAC;YAEH,OAAO;gBACL,cAAc,EAAE,KAAK;gBACrB,mBAAmB,EAAE,KAAK;gBAC1B,YAAY;gBACZ,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;gBACzC,eAAe,EAAE,SAAS;aAC3B,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;YAAE,OAAO,EAAE,CAAC;QAExD,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,MAAM;gBACrB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;gBAClC,eAAe,EAAE;oBACf;wBACE,QAAQ,EAAE,EAAE;wBACZ,OAAO,EAAE,MAAM;4BACb,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;4BAC3B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;qBAC5B;iBACF;gBACD,YAAY,EAAE,UAAU,EAAE,4DAA4D;aACvF;SACF,CAAC;IACJ,CAAC;;AAvLH,8BAwLC"}
@@ -1,3 +0,0 @@
1
- import { WusdmParams } from './types';
2
- import { DexConfigMap } from '../../types';
3
- export declare const WUSDMConfig: DexConfigMap<WusdmParams>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WUSDMConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.WUSDMConfig = {
6
- wUSDM: {
7
- [constants_1.Network.MAINNET]: {
8
- wUSDMAddress: '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812',
9
- USDMAddress: '0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C',
10
- },
11
- [constants_1.Network.OPTIMISM]: {
12
- wUSDMAddress: '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812',
13
- USDMAddress: '0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C',
14
- },
15
- [constants_1.Network.ARBITRUM]: {
16
- wUSDMAddress: '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812',
17
- USDMAddress: '0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C',
18
- },
19
- [constants_1.Network.BASE]: {
20
- wUSDMAddress: '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812',
21
- USDMAddress: '0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C',
22
- },
23
- [constants_1.Network.POLYGON]: {
24
- wUSDMAddress: '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812',
25
- USDMAddress: '0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C',
26
- },
27
- },
28
- // not really wUSDM, but works in the same way
29
- // might give 1wei difference on BUY
30
- sDAI: {
31
- [constants_1.Network.GNOSIS]: {
32
- wUSDMAddress: '0xaf204776c7245bF4147c2612BF6e5972Ee483701', // sDAI
33
- USDMAddress: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', // WXDAI
34
- },
35
- },
36
- wUSDL: {
37
- [constants_1.Network.MAINNET]: {
38
- wUSDMAddress: '0x7751E2F4b8ae93EF6B79d86419d42FE3295A4559', // wUSDL
39
- USDMAddress: '0xbdC7c08592Ee4aa51D06C27Ee23D5087D65aDbcD', // USDL
40
- },
41
- },
42
- };
43
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/wusdm/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,WAAW,GAA8B;IACpD,KAAK,EAAE;QACL,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,YAAY,EAAE,4CAA4C;YAC1D,WAAW,EAAE,4CAA4C;SAC1D;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,YAAY,EAAE,4CAA4C;YAC1D,WAAW,EAAE,4CAA4C;SAC1D;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,YAAY,EAAE,4CAA4C;YAC1D,WAAW,EAAE,4CAA4C;SAC1D;QACD,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,YAAY,EAAE,4CAA4C;YAC1D,WAAW,EAAE,4CAA4C;SAC1D;QACD,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,YAAY,EAAE,4CAA4C;YAC1D,WAAW,EAAE,4CAA4C;SAC1D;KACF;IACD,8CAA8C;IAC9C,oCAAoC;IACpC,IAAI,EAAE;QACJ,CAAC,mBAAO,CAAC,MAAM,CAAC,EAAE;YAChB,YAAY,EAAE,4CAA4C,EAAE,OAAO;YACnE,WAAW,EAAE,4CAA4C,EAAE,QAAQ;SACpE;KACF;IAED,KAAK,EAAE;QACL,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,YAAY,EAAE,4CAA4C,EAAE,QAAQ;YACpE,WAAW,EAAE,4CAA4C,EAAE,OAAO;SACnE;KACF;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const WITHDRAW_TOPIC = "0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db";
2
- export declare const DEPOSIT_TOPIC = "0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEPOSIT_TOPIC = exports.WITHDRAW_TOPIC = void 0;
4
- exports.WITHDRAW_TOPIC = '0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db';
5
- exports.DEPOSIT_TOPIC = '0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7';
6
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dex/wusdm/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GACxB,oEAAoE,CAAC"}
@@ -1,18 +0,0 @@
1
- import { Address } from '../../types';
2
- export type WusdmPoolState = {
3
- totalShares: bigint;
4
- totalAssets: bigint;
5
- };
6
- export type WUSDMData = {
7
- exchange: string;
8
- };
9
- export declare enum WUSDMFunctions {
10
- deposit = "deposit",
11
- redeem = "redeem",
12
- withdraw = "withdraw",
13
- mint = "mint"
14
- }
15
- export type WusdmParams = {
16
- wUSDMAddress: Address;
17
- USDMAddress: Address;
18
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WUSDMFunctions = void 0;
4
- var WUSDMFunctions;
5
- (function (WUSDMFunctions) {
6
- WUSDMFunctions["deposit"] = "deposit";
7
- WUSDMFunctions["redeem"] = "redeem";
8
- WUSDMFunctions["withdraw"] = "withdraw";
9
- WUSDMFunctions["mint"] = "mint";
10
- })(WUSDMFunctions || (exports.WUSDMFunctions = WUSDMFunctions = {}));
11
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/wusdm/types.ts"],"names":[],"mappings":";;;AAWA,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
@@ -1,21 +0,0 @@
1
- import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
2
- import { Interface } from '@ethersproject/abi';
3
- import type { IDexHelper } from '../../dex-helper';
4
- import type { DeepReadonly } from 'ts-essentials';
5
- import type { Address, BlockHeader, Log, Logger } from '../../types';
6
- import type { WusdmPoolState } from './types';
7
- import { Network } from '../../constants';
8
- export declare class WusdmEventPool extends StatefulEventSubscriber<WusdmPoolState> {
9
- protected dexHelper: IDexHelper;
10
- private wrapperAddress;
11
- private wrapperInterface;
12
- private depositTopic;
13
- private withdrawTopic;
14
- logDecoder: (log: Log) => any;
15
- constructor(parentName: string, network: Network, poolName: string, dexHelper: IDexHelper, wrapperAddress: Address, wrapperInterface: Interface, logger: Logger, depositTopic: string, withdrawTopic: string);
16
- protected processLog(state: DeepReadonly<WusdmPoolState>, log: Readonly<Log>, blockHeader: Readonly<BlockHeader>): Promise<DeepReadonly<WusdmPoolState> | null>;
17
- generateState(blockNumber?: number | 'latest'): Promise<DeepReadonly<WusdmPoolState>>;
18
- getOrGenerateState(blockNumber: number): Promise<WusdmPoolState>;
19
- handleDeposit(event: any, state: DeepReadonly<WusdmPoolState>, log: Readonly<Log>): Promise<DeepReadonly<WusdmPoolState>>;
20
- handleWithdraw(event: any, state: DeepReadonly<WusdmPoolState>, log: Readonly<Log>): Promise<DeepReadonly<WusdmPoolState>>;
21
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WusdmEventPool = void 0;
4
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
5
- const decoders_1 = require("../../lib/decoders");
6
- class WusdmEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
7
- dexHelper;
8
- wrapperAddress;
9
- wrapperInterface;
10
- depositTopic;
11
- withdrawTopic;
12
- logDecoder;
13
- constructor(parentName, network, poolName, dexHelper, wrapperAddress, wrapperInterface, logger, depositTopic, withdrawTopic) {
14
- super(parentName, poolName, dexHelper, logger);
15
- this.dexHelper = dexHelper;
16
- this.wrapperAddress = wrapperAddress;
17
- this.wrapperInterface = wrapperInterface;
18
- this.depositTopic = depositTopic;
19
- this.withdrawTopic = withdrawTopic;
20
- this.addressesSubscribed = [wrapperAddress];
21
- this.logDecoder = (log) => this.wrapperInterface.parseLog(log);
22
- }
23
- async processLog(state, log, blockHeader) {
24
- const event = this.logDecoder(log);
25
- if (log.topics[0] === this.depositTopic) {
26
- return this.handleDeposit(event, state, log);
27
- }
28
- if (log.topics[0] === this.withdrawTopic) {
29
- return this.handleWithdraw(event, state, log);
30
- }
31
- return null;
32
- }
33
- async generateState(blockNumber = 'latest') {
34
- const calls = [
35
- {
36
- target: this.wrapperAddress,
37
- callData: this.wrapperInterface.encodeFunctionData('totalAssets', []),
38
- decodeFunction: decoders_1.uint256ToBigInt,
39
- },
40
- {
41
- target: this.wrapperAddress,
42
- callData: this.wrapperInterface.encodeFunctionData('totalSupply', []),
43
- decodeFunction: decoders_1.uint256ToBigInt,
44
- },
45
- ];
46
- const [totalAssets, totalSupply] = await this.dexHelper.multiWrapper.tryAggregate(true, calls, blockNumber);
47
- return {
48
- totalAssets: totalAssets.returnData,
49
- totalShares: totalSupply.returnData,
50
- };
51
- }
52
- async getOrGenerateState(blockNumber) {
53
- let state = this.getState(blockNumber);
54
- if (!state) {
55
- state = await this.generateState(blockNumber);
56
- this.setState(state, blockNumber);
57
- }
58
- return state;
59
- }
60
- async handleDeposit(event, state, log) {
61
- return {
62
- totalAssets: state.totalAssets + BigInt(event.args.assets),
63
- totalShares: state.totalShares + BigInt(event.args.shares),
64
- };
65
- }
66
- async handleWithdraw(event, state, log) {
67
- return {
68
- totalAssets: BigInt(state.totalAssets) - BigInt(event.args.assets),
69
- totalShares: BigInt(state.totalShares) - BigInt(event.args.shares),
70
- };
71
- }
72
- }
73
- exports.WusdmEventPool = WusdmEventPool;
74
- //# sourceMappingURL=wusdm-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wusdm-pool.js","sourceRoot":"","sources":["../../../src/dex/wus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KAAK,CAAC,cAAc,CAClB,KAAU,EACV,KAAmC,EACnC,GAAkB;QAElB,OAAO;YACL,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;YAClE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;SACnE,CAAC;IACJ,CAAC;CACF;AA7FD,wCA6FC"}
@@ -1,46 +0,0 @@
1
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex, Context } from '../../dex/idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { WUSDMData, WusdmParams, WusdmPoolState } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- import { WusdmEventPool } from './wusdm-pool';
8
- import { Interface } from '@ethersproject/abi';
9
- export declare class WUSDM extends SimpleExchange implements IDex<WUSDMData, WusdmParams> {
10
- readonly network: Network;
11
- readonly dexKey: string;
12
- readonly dexHelper: IDexHelper;
13
- readonly wUSDMAddress: string;
14
- readonly USDMAddress: string;
15
- readonly wUSDMInterface: Interface;
16
- readonly hasConstantPriceLargeAmounts = true;
17
- readonly isFeeOnTransferSupported = false;
18
- readonly needWrapNative: boolean;
19
- static dexKeysWithNetwork: {
20
- key: string;
21
- networks: Network[];
22
- }[];
23
- readonly eventPool: WusdmEventPool;
24
- logger: Logger;
25
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, wUSDMAddress?: string, USDMAddress?: string, wUSDMInterface?: Interface);
26
- getAdapters(side: SwapSide): {
27
- name: string;
28
- index: number;
29
- }[] | null;
30
- isAppropriatePair(srcToken: Token, destToken: Token): boolean;
31
- initializePricing(blockNumber: number): Promise<void>;
32
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
33
- isUSDM(tokenAddress: Address): boolean;
34
- isWUSDM(tokenAddress: Address): boolean;
35
- isWrap(srcToken: Token, destToken: Token, side: SwapSide): boolean;
36
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<WUSDMData>>;
37
- getCalldataGasCost(poolPrices: PoolPrices<WUSDMData>): number | number[];
38
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
39
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: WUSDMData, side: SwapSide): Promise<SimpleExchangeParam>;
40
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: WUSDMData, side: SwapSide, _: Context, executorAddress: Address): DexExchangeParam;
41
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: WUSDMData, side: SwapSide): AdapterExchangeParam;
42
- previewRedeem(shares: bigint, state: WusdmPoolState): bigint;
43
- previewMint(shares: bigint, state: WusdmPoolState): bigint;
44
- previewWithdraw(assets: bigint, state: WusdmPoolState): bigint;
45
- previewDeposit(assets: bigint, state: WusdmPoolState): bigint;
46
- }