@paraswap/dex-lib 3.11.8-stader.3 → 3.11.8

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 (269) hide show
  1. package/.vscode/launch.json +53 -0
  2. package/.vscode/settings.json +2 -0
  3. package/.vscode/tasks.json +15 -0
  4. package/build/abi/balancer-v3/batch-router.json +989 -0
  5. package/build/abi/balancer-v3/router.json +1792 -0
  6. package/build/abi/balancer-v3/vault-extension.json +2834 -0
  7. package/build/abi/{cables/CablesMainnetRFQ.json → inception/inception-ineth-pool.json} +489 -510
  8. package/build/abi/inception/inception-ratio-feed.json +329 -0
  9. package/build/abi/inception/inception-vault.json +991 -0
  10. package/build/abi/permit2.json +581 -0
  11. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
  12. package/build/abi/usual-m-smart-m/usualM.abi.json +483 -0
  13. package/build/abi/usual-m-usd0/usualCollateralDao.abi.json +681 -0
  14. package/build/abi/{integral/relayer.json → wombat/pool.json} +474 -721
  15. package/build/dex/aave-v1/aave-v1.d.ts +2 -1
  16. package/build/dex/aave-v1/aave-v1.js +23 -0
  17. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  18. package/build/dex/aave-v2/tokens-avalanche.json +44 -0
  19. package/build/dex/aave-v2/tokens-mainnet.json +188 -0
  20. package/build/dex/aave-v2/tokens-polygon.json +44 -0
  21. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +729 -0
  22. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +732 -0
  23. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +1 -0
  24. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +1406 -0
  25. package/build/dex/balancer-v3/abi/balancerRouter.js +1175 -0
  26. package/build/dex/balancer-v3/abi/balancerRouter.js.map +1 -0
  27. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +2081 -0
  28. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +1851 -0
  29. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +1 -0
  30. package/build/dex/balancer-v3/balancer-v3-pool.d.ts +80 -0
  31. package/build/dex/balancer-v3/balancer-v3-pool.js +461 -0
  32. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -0
  33. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +34 -0
  34. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +406 -0
  35. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +1 -0
  36. package/build/dex/balancer-v3/balancer-v3.d.ts +57 -0
  37. package/build/dex/balancer-v3/balancer-v3.js +383 -0
  38. package/build/dex/balancer-v3/balancer-v3.js.map +1 -0
  39. package/build/dex/balancer-v3/config.d.ts +8 -0
  40. package/build/dex/balancer-v3/config.js +24 -0
  41. package/build/dex/balancer-v3/config.js.map +1 -0
  42. package/build/dex/balancer-v3/getGasCost.d.ts +2 -0
  43. package/build/dex/balancer-v3/getGasCost.js +41 -0
  44. package/build/dex/balancer-v3/getGasCost.js.map +1 -0
  45. package/build/dex/balancer-v3/getOnChainState.d.ts +10 -0
  46. package/build/dex/balancer-v3/getOnChainState.js +164 -0
  47. package/build/dex/balancer-v3/getOnChainState.js.map +1 -0
  48. package/build/dex/balancer-v3/getPoolsApi.d.ts +2 -0
  49. package/build/dex/balancer-v3/getPoolsApi.js +81 -0
  50. package/build/dex/balancer-v3/getPoolsApi.js.map +1 -0
  51. package/build/dex/balancer-v3/getTopPoolsApi.d.ts +13 -0
  52. package/build/dex/balancer-v3/getTopPoolsApi.js +62 -0
  53. package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -0
  54. package/build/dex/balancer-v3/optimizer.d.ts +2 -0
  55. package/build/dex/{trader-joe-v2.1 → balancer-v3}/optimizer.js +17 -16
  56. package/build/dex/balancer-v3/optimizer.js.map +1 -0
  57. package/build/dex/balancer-v3/stablePool.d.ts +7 -0
  58. package/build/dex/balancer-v3/stablePool.js +73 -0
  59. package/build/dex/balancer-v3/stablePool.js.map +1 -0
  60. package/build/dex/balancer-v3/types.d.ts +62 -0
  61. package/build/dex/balancer-v3/types.js +3 -0
  62. package/build/dex/balancer-v3/types.js.map +1 -0
  63. package/build/dex/balancer-v3/weightedPool.d.ts +1 -0
  64. package/build/dex/balancer-v3/weightedPool.js +6 -0
  65. package/build/dex/balancer-v3/weightedPool.js.map +1 -0
  66. package/build/dex/bebop/constants.d.ts +1 -1
  67. package/build/dex/bebop/constants.js +1 -1
  68. package/build/dex/inception/config.d.ts +4 -0
  69. package/build/dex/inception/config.js +109 -0
  70. package/build/dex/inception/config.js.map +1 -0
  71. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  72. package/build/dex/inception/inception-event-pool.js +49 -0
  73. package/build/dex/inception/inception-event-pool.js.map +1 -0
  74. package/build/dex/inception/inception.d.ts +43 -0
  75. package/build/dex/inception/inception.js +180 -0
  76. package/build/dex/inception/inception.js.map +1 -0
  77. package/build/dex/inception/tokens.d.ts +9 -0
  78. package/build/dex/inception/tokens.js +28 -0
  79. package/build/dex/inception/tokens.js.map +1 -0
  80. package/build/dex/inception/types.d.ts +22 -0
  81. package/build/dex/inception/types.js +3 -0
  82. package/build/dex/inception/types.js.map +1 -0
  83. package/build/dex/inception/utils.d.ts +7 -0
  84. package/build/dex/inception/utils.js +58 -0
  85. package/build/dex/inception/utils.js.map +1 -0
  86. package/build/dex/index.js +0 -2
  87. package/build/dex/index.js.map +1 -1
  88. package/build/dex/jarvis.d.ts +2 -1
  89. package/build/dex/jarvis.js +58 -0
  90. package/build/dex/jarvis.js.map +1 -1
  91. package/build/dex/maker-psm/scripts/gem.abi.json +136 -0
  92. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  93. package/build/dex/maker-psm/scripts/validate-state.js +185 -0
  94. package/build/dex/maker-psm/scripts/validate-state.js.map +1 -0
  95. package/build/dex/maker-psm/scripts/vat.abi.json +243 -0
  96. package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.d.ts +1 -0
  97. package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js +20 -0
  98. package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js.map +1 -1
  99. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +4 -0
  100. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  101. package/build/dex/platypus/platypus.d.ts +2 -1
  102. package/build/dex/platypus/platypus.js +45 -0
  103. package/build/dex/platypus/platypus.js.map +1 -1
  104. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +1 -0
  105. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +53 -0
  106. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +1 -0
  107. package/build/dex/stable-pool.js +1 -8
  108. package/build/dex/stable-pool.js.map +1 -1
  109. package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
  110. package/build/dex/swaap-v1/swaap-v1.js +14 -0
  111. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  112. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +17 -0
  113. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +64 -0
  114. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +1 -0
  115. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +17 -0
  116. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +79 -0
  117. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +1 -0
  118. package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +1 -0
  119. package/build/dex/uniswap-v3/uniswap-v3-pool.js +20 -0
  120. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  121. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +4 -0
  122. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +43 -0
  123. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +1 -0
  124. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +1 -0
  125. package/build/dex/uniswap-v3/uniswap-v3-worker.js +10 -0
  126. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +1 -0
  127. package/build/dex/uniswap-v3/uniswap-v3.js +5 -0
  128. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  129. package/build/dex/usual/types.d.ts +13 -0
  130. package/build/dex/usual/types.js +3 -0
  131. package/build/dex/usual/types.js.map +1 -0
  132. package/build/dex/usual/usual-bond.d.ts +18 -0
  133. package/build/dex/usual/usual-bond.js +52 -0
  134. package/build/dex/usual/usual-bond.js.map +1 -0
  135. package/build/dex/usual/usual-m-smart-m.d.ts +17 -0
  136. package/build/dex/usual/usual-m-smart-m.js +50 -0
  137. package/build/dex/usual/usual-m-smart-m.js.map +1 -0
  138. package/build/dex/usual/usual-m-usd0.d.ts +17 -0
  139. package/build/dex/usual/usual-m-usd0.js +51 -0
  140. package/build/dex/usual/usual-m-usd0.js.map +1 -0
  141. package/build/dex/usual/usual.d.ts +27 -0
  142. package/build/dex/usual/usual.js +125 -0
  143. package/build/dex/usual/usual.js.map +1 -0
  144. package/build/dex/usual-m-smart-m/config.d.ts +3 -0
  145. package/build/dex/usual-m-smart-m/config.js +13 -0
  146. package/build/dex/usual-m-smart-m/config.js.map +1 -0
  147. package/build/dex/usual-m-smart-m/types.d.ts +7 -0
  148. package/build/dex/usual-m-smart-m/types.js +3 -0
  149. package/build/dex/usual-m-smart-m/types.js.map +1 -0
  150. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +35 -0
  151. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +161 -0
  152. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +1 -0
  153. package/build/dex/{stader → usual-m-usd0}/config.d.ts +1 -1
  154. package/build/dex/usual-m-usd0/config.js +14 -0
  155. package/build/dex/usual-m-usd0/config.js.map +1 -0
  156. package/build/dex/usual-m-usd0/types.d.ts +8 -0
  157. package/build/dex/usual-m-usd0/types.js +3 -0
  158. package/build/dex/usual-m-usd0/types.js.map +1 -0
  159. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +35 -0
  160. package/build/dex/usual-m-usd0/usual-m-usd0.js +159 -0
  161. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +1 -0
  162. package/build/dex/zerox/index.d.ts +4 -26
  163. package/build/dex/zerox/index.js +50 -42
  164. package/build/dex/zerox/index.js.map +1 -1
  165. package/build/dex/zerox/types.d.ts +29 -0
  166. package/build/dex/zerox/types.js +8 -1
  167. package/build/dex/zerox/types.js.map +1 -1
  168. package/package.json +1 -1
  169. package/src/dex/balancer-v3/balancer-v3-sepolia-pools.ts +404 -0
  170. package/src/dex/bebop/constants.ts +1 -1
  171. package/src/dex/index.ts +0 -2
  172. package/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +30 -0
  173. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +10 -0
  174. package/src/dex/uniswap-v3/uniswap-v3-pool.ts +30 -0
  175. package/src/dex/uniswap-v3/uniswap-v3.ts +11 -0
  176. package/tests/constants-e2e.ts +0 -5
  177. package/.idea/aws.xml +0 -17
  178. package/.idea/codeStyles/Project.xml +0 -19
  179. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  180. package/.idea/misc.xml +0 -6
  181. package/.idea/modules.xml +0 -8
  182. package/.idea/paraswap-dex-lib.iml +0 -9
  183. package/.idea/prettier.xml +0 -7
  184. package/.idea/vcs.xml +0 -6
  185. package/build/abi/SSPM.json +0 -829
  186. package/build/abi/StaderOracle.json +0 -2170
  187. package/build/abi/integral/factory.json +0 -333
  188. package/build/abi/integral/oracle.json +0 -501
  189. package/build/abi/integral/pool.json +0 -1041
  190. package/build/dex/cables/cables.d.ts +0 -59
  191. package/build/dex/cables/cables.js +0 -614
  192. package/build/dex/cables/cables.js.map +0 -1
  193. package/build/dex/cables/config.d.ts +0 -4
  194. package/build/dex/cables/config.js +0 -15
  195. package/build/dex/cables/config.js.map +0 -1
  196. package/build/dex/cables/constants.d.ts +0 -20
  197. package/build/dex/cables/constants.js +0 -24
  198. package/build/dex/cables/constants.js.map +0 -1
  199. package/build/dex/cables/rate-fetcher.d.ts +0 -34
  200. package/build/dex/cables/rate-fetcher.js +0 -106
  201. package/build/dex/cables/rate-fetcher.js.map +0 -1
  202. package/build/dex/cables/types.d.ts +0 -113
  203. package/build/dex/cables/types.js +0 -19
  204. package/build/dex/cables/types.js.map +0 -1
  205. package/build/dex/cables/validators.d.ts +0 -5
  206. package/build/dex/cables/validators.js +0 -49
  207. package/build/dex/cables/validators.js.map +0 -1
  208. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
  209. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
  210. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
  211. package/build/dex/integral/config.d.ts +0 -4
  212. package/build/dex/integral/config.js +0 -20
  213. package/build/dex/integral/config.js.map +0 -1
  214. package/build/dex/integral/context.d.ts +0 -40
  215. package/build/dex/integral/context.js +0 -158
  216. package/build/dex/integral/context.js.map +0 -1
  217. package/build/dex/integral/integral-factory.d.ts +0 -24
  218. package/build/dex/integral/integral-factory.js +0 -95
  219. package/build/dex/integral/integral-factory.js.map +0 -1
  220. package/build/dex/integral/integral-pool.d.ts +0 -50
  221. package/build/dex/integral/integral-pool.js +0 -149
  222. package/build/dex/integral/integral-pool.js.map +0 -1
  223. package/build/dex/integral/integral-pricing.d.ts +0 -18
  224. package/build/dex/integral/integral-pricing.js +0 -114
  225. package/build/dex/integral/integral-pricing.js.map +0 -1
  226. package/build/dex/integral/integral-relayer.d.ts +0 -42
  227. package/build/dex/integral/integral-relayer.js +0 -192
  228. package/build/dex/integral/integral-relayer.js.map +0 -1
  229. package/build/dex/integral/integral-token.d.ts +0 -27
  230. package/build/dex/integral/integral-token.js +0 -59
  231. package/build/dex/integral/integral-token.js.map +0 -1
  232. package/build/dex/integral/integral.d.ts +0 -41
  233. package/build/dex/integral/integral.js +0 -376
  234. package/build/dex/integral/integral.js.map +0 -1
  235. package/build/dex/integral/types.d.ts +0 -85
  236. package/build/dex/integral/types.js +0 -9
  237. package/build/dex/integral/types.js.map +0 -1
  238. package/build/dex/integral/utils-e2e.d.ts +0 -9
  239. package/build/dex/integral/utils-e2e.js +0 -131
  240. package/build/dex/integral/utils-e2e.js.map +0 -1
  241. package/build/dex/integral/utils.d.ts +0 -17
  242. package/build/dex/integral/utils.js +0 -94
  243. package/build/dex/integral/utils.js.map +0 -1
  244. package/build/dex/stader/config.js +0 -14
  245. package/build/dex/stader/config.js.map +0 -1
  246. package/build/dex/stader/stader-pool.d.ts +0 -18
  247. package/build/dex/stader/stader-pool.js +0 -47
  248. package/build/dex/stader/stader-pool.js.map +0 -1
  249. package/build/dex/stader/stader.d.ts +0 -42
  250. package/build/dex/stader/stader.js +0 -141
  251. package/build/dex/stader/stader.js.map +0 -1
  252. package/build/dex/stader/types.d.ts +0 -13
  253. package/build/dex/stader/types.js +0 -8
  254. package/build/dex/stader/types.js.map +0 -1
  255. package/build/dex/stader/utils.d.ts +0 -4
  256. package/build/dex/stader/utils.js +0 -24
  257. package/build/dex/stader/utils.js.map +0 -1
  258. package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
  259. package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
  260. package/src/abi/SSPM.json +0 -829
  261. package/src/abi/StaderOracle.json +0 -2170
  262. package/src/dex/stader/config.ts +0 -13
  263. package/src/dex/stader/stader-e2e.test.ts +0 -74
  264. package/src/dex/stader/stader-events.test.ts +0 -64
  265. package/src/dex/stader/stader-integration.test.ts +0 -210
  266. package/src/dex/stader/stader-pool.ts +0 -68
  267. package/src/dex/stader/stader.ts +0 -208
  268. package/src/dex/stader/types.ts +0 -16
  269. package/src/dex/stader/utils.ts +0 -34
@@ -0,0 +1,404 @@
1
+ const pools = [
2
+ {
3
+ id: '0x0d7291d8bdc6b376aadacbf05b1ef8a8292ef58a',
4
+ type: 'STABLE',
5
+ poolTokens: [
6
+ {
7
+ address: '0x8a88124522dbbf1e56352ba3de1d9f78c143751e',
8
+ weight: null,
9
+ isErc4626: true,
10
+ underlyingToken: {
11
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
12
+ },
13
+ },
14
+ {
15
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
16
+ weight: null,
17
+ isErc4626: true,
18
+ underlyingToken: {
19
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
20
+ },
21
+ },
22
+ ],
23
+ },
24
+ {
25
+ id: '0x1017d7b181ab63ceeb36d96c52a8056e02b7edd0',
26
+ type: 'STABLE',
27
+ poolTokens: [
28
+ {
29
+ address: '0x8a88124522dbbf1e56352ba3de1d9f78c143751e',
30
+ weight: null,
31
+ isErc4626: true,
32
+ underlyingToken: {
33
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
34
+ },
35
+ },
36
+ {
37
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
38
+ weight: null,
39
+ isErc4626: true,
40
+ underlyingToken: {
41
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
42
+ },
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ id: '0x1ada5f54c7aafe20dfcd493de4dbcf4a3061c79c',
48
+ type: 'WEIGHTED',
49
+ poolTokens: [
50
+ {
51
+ address: '0x0f409e839a6a790aecb737e4436293be11717f95',
52
+ weight: '0.33',
53
+ isErc4626: false,
54
+ underlyingToken: null,
55
+ },
56
+ {
57
+ address: '0xb19382073c7a0addbb56ac6af1808fa49e377b75',
58
+ weight: '0.67',
59
+ isErc4626: false,
60
+ underlyingToken: null,
61
+ },
62
+ ],
63
+ },
64
+ {
65
+ id: '0x2ff3b96e0057a1f25f1d62ab800554ccdb268ab8',
66
+ type: 'WEIGHTED',
67
+ poolTokens: [
68
+ {
69
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
70
+ weight: '0.5',
71
+ isErc4626: false,
72
+ underlyingToken: null,
73
+ },
74
+ {
75
+ address: '0xb19382073c7a0addbb56ac6af1808fa49e377b75',
76
+ weight: '0.5',
77
+ isErc4626: false,
78
+ underlyingToken: null,
79
+ },
80
+ ],
81
+ },
82
+ {
83
+ id: '0x3bc893eeb97ecdbb1b17dcc9e88d51e4a0d3fe35',
84
+ type: 'STABLE',
85
+ poolTokens: [
86
+ {
87
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
88
+ weight: null,
89
+ isErc4626: false,
90
+ underlyingToken: null,
91
+ },
92
+ {
93
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
94
+ weight: null,
95
+ isErc4626: false,
96
+ underlyingToken: null,
97
+ },
98
+ {
99
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
100
+ weight: null,
101
+ isErc4626: true,
102
+ underlyingToken: {
103
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
104
+ },
105
+ },
106
+ {
107
+ address: '0xde46e43f46ff74a23a65ebb0580cbe3dfe684a17',
108
+ weight: null,
109
+ isErc4626: true,
110
+ underlyingToken: {
111
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ {
117
+ id: '0x42de4fa875126fdbaf590b2fc3802adbca58acee',
118
+ type: 'STABLE',
119
+ poolTokens: [
120
+ {
121
+ address: '0xd63db0b88dca565633fb8d70a70b9b8093d34a7e',
122
+ weight: null,
123
+ isErc4626: false,
124
+ underlyingToken: null,
125
+ },
126
+ {
127
+ address: '0xde46e43f46ff74a23a65ebb0580cbe3dfe684a17',
128
+ weight: null,
129
+ isErc4626: true,
130
+ underlyingToken: {
131
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
132
+ },
133
+ },
134
+ ],
135
+ },
136
+ {
137
+ id: '0x946e59e9637f44eb122fe64b372aaf6ed0441da1',
138
+ type: 'WEIGHTED',
139
+ poolTokens: [
140
+ {
141
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
142
+ weight: '0.5',
143
+ isErc4626: false,
144
+ underlyingToken: null,
145
+ },
146
+ {
147
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
148
+ weight: '0.5',
149
+ isErc4626: false,
150
+ underlyingToken: null,
151
+ },
152
+ ],
153
+ },
154
+ {
155
+ id: '0x965f7d7387d81056ebf0edaf4a869dc46471a676',
156
+ type: 'WEIGHTED',
157
+ poolTokens: [
158
+ {
159
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
160
+ weight: '0.5',
161
+ isErc4626: false,
162
+ underlyingToken: null,
163
+ },
164
+ {
165
+ address: '0xd63db0b88dca565633fb8d70a70b9b8093d34a7e',
166
+ weight: '0.5',
167
+ isErc4626: false,
168
+ underlyingToken: null,
169
+ },
170
+ ],
171
+ },
172
+ {
173
+ id: '0x9dd65a7c9e3973edbf9c5a6f857252b0a67627aa',
174
+ type: 'STABLE',
175
+ poolTokens: [
176
+ {
177
+ address: '0x6bf294b80c7d8dc72dee762af5d01260b756a051',
178
+ weight: null,
179
+ isErc4626: false,
180
+ underlyingToken: null,
181
+ },
182
+ {
183
+ address: '0x80d6d3946ed8a1da4e226aa21ccddc32bd127d1a',
184
+ weight: null,
185
+ isErc4626: false,
186
+ underlyingToken: null,
187
+ },
188
+ {
189
+ address: '0xb77eb1a70a96fdaaeb31db1b42f2b8b5846b2613',
190
+ weight: null,
191
+ isErc4626: false,
192
+ underlyingToken: null,
193
+ },
194
+ {
195
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
196
+ weight: null,
197
+ isErc4626: false,
198
+ underlyingToken: null,
199
+ },
200
+ ],
201
+ },
202
+ {
203
+ id: '0xadb63f54b5ca608144513f03ff57ea415843b083',
204
+ type: 'WEIGHTED',
205
+ poolTokens: [
206
+ {
207
+ address: '0x6bf294b80c7d8dc72dee762af5d01260b756a051',
208
+ weight: '0.33',
209
+ isErc4626: false,
210
+ underlyingToken: null,
211
+ },
212
+ {
213
+ address: '0x80d6d3946ed8a1da4e226aa21ccddc32bd127d1a',
214
+ weight: '0.33',
215
+ isErc4626: false,
216
+ underlyingToken: null,
217
+ },
218
+ {
219
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
220
+ weight: '0.34',
221
+ isErc4626: false,
222
+ underlyingToken: null,
223
+ },
224
+ ],
225
+ },
226
+ {
227
+ id: '0xbb83ba331c3254c8c44645430126797dceda89c0',
228
+ type: 'WEIGHTED',
229
+ poolTokens: [
230
+ {
231
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
232
+ weight: '0.5',
233
+ isErc4626: false,
234
+ underlyingToken: null,
235
+ },
236
+ {
237
+ address: '0x8a88124522dbbf1e56352ba3de1d9f78c143751e',
238
+ weight: '0.5',
239
+ isErc4626: true,
240
+ underlyingToken: {
241
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
242
+ },
243
+ },
244
+ ],
245
+ },
246
+ {
247
+ id: '0xbfa3d29909e92ab04b631d114c78b5257aba53db',
248
+ type: 'WEIGHTED',
249
+ poolTokens: [
250
+ {
251
+ address: '0x6bf294b80c7d8dc72dee762af5d01260b756a051',
252
+ weight: '0.99',
253
+ isErc4626: false,
254
+ underlyingToken: null,
255
+ },
256
+ {
257
+ address: '0x80d6d3946ed8a1da4e226aa21ccddc32bd127d1a',
258
+ weight: '0.01',
259
+ isErc4626: false,
260
+ underlyingToken: null,
261
+ },
262
+ ],
263
+ },
264
+ {
265
+ id: '0xc9233cc69435591b193b50f702ac31e404a08b10',
266
+ type: 'WEIGHTED',
267
+ poolTokens: [
268
+ {
269
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
270
+ weight: '0.5',
271
+ isErc4626: false,
272
+ underlyingToken: null,
273
+ },
274
+ {
275
+ address: '0x946e59e9637f44eb122fe64b372aaf6ed0441da1',
276
+ weight: '0.5',
277
+ isErc4626: false,
278
+ underlyingToken: null,
279
+ },
280
+ ],
281
+ },
282
+ {
283
+ id: '0xce7601b157e0871332d2295f274a0f4314a1585d',
284
+ type: 'STABLE',
285
+ poolTokens: [
286
+ {
287
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
288
+ weight: null,
289
+ isErc4626: false,
290
+ underlyingToken: null,
291
+ },
292
+ {
293
+ address: '0xde46e43f46ff74a23a65ebb0580cbe3dfe684a17',
294
+ weight: null,
295
+ isErc4626: true,
296
+ underlyingToken: {
297
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
298
+ },
299
+ },
300
+ ],
301
+ },
302
+ {
303
+ id: '0xd320b050444aa50f24e6666e22a503f765e74263',
304
+ type: 'STABLE',
305
+ poolTokens: [
306
+ {
307
+ address: '0x6bf294b80c7d8dc72dee762af5d01260b756a051',
308
+ weight: null,
309
+ isErc4626: false,
310
+ underlyingToken: null,
311
+ },
312
+ {
313
+ address: '0xb77eb1a70a96fdaaeb31db1b42f2b8b5846b2613',
314
+ weight: null,
315
+ isErc4626: false,
316
+ underlyingToken: null,
317
+ },
318
+ ],
319
+ },
320
+ {
321
+ id: '0xd63db0b88dca565633fb8d70a70b9b8093d34a7e',
322
+ type: 'STABLE',
323
+ poolTokens: [
324
+ {
325
+ address: '0x8a88124522dbbf1e56352ba3de1d9f78c143751e',
326
+ weight: null,
327
+ isErc4626: true,
328
+ underlyingToken: {
329
+ address: '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8',
330
+ },
331
+ },
332
+ {
333
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
334
+ weight: null,
335
+ isErc4626: true,
336
+ underlyingToken: {
337
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
338
+ },
339
+ },
340
+ ],
341
+ },
342
+ {
343
+ id: '0xdfc3ab57a32828da8074f34e702635fc58d64d06',
344
+ type: 'WEIGHTED',
345
+ poolTokens: [
346
+ {
347
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
348
+ weight: '0.5',
349
+ isErc4626: true,
350
+ underlyingToken: {
351
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
352
+ },
353
+ },
354
+ {
355
+ address: '0xde46e43f46ff74a23a65ebb0580cbe3dfe684a17',
356
+ weight: '0.5',
357
+ isErc4626: true,
358
+ underlyingToken: {
359
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
360
+ },
361
+ },
362
+ ],
363
+ },
364
+ {
365
+ id: '0xe69b70a86a4e1fd33da95693a1ae12be1c26c8ea',
366
+ type: 'WEIGHTED',
367
+ poolTokens: [
368
+ {
369
+ address: '0xb19382073c7a0addbb56ac6af1808fa49e377b75',
370
+ weight: '0.5',
371
+ isErc4626: false,
372
+ underlyingToken: null,
373
+ },
374
+ {
375
+ address: '0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
376
+ weight: '0.5',
377
+ isErc4626: false,
378
+ underlyingToken: null,
379
+ },
380
+ ],
381
+ },
382
+ {
383
+ id: '0xf5a25990da505a9d4c3e0d876f3951e9edf9abc3',
384
+ type: 'WEIGHTED',
385
+ poolTokens: [
386
+ {
387
+ address: '0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
388
+ weight: '0.5',
389
+ isErc4626: false,
390
+ underlyingToken: null,
391
+ },
392
+ {
393
+ address: '0x978206fae13faf5a8d293fb614326b237684b750',
394
+ weight: '0.5',
395
+ isErc4626: true,
396
+ underlyingToken: {
397
+ address: '0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0',
398
+ },
399
+ },
400
+ ],
401
+ },
402
+ ];
403
+
404
+ export default pools;
@@ -6,7 +6,7 @@ export const BEBOP_API_URL = 'https://api.bebop.xyz';
6
6
  export const BEBOP_WS_API_URL = 'wss://api.bebop.xyz';
7
7
  export const BEBOP_GAS_COST = 120_000;
8
8
  export const BEBOP_AUTH_NAME = 'paraswap';
9
- export const BEBOP_QUOTE_TIMEOUT_MS = 2000;
9
+ export const BEBOP_QUOTE_TIMEOUT_MS = 3000;
10
10
  export const BEBOP_ERRORS_CACHE_KEY = 'errors';
11
11
  export const BEBOP_RESTRICTED_CACHE_KEY = 'restricted';
12
12
  // Restrict for BEBOP_RESTRICT_TTL_S if an error occured >= BEBOP_RESTRICT_COUNT_THRESHOLD times within BEBOP_RESTRICT_CHECK_INTERVAL_S interval
package/src/dex/index.ts CHANGED
@@ -94,7 +94,6 @@ import { LitePsm } from './lite-psm/lite-psm';
94
94
  import { UsualBond } from './usual-bond/usual-bond';
95
95
  import { StkGHO } from './stkgho/stkgho';
96
96
  import { SkyConverter } from './sky-converter/sky-converter';
97
- import { Stader } from './stader/stader';
98
97
 
99
98
  const LegacyDexes = [
100
99
  CurveV2,
@@ -114,7 +113,6 @@ const LegacyDexes = [
114
113
  ];
115
114
 
116
115
  const Dexes = [
117
- Stader,
118
116
  Bebop,
119
117
  Dexalot,
120
118
  CurveV1,
@@ -250,6 +250,36 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber<PoolState> {
250
250
  return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER;
251
251
  }
252
252
 
253
+ async getOrGenerateState(
254
+ blockNumber: number,
255
+ ): Promise<DeepReadonly<PoolState> | null> {
256
+ const state = this.getState(blockNumber);
257
+ if (state) {
258
+ return state;
259
+ }
260
+
261
+ this.logger.error(
262
+ `PancakeV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`,
263
+ );
264
+ try {
265
+ const newState = await this.generateState(blockNumber);
266
+
267
+ if (!newState) {
268
+ this.logger.error(
269
+ `PancakeV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`,
270
+ );
271
+ return null;
272
+ }
273
+ this.setState(newState, blockNumber);
274
+ return newState;
275
+ } catch (error) {
276
+ this.logger.error(
277
+ `PancakeV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`,
278
+ );
279
+ return null;
280
+ }
281
+ }
282
+
253
283
  async generateState(blockNumber: number): Promise<Readonly<PoolState>> {
254
284
  const callData = this._getStateRequestCallData();
255
285
 
@@ -613,6 +613,10 @@ export class PancakeswapV3
613
613
 
614
614
  if (selectedPools.length === 0) return null;
615
615
 
616
+ await Promise.all(
617
+ selectedPools.map(pool => pool.getOrGenerateState(blockNumber)),
618
+ );
619
+
616
620
  const poolsToUse = selectedPools.reduce(
617
621
  (acc, pool) => {
618
622
  let state = pool.getState(blockNumber);
@@ -632,6 +636,12 @@ export class PancakeswapV3
632
636
  },
633
637
  );
634
638
 
639
+ poolsToUse.poolWithoutState.forEach(pool => {
640
+ this.logger.warn(
641
+ `PancakeV3: Pool ${pool.name} on ${this.dexKey} has no state. Fallback to rpc`,
642
+ );
643
+ });
644
+
635
645
  const rpcResultsPromise = this.getPricingFromRpc(
636
646
  _srcToken,
637
647
  _destToken,
@@ -254,6 +254,36 @@ export class UniswapV3EventPool extends StatefulEventSubscriber<PoolState> {
254
254
  return TICK_BITMAP_TO_USE + TICK_BITMAP_BUFFER;
255
255
  }
256
256
 
257
+ async getOrGenerateState(
258
+ blockNumber: number,
259
+ ): Promise<DeepReadonly<PoolState> | null> {
260
+ const state = this.getState(blockNumber);
261
+ if (state) {
262
+ return state;
263
+ }
264
+
265
+ this.logger.error(
266
+ `UniV3: No state found for ${this.name} ${this.addressesSubscribed[0]}, generating new one`,
267
+ );
268
+ try {
269
+ const newState = await this.generateState(blockNumber);
270
+
271
+ if (!newState) {
272
+ this.logger.error(
273
+ `UniV3: Could not generate state for ${this.name} ${this.addressesSubscribed[0]}`,
274
+ );
275
+ return null;
276
+ }
277
+ this.setState(newState, blockNumber);
278
+ return newState;
279
+ } catch (error) {
280
+ this.logger.error(
281
+ `UniV3: Failed to generate state for ${this.name} ${this.addressesSubscribed[0]}`,
282
+ );
283
+ return null;
284
+ }
285
+ }
286
+
257
287
  async generateState(blockNumber: number): Promise<Readonly<PoolState>> {
258
288
  const callData = this._getStateRequestCallData();
259
289
 
@@ -715,6 +715,10 @@ export class UniswapV3
715
715
 
716
716
  if (selectedPools.length === 0) return null;
717
717
 
718
+ await Promise.all(
719
+ selectedPools.map(pool => pool.getOrGenerateState(blockNumber)),
720
+ );
721
+
718
722
  const poolsToUse = selectedPools.reduce(
719
723
  (acc, pool) => {
720
724
  let state = pool.getState(blockNumber);
@@ -722,6 +726,7 @@ export class UniswapV3
722
726
  this.logger.trace(
723
727
  `${this.dexKey}: State === null. Fallback to rpc ${pool.name}`,
724
728
  );
729
+ // as we generate state (if nullified) in previous Promise.all, here should only be pools with failed initialization
725
730
  acc.poolWithoutState.push(pool);
726
731
  } else {
727
732
  acc.poolWithState.push(pool);
@@ -734,6 +739,12 @@ export class UniswapV3
734
739
  },
735
740
  );
736
741
 
742
+ poolsToUse.poolWithoutState.forEach(pool => {
743
+ this.logger.warn(
744
+ `UniV3: Pool ${pool.name} on ${this.dexKey} has no state. Fallback to rpc`,
745
+ );
746
+ });
747
+
737
748
  const states = poolsToUse.poolWithState.map(
738
749
  p => p.getState(blockNumber)!,
739
750
  );
@@ -92,10 +92,6 @@ export const Tokens: {
92
92
  address: ETHER_ADDRESS,
93
93
  decimals: 18,
94
94
  },
95
- ETHx: {
96
- address: '0xA35b1B31Ce002FBF2058D22F30f95D405200A15b',
97
- decimals: 18,
98
- },
99
95
  SWETH: {
100
96
  address: '0xf951e335afb289353dc249e82926178eac7ded78',
101
97
  decimals: 18,
@@ -1629,7 +1625,6 @@ export const Holders: {
1629
1625
  sUSDS: '0xd564B3aE673CAa49D054Bf185bD72a6853763eE7',
1630
1626
  SKY: '0x0ddda327A6614130CCb20bc0097313A282176A01',
1631
1627
  MKR: '0xe9aAA7A9DDc0877626C1779AbC29993aD89A6c1f',
1632
- ETHx: '0xFCC1A2c71F01B7f58Ed538a6B4AAa5A0724eB5A6',
1633
1628
  // Idle tokens
1634
1629
  AA_wstETH: '0xd7C1b48877A7dFA7D51cf1144c89C0A3F134F935',
1635
1630
  'AA_idle_cpPOR-USDC': '0x085c8eaccA6911fE60aE3f8FbAe5F3012E3A05Ec',
package/.idea/aws.xml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="accountSettings">
4
- <option name="activeProfile" value="profile:default" />
5
- <option name="activeRegion" value="us-east-1" />
6
- <option name="recentlyUsedProfiles">
7
- <list>
8
- <option value="profile:default" />
9
- </list>
10
- </option>
11
- <option name="recentlyUsedRegions">
12
- <list>
13
- <option value="us-east-1" />
14
- </list>
15
- </option>
16
- </component>
17
- </project>
@@ -1,19 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <ScalaCodeStyleSettings>
4
- <option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
5
- </ScalaCodeStyleSettings>
6
- <TypeScriptCodeStyleSettings version="0">
7
- <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACKETS" value="true" />
8
- <option name="USE_DOUBLE_QUOTES" value="false" />
9
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
10
- </TypeScriptCodeStyleSettings>
11
- <codeStyleSettings language="TypeScript">
12
- <indentOptions>
13
- <option name="INDENT_SIZE" value="2" />
14
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
15
- <option name="TAB_SIZE" value="2" />
16
- </indentOptions>
17
- </codeStyleSettings>
18
- </code_scheme>
19
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
- </state>
5
- </component>
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" filepath="$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myRunOnSave" value="true" />
5
- <option name="myRunOnReformat" value="true" />
6
- </component>
7
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>