@paraswap/dex-lib 2.50.5 → 2.50.6-sdai

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 (263) hide show
  1. package/build/abi/maker-psm/pot.json +322 -0
  2. package/build/abi/{angle/stagToken.json → sdai/SavingsDai.abi.json} +177 -263
  3. package/build/config.js +2 -1
  4. package/build/config.js.map +1 -1
  5. package/build/dex/curve-v1-factory/config.js +11 -128
  6. package/build/dex/curve-v1-factory/config.js.map +1 -1
  7. package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +0 -1
  8. package/build/dex/curve-v1-factory/curve-v1-factory.js +17 -29
  9. package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
  10. package/build/dex/curve-v1-factory/curve-v1-pool-manager.js +0 -1
  11. package/build/dex/curve-v1-factory/curve-v1-pool-manager.js.map +1 -1
  12. package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js +0 -1
  13. package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js.map +1 -1
  14. package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js +1 -4
  15. package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js.map +1 -1
  16. package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js +0 -1
  17. package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js.map +1 -1
  18. package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js +0 -1
  19. package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js.map +1 -1
  20. package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js +0 -1
  21. package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js.map +1 -1
  22. package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js +0 -1
  23. package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js.map +1 -1
  24. package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js +0 -1
  25. package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js.map +1 -1
  26. package/build/dex/curve-v1-factory/price-handlers/functions/constants.js +0 -10
  27. package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
  28. package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js +0 -40
  29. package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js.map +1 -1
  30. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js +0 -1
  31. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js.map +1 -1
  32. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js +0 -1
  33. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js.map +1 -1
  34. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js +0 -24
  35. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js.map +1 -1
  36. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js +0 -1
  37. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js.map +1 -1
  38. package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js +0 -53
  39. package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js.map +1 -1
  40. package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js +0 -1
  41. package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js.map +1 -1
  42. package/build/dex/curve-v1-factory/price-handlers/functions/utils.d.ts +0 -1
  43. package/build/dex/curve-v1-factory/price-handlers/functions/utils.js +1 -5
  44. package/build/dex/curve-v1-factory/price-handlers/functions/utils.js.map +1 -1
  45. package/build/dex/curve-v1-factory/price-handlers/types.d.ts +2 -2
  46. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.d.ts +2 -3
  47. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +6 -38
  48. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
  49. package/build/dex/curve-v1-factory/state-polling-pools/pool-polling-base.js.map +1 -1
  50. package/build/dex/curve-v1-factory/types.d.ts +2 -11
  51. package/build/dex/curve-v1-factory/types.js +0 -3
  52. package/build/dex/curve-v1-factory/types.js.map +1 -1
  53. package/build/dex/hashflow/constants.d.ts +0 -27
  54. package/build/dex/hashflow/constants.js +1 -29
  55. package/build/dex/hashflow/constants.js.map +1 -1
  56. package/build/dex/hashflow/hashflow.d.ts +2 -3
  57. package/build/dex/hashflow/hashflow.js +12 -69
  58. package/build/dex/hashflow/hashflow.js.map +1 -1
  59. package/build/dex/hashflow/types.d.ts +0 -11
  60. package/build/dex/hashflow/types.js +0 -9
  61. package/build/dex/hashflow/types.js.map +1 -1
  62. package/build/dex/idex.d.ts +1 -1
  63. package/build/dex/index.d.ts +2 -2
  64. package/build/dex/index.js +2 -0
  65. package/build/dex/index.js.map +1 -1
  66. package/build/dex/pancakeswap-v3/config.js +0 -15
  67. package/build/dex/pancakeswap-v3/config.js.map +1 -1
  68. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +1 -1
  69. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  70. package/build/dex/sdai/config.d.ts +11 -0
  71. package/build/dex/sdai/config.js +24 -0
  72. package/build/dex/sdai/config.js.map +1 -0
  73. package/build/dex/sdai/constants.d.ts +2 -0
  74. package/build/dex/sdai/constants.js +6 -0
  75. package/build/dex/sdai/constants.js.map +1 -0
  76. package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
  77. package/build/dex/sdai/scripts/validate-state.js +102 -0
  78. package/build/dex/sdai/scripts/validate-state.js.map +1 -0
  79. package/build/dex/sdai/sdai-pool.d.ts +16 -0
  80. package/build/dex/sdai/sdai-pool.js +85 -0
  81. package/build/dex/sdai/sdai-pool.js.map +1 -0
  82. package/build/dex/sdai/sdai.d.ts +51 -0
  83. package/build/dex/sdai/sdai.js +172 -0
  84. package/build/dex/sdai/sdai.js.map +1 -0
  85. package/build/dex/sdai/types.d.ts +21 -0
  86. package/build/dex/sdai/types.js +11 -0
  87. package/build/dex/sdai/types.js.map +1 -0
  88. package/build/dex/sdai/utils.d.ts +4 -0
  89. package/build/dex/sdai/utils.js +39 -0
  90. package/build/dex/sdai/utils.js.map +1 -0
  91. package/build/dex/woo-fi-v2/config.js +4 -4
  92. package/package.json +1 -1
  93. package/src/abi/maker-psm/pot.json +322 -0
  94. package/src/abi/sdai/SavingsDai.abi.json +877 -0
  95. package/src/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
  96. package/src/config.ts +2 -1
  97. package/src/dex/curve-v1-factory/config.ts +11 -128
  98. package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +1 -123
  99. package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +0 -392
  100. package/src/dex/curve-v1-factory/curve-v1-factory.ts +39 -61
  101. package/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +0 -1
  102. package/src/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.ts +0 -2
  103. package/src/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.ts +2 -6
  104. package/src/dex/curve-v1-factory/price-handlers/functions/_rates.ts +0 -2
  105. package/src/dex/curve-v1-factory/price-handlers/functions/_xp.ts +0 -2
  106. package/src/dex/curve-v1-factory/price-handlers/functions/_xp_mem.ts +0 -2
  107. package/src/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.ts +0 -2
  108. package/src/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.ts +0 -2
  109. package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +0 -11
  110. package/src/dex/curve-v1-factory/price-handlers/functions/get_D.ts +1 -59
  111. package/src/dex/curve-v1-factory/price-handlers/functions/get_D_mem.ts +0 -2
  112. package/src/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.ts +0 -2
  113. package/src/dex/curve-v1-factory/price-handlers/functions/get_dy.ts +0 -51
  114. package/src/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.ts +0 -2
  115. package/src/dex/curve-v1-factory/price-handlers/functions/get_y.ts +1 -68
  116. package/src/dex/curve-v1-factory/price-handlers/functions/get_y_D.ts +0 -2
  117. package/src/dex/curve-v1-factory/price-handlers/functions/utils.ts +0 -4
  118. package/src/dex/curve-v1-factory/price-handlers/types.ts +1 -8
  119. package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +18 -71
  120. package/src/dex/curve-v1-factory/state-polling-pools/pool-polling-base.ts +0 -1
  121. package/src/dex/curve-v1-factory/types.ts +1 -12
  122. package/src/dex/hashflow/constants.ts +0 -32
  123. package/src/dex/hashflow/hashflow.ts +19 -121
  124. package/src/dex/hashflow/types.ts +2 -20
  125. package/src/dex/idex.ts +1 -1
  126. package/src/dex/index.ts +4 -2
  127. package/src/dex/pancakeswap-v3/config.ts +0 -16
  128. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +1 -3
  129. package/src/dex/sdai/config.ts +28 -0
  130. package/src/dex/sdai/constants.ts +2 -0
  131. package/src/dex/sdai/scripts/validate-state.ts +144 -0
  132. package/src/dex/sdai/sdai-e2e.test.ts +96 -0
  133. package/src/dex/sdai/sdai-events.test.ts +105 -0
  134. package/src/dex/sdai/sdai-integration.test.ts +148 -0
  135. package/src/dex/sdai/sdai-pool.ts +113 -0
  136. package/src/dex/sdai/sdai.ts +233 -0
  137. package/src/dex/sdai/types.ts +23 -0
  138. package/src/dex/sdai/utils.ts +48 -0
  139. package/src/dex/woo-fi-v2/config.ts +4 -4
  140. package/tests/constants-e2e.ts +3 -38
  141. package/tests/utils-e2e.ts +0 -1
  142. package/build/abi/Redstone.json +0 -739
  143. package/build/abi/angle-transmuter/MorphoOracle.json +0 -193
  144. package/build/abi/angle-transmuter/MorphoVault.json +0 -2506
  145. package/build/abi/angle-transmuter/Pyth.json +0 -1534
  146. package/build/abi/angle-transmuter/Transmuter.json +0 -1711
  147. package/build/abi/pharaoh/PharaohPool.abi.json +0 -1582
  148. package/build/abi/smardex/smardex-factory.json +0 -185
  149. package/build/abi/smardex/smardex-pool.json +0 -578
  150. package/build/abi/smardex/smardex-router.json +0 -648
  151. package/build/abi/trader-joe-v2_1/FactoryABI.json +0 -1208
  152. package/build/abi/trader-joe-v2_1/PairABI.json +0 -1493
  153. package/build/abi/trader-joe-v2_1/RouterABI.json +0 -1489
  154. package/build/abi/trader-joe-v2_1/StateMulticall.json +0 -193
  155. package/build/abi/wombat/pool.json +0 -1289
  156. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  157. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  158. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  159. package/build/dex/angle-staked-stable/angle-staked-stable-pool.d.ts +0 -55
  160. package/build/dex/angle-staked-stable/angle-staked-stable-pool.js +0 -183
  161. package/build/dex/angle-staked-stable/angle-staked-stable-pool.js.map +0 -1
  162. package/build/dex/angle-staked-stable/angle-staked-stable.d.ts +0 -50
  163. package/build/dex/angle-staked-stable/angle-staked-stable.js +0 -228
  164. package/build/dex/angle-staked-stable/angle-staked-stable.js.map +0 -1
  165. package/build/dex/angle-staked-stable/config.d.ts +0 -4
  166. package/build/dex/angle-staked-stable/config.js +0 -139
  167. package/build/dex/angle-staked-stable/config.js.map +0 -1
  168. package/build/dex/angle-staked-stable/types.d.ts +0 -15
  169. package/build/dex/angle-staked-stable/types.js +0 -3
  170. package/build/dex/angle-staked-stable/types.js.map +0 -1
  171. package/build/dex/angle-transmuter/angle-transmuter-pool.d.ts +0 -61
  172. package/build/dex/angle-transmuter/angle-transmuter-pool.js +0 -415
  173. package/build/dex/angle-transmuter/angle-transmuter-pool.js.map +0 -1
  174. package/build/dex/angle-transmuter/angle-transmuter.d.ts +0 -59
  175. package/build/dex/angle-transmuter/angle-transmuter.js +0 -262
  176. package/build/dex/angle-transmuter/angle-transmuter.js.map +0 -1
  177. package/build/dex/angle-transmuter/backedOracle.d.ts +0 -19
  178. package/build/dex/angle-transmuter/backedOracle.js +0 -56
  179. package/build/dex/angle-transmuter/backedOracle.js.map +0 -1
  180. package/build/dex/angle-transmuter/config.d.ts +0 -4
  181. package/build/dex/angle-transmuter/config.js +0 -30
  182. package/build/dex/angle-transmuter/config.js.map +0 -1
  183. package/build/dex/angle-transmuter/constants.d.ts +0 -77
  184. package/build/dex/angle-transmuter/constants.js +0 -94
  185. package/build/dex/angle-transmuter/constants.js.map +0 -1
  186. package/build/dex/angle-transmuter/morphoOracle.d.ts +0 -42
  187. package/build/dex/angle-transmuter/morphoOracle.js +0 -179
  188. package/build/dex/angle-transmuter/morphoOracle.js.map +0 -1
  189. package/build/dex/angle-transmuter/morphoVault.d.ts +0 -19
  190. package/build/dex/angle-transmuter/morphoVault.js +0 -78
  191. package/build/dex/angle-transmuter/morphoVault.js.map +0 -1
  192. package/build/dex/angle-transmuter/pyth.d.ts +0 -19
  193. package/build/dex/angle-transmuter/pyth.js +0 -70
  194. package/build/dex/angle-transmuter/pyth.js.map +0 -1
  195. package/build/dex/angle-transmuter/redstone.d.ts +0 -20
  196. package/build/dex/angle-transmuter/redstone.js +0 -73
  197. package/build/dex/angle-transmuter/redstone.js.map +0 -1
  198. package/build/dex/angle-transmuter/transmuter.d.ts +0 -52
  199. package/build/dex/angle-transmuter/transmuter.js +0 -374
  200. package/build/dex/angle-transmuter/transmuter.js.map +0 -1
  201. package/build/dex/angle-transmuter/types.d.ts +0 -188
  202. package/build/dex/angle-transmuter/types.js +0 -33
  203. package/build/dex/angle-transmuter/types.js.map +0 -1
  204. package/build/dex/angle-transmuter/utils.d.ts +0 -9
  205. package/build/dex/angle-transmuter/utils.js +0 -252
  206. package/build/dex/angle-transmuter/utils.js.map +0 -1
  207. package/build/dex/smardex/subgraph-queries.d.ts +0 -1
  208. package/build/dex/smardex/subgraph-queries.js +0 -17
  209. package/build/dex/smardex/subgraph-queries.js.map +0 -1
  210. package/build/dex/smardex/usd-reserves.d.ts +0 -23
  211. package/build/dex/smardex/usd-reserves.js +0 -86
  212. package/build/dex/smardex/usd-reserves.js.map +0 -1
  213. package/build/dex/trader-joe-v2-1-2/config.d.ts +0 -4
  214. package/build/dex/trader-joe-v2-1-2/config.js +0 -47
  215. package/build/dex/trader-joe-v2-1-2/config.js.map +0 -1
  216. package/build/dex/trader-joe-v2-1-2/constants.d.ts +0 -20
  217. package/build/dex/trader-joe-v2-1-2/constants.js +0 -22
  218. package/build/dex/trader-joe-v2-1-2/constants.js.map +0 -1
  219. package/build/dex/trader-joe-v2-1-2/math/index.d.ts +0 -37
  220. package/build/dex/trader-joe-v2-1-2/math/index.js +0 -291
  221. package/build/dex/trader-joe-v2-1-2/math/index.js.map +0 -1
  222. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2-pool.d.ts +0 -60
  223. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2-pool.js +0 -248
  224. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2-pool.js.map +0 -1
  225. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2.d.ts +0 -53
  226. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2.js +0 -307
  227. package/build/dex/trader-joe-v2-1-2/trader-joe-v2-1-2.js.map +0 -1
  228. package/build/dex/trader-joe-v2-1-2/types.d.ts +0 -82
  229. package/build/dex/trader-joe-v2-1-2/types.js +0 -9
  230. package/build/dex/trader-joe-v2-1-2/types.js.map +0 -1
  231. package/build/dex/trader-joe-v2_1/config.d.ts +0 -4
  232. package/build/dex/trader-joe-v2_1/config.js +0 -47
  233. package/build/dex/trader-joe-v2_1/config.js.map +0 -1
  234. package/build/dex/trader-joe-v2_1/constants.d.ts +0 -20
  235. package/build/dex/trader-joe-v2_1/constants.js +0 -22
  236. package/build/dex/trader-joe-v2_1/constants.js.map +0 -1
  237. package/build/dex/trader-joe-v2_1/math/index.d.ts +0 -37
  238. package/build/dex/trader-joe-v2_1/math/index.js +0 -291
  239. package/build/dex/trader-joe-v2_1/math/index.js.map +0 -1
  240. package/build/dex/trader-joe-v2_1/trader-joe-v2.1.d.ts +0 -0
  241. package/build/dex/trader-joe-v2_1/trader-joe-v2.1.js +0 -384
  242. package/build/dex/trader-joe-v2_1/trader-joe-v2.1.js.map +0 -1
  243. package/build/dex/trader-joe-v2_1/trader-joe-v2_1-pool.d.ts +0 -60
  244. package/build/dex/trader-joe-v2_1/trader-joe-v2_1-pool.js +0 -247
  245. package/build/dex/trader-joe-v2_1/trader-joe-v2_1-pool.js.map +0 -1
  246. package/build/dex/trader-joe-v2_1/trader-joe-v2_1.d.ts +0 -53
  247. package/build/dex/trader-joe-v2_1/trader-joe-v2_1.js +0 -307
  248. package/build/dex/trader-joe-v2_1/trader-joe-v2_1.js.map +0 -1
  249. package/build/dex/trader-joe-v2_1/types.d.ts +0 -82
  250. package/build/dex/trader-joe-v2_1/types.js +0 -9
  251. package/build/dex/trader-joe-v2_1/types.js.map +0 -1
  252. package/build/dex/wombat/wombat-pool-poller.d.ts +0 -22
  253. package/build/dex/wombat/wombat-pool-poller.js +0 -164
  254. package/build/dex/wombat/wombat-pool-poller.js.map +0 -1
  255. package/build/dex-helper/Cache.d.ts +0 -31
  256. package/build/dex-helper/Cache.js +0 -106
  257. package/build/dex-helper/Cache.js.map +0 -1
  258. package/build/dex-helper/RedisBatcher.d.ts +0 -20
  259. package/build/dex-helper/RedisBatcher.js +0 -75
  260. package/build/dex-helper/RedisBatcher.js.map +0 -1
  261. package/build/dex-helper/RedisWrapper.d.ts +0 -37
  262. package/build/dex-helper/RedisWrapper.js +0 -165
  263. package/build/dex-helper/RedisWrapper.js.map +0 -1
@@ -0,0 +1,52 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "components": [
6
+ { "internalType": "bytes", "name": "path", "type": "bytes" },
7
+ { "internalType": "address", "name": "recipient", "type": "address" },
8
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
9
+ {
10
+ "internalType": "uint256",
11
+ "name": "amountOutMinimum",
12
+ "type": "uint256"
13
+ }
14
+ ],
15
+ "internalType": "struct ISwapRouter.ExactInputParams",
16
+ "name": "params",
17
+ "type": "tuple"
18
+ }
19
+ ],
20
+ "name": "exactInput",
21
+ "outputs": [
22
+ { "internalType": "uint256", "name": "amountOut", "type": "uint256" }
23
+ ],
24
+ "stateMutability": "payable",
25
+ "type": "function"
26
+ },
27
+ {
28
+ "inputs": [
29
+ {
30
+ "components": [
31
+ { "internalType": "bytes", "name": "path", "type": "bytes" },
32
+ { "internalType": "address", "name": "recipient", "type": "address" },
33
+ { "internalType": "uint256", "name": "amountOut", "type": "uint256" },
34
+ {
35
+ "internalType": "uint256",
36
+ "name": "amountInMaximum",
37
+ "type": "uint256"
38
+ }
39
+ ],
40
+ "internalType": "struct ISwapRouter.ExactOutputParams",
41
+ "name": "params",
42
+ "type": "tuple"
43
+ }
44
+ ],
45
+ "name": "exactOutput",
46
+ "outputs": [
47
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }
48
+ ],
49
+ "stateMutability": "payable",
50
+ "type": "function"
51
+ }
52
+ ]
package/src/config.ts CHANGED
@@ -55,8 +55,9 @@ const baseConfigs: { [network: number]: BaseConfig } = {
55
55
  Adapter03: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
56
56
  Adapter04: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
57
57
  Adapter05: '0x3329dfa55A40B450952FBE0203167Ae6908E656d',
58
+ Adapter06: '0x28bb3069aaa8ff9a39480c8c096718d3b354108b',
58
59
  BuyAdapter: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
59
- BuyAdapter02: '0xe53d24CD81cC81bbf271AD7B02D0d67f851D727c',
60
+ BuyAdapter02: '0x40dB7541b0c655a3a70c4713aD6879Ec3861c1FE',
60
61
  },
61
62
  uniswapV2ExchangeRouterAddress:
62
63
  '0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07',
@@ -9,25 +9,13 @@ import {
9
9
  import { DexConfigMap, AdapterMappings } from '../../types';
10
10
  import { Network, SwapSide } from '../../constants';
11
11
  import { normalizeAddress } from '../../utils';
12
- import { FACTORY_MAX_PLAIN_COINS } from './constants';
13
12
 
14
- // stable ng factories addresses are taken from https://github.com/curvefi/curve-api/blob/main/constants/configs/configs.js
15
13
  const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
16
14
  CurveV1Factory: {
17
15
  [Network.MAINNET]: {
18
- factories: [
19
- {
20
- address: '0xB9fC157394Af804a3578134A6585C0dc9cc990d4',
21
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
22
- },
23
- {
24
- address: '0x4f8846ae9380b90d2e71d5e3d042dff3e7ebb40d',
25
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
26
- },
27
- {
28
- address: '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf', // factory stable ng
29
- isStableNg: true,
30
- },
16
+ factoryAddresses: [
17
+ '0xB9fC157394Af804a3578134A6585C0dc9cc990d4',
18
+ '0x4f8846ae9380b90d2e71d5e3d042dff3e7ebb40d',
31
19
  ],
32
20
  stateUpdatePeriodMs: 5 * 1000,
33
21
  disabledPools: new Set([
@@ -170,30 +158,6 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
170
158
  address: '0x67fe41A94e779CcFa22cff02cc2957DC9C0e4286',
171
159
  liquidityApiSlug: '/factory-crvusd',
172
160
  },
173
- '0xdcc91f930b42619377c200ba05b7513f2958b202': {
174
- name: ImplementationNames.FACTORY_STABLE_NG,
175
- address: '0xdcc91f930b42619377c200ba05b7513f2958b202',
176
- liquidityApiSlug: '/factory-stable-ng',
177
- isStoreRateSupported: true,
178
- },
179
- '0x933f4769dcc27fc7345d9d5975ae48ec4d0f829c': {
180
- name: ImplementationNames.FACTORY_STABLE_NG,
181
- address: '0x933f4769dcc27fc7345d9d5975ae48ec4d0f829c',
182
- liquidityApiSlug: '/factory-stable-ng',
183
- isStoreRateSupported: true,
184
- },
185
- '0xede71f77d7c900dca5892720e76316c6e575f0f7': {
186
- name: ImplementationNames.FACTORY_STABLE_NG,
187
- address: '0xede71f77d7c900dca5892720e76316c6e575f0f7',
188
- liquidityApiSlug: '/factory-stable-ng',
189
- isStoreRateSupported: true,
190
- },
191
- '0xdd7ebb1c49780519dd9755b8b1a23a6f42ce099e': {
192
- name: ImplementationNames.FACTORY_STABLE_NG,
193
- address: '0xdd7ebb1c49780519dd9755b8b1a23a6f42ce099e',
194
- liquidityApiSlug: '/factory-stable-ng',
195
- isStoreRateSupported: true,
196
- },
197
161
  },
198
162
  customPools: {
199
163
  '0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2': {
@@ -244,16 +208,7 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
244
208
  },
245
209
  },
246
210
  [Network.POLYGON]: {
247
- factories: [
248
- {
249
- address: '0x722272D36ef0Da72FF51c5A65Db7b870E2e8D4ee',
250
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
251
- },
252
- {
253
- address: '0x1764ee18e8B3ccA4787249Ceb249356192594585', // factory stable ng
254
- isStableNg: true,
255
- },
256
- ],
211
+ factoryAddresses: ['0x722272D36ef0Da72FF51c5A65Db7b870E2e8D4ee'],
257
212
  stateUpdatePeriodMs: 2 * 1000,
258
213
  disabledPools: new Set([
259
214
  '0x666Dc3b4baBfd063FaF965BD020024AF0dC51B64',
@@ -336,18 +291,6 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
336
291
  address: '0xD8336532f6ED7b94282fAF724fe41d6145E07Cfc',
337
292
  basePoolAddress: '0xC2d95EEF97Ec6C17551d45e77B590dc1F9117C67',
338
293
  },
339
- '0xe265fc390e9129b7e337da23cd42e00c34da2ce3': {
340
- name: ImplementationNames.FACTORY_STABLE_NG,
341
- address: '0xe265fc390e9129b7e337da23cd42e00c34da2ce3',
342
- liquidityApiSlug: '/factory-stable-ng',
343
- isStoreRateSupported: true,
344
- },
345
- '0xa7ba18eefcd9513230987ec2fab6711af5abd9c2': {
346
- name: ImplementationNames.FACTORY_STABLE_NG,
347
- address: '0xa7ba18eefcd9513230987ec2fab6711af5abd9c2',
348
- liquidityApiSlug: '/factory-stable-ng',
349
- isStoreRateSupported: true,
350
- },
351
294
  },
352
295
  customPools: {
353
296
  '0x445FE580eF8d70FF569aB36e80c647af338db351': {
@@ -371,16 +314,7 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
371
314
  },
372
315
  },
373
316
  [Network.FANTOM]: {
374
- factories: [
375
- {
376
- address: '0x686d67265703D1f124c45E33d47d794c566889Ba',
377
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
378
- },
379
- {
380
- address: '0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b', // factory stable ng
381
- isStableNg: true,
382
- },
383
- ],
317
+ factoryAddresses: ['0x686d67265703D1f124c45E33d47d794c566889Ba'],
384
318
  stateUpdatePeriodMs: 2 * 1000,
385
319
  disabledPools: new Set([]),
386
320
  disabledImplementations: new Set([]),
@@ -463,12 +397,6 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
463
397
  address: '0xf82162bb68ad5a168345bb7efb2faa0edcca5177',
464
398
  basePoolAddress: '0x0fa949783947Bf6c1b171DB13AEACBB488845B3f',
465
399
  },
466
- '0x5702bdb1ec244704e3cbbaae11a0275ae5b07499': {
467
- name: ImplementationNames.FACTORY_STABLE_NG,
468
- address: '0x5702bdb1ec244704e3cbbaae11a0275ae5b07499',
469
- liquidityApiSlug: '/factory-stable-ng',
470
- isStoreRateSupported: true,
471
- },
472
400
  },
473
401
  customPools: {
474
402
  '0x27E611FD27b276ACbd5Ffd632E5eAEBEC9761E40': {
@@ -501,12 +429,7 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
501
429
  },
502
430
  },
503
431
  [Network.AVALANCHE]: {
504
- factories: [
505
- {
506
- address: '0xb17b674D9c5CB2e441F8e196a2f048A81355d031',
507
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
508
- },
509
- ],
432
+ factoryAddresses: ['0xb17b674D9c5CB2e441F8e196a2f048A81355d031'],
510
433
  stateUpdatePeriodMs: 2 * 1000,
511
434
  // FIX: This must be removed when we go for full CurveV1 event based support
512
435
  disabledPools: new Set(['0x16a7da911a4dd1d83f3ff066fe28f3c792c50d90']),
@@ -604,16 +527,7 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
604
527
  },
605
528
  },
606
529
  [Network.ARBITRUM]: {
607
- factories: [
608
- {
609
- address: '0xb17b674D9c5CB2e441F8e196a2f048A81355d031',
610
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
611
- },
612
- {
613
- address: '0x9AF14D26075f142eb3F292D5065EB3faa646167b', // factory stable ng
614
- isStableNg: true,
615
- },
616
- ],
530
+ factoryAddresses: ['0xb17b674D9c5CB2e441F8e196a2f048A81355d031'],
617
531
  stateUpdatePeriodMs: 2 * 1000,
618
532
  disabledPools: new Set([]),
619
533
  disabledImplementations: new Set([]),
@@ -707,18 +621,6 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
707
621
  customGasCost: 130_000,
708
622
  isStoreRateSupported: true,
709
623
  },
710
- '0xf6841c27fe35ed7069189afd5b81513578afd7ff': {
711
- name: ImplementationNames.FACTORY_STABLE_NG,
712
- address: '0xf6841c27fe35ed7069189afd5b81513578afd7ff',
713
- liquidityApiSlug: '/factory-stable-ng',
714
- isStoreRateSupported: true,
715
- },
716
- '0xff02cbd91f57a778bab7218da562594a680b8b61': {
717
- name: ImplementationNames.FACTORY_STABLE_NG,
718
- address: '0xff02cbd91f57a778bab7218da562594a680b8b61',
719
- liquidityApiSlug: '/factory-stable-ng',
720
- isStoreRateSupported: true,
721
- },
722
624
  },
723
625
  customPools: {
724
626
  '0x7f90122BF0700F9E7e1F688fe926940E8839F353': {
@@ -751,16 +653,7 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
751
653
  },
752
654
  },
753
655
  [Network.OPTIMISM]: {
754
- factories: [
755
- {
756
- address: '0x2db0E83599a91b508Ac268a6197b8B14F5e72840',
757
- maxPlainCoins: FACTORY_MAX_PLAIN_COINS,
758
- },
759
- {
760
- address: '0x5eeE3091f747E60a045a2E715a4c71e600e31F6E', // factory stable ng
761
- isStableNg: true,
762
- },
763
- ],
656
+ factoryAddresses: ['0x2db0E83599a91b508Ac268a6197b8B14F5e72840'],
764
657
  stateUpdatePeriodMs: 2 * 1000,
765
658
  disabledPools: new Set([]),
766
659
  disabledImplementations: new Set([]),
@@ -844,12 +737,6 @@ const CurveV1FactoryConfig: DexConfigMap<DexParams> = {
844
737
  customGasCost: 130_000,
845
738
  isStoreRateSupported: true,
846
739
  },
847
- '0x635742dcc8313dcf8c904206037d962c042eafbd': {
848
- name: ImplementationNames.FACTORY_STABLE_NG,
849
- address: '0x635742dcc8313dcf8c904206037d962c042eafbd',
850
- liquidityApiSlug: '/factory-stable-ng',
851
- isStoreRateSupported: true,
852
- },
853
740
  },
854
741
  customPools: {
855
742
  '0x1337BedC9D22ecbe766dF105c9623922A27963EC': {
@@ -980,7 +867,6 @@ const configAddressesNormalizer = (
980
867
  ? normalizeAddress(implementationConfig.basePoolAddress)
981
868
  : undefined,
982
869
  isStoreRateSupported: implementationConfig.isStoreRateSupported,
983
- liquidityApiSlug: implementationConfig.liquidityApiSlug,
984
870
  };
985
871
  acc[normalizeAddress(implementationAddress)] =
986
872
  normalizedImplementation;
@@ -991,12 +877,9 @@ const configAddressesNormalizer = (
991
877
 
992
878
  // Unite everything into top level config
993
879
  const normalizedConfig: DexParams = {
994
- factories: _config.factories
995
- ? _config.factories.map(e => ({
996
- ...e,
997
- address: e.address.toLowerCase(),
998
- }))
999
- : _config.factories,
880
+ factoryAddresses: _config.factoryAddresses
881
+ ? _config.factoryAddresses.map(e => e.toLowerCase())
882
+ : _config.factoryAddresses,
1000
883
  stateUpdatePeriodMs: _config.stateUpdatePeriodMs,
1001
884
  factoryPoolImplementations,
1002
885
  customPools,
@@ -50,11 +50,6 @@ function testForNetwork(
50
50
  contractMethod,
51
51
  network,
52
52
  provider,
53
- undefined,
54
- undefined,
55
- undefined,
56
- undefined,
57
- 5000,
58
53
  );
59
54
  });
60
55
  it(`${tokenBSymbol} -> ${tokenASymbol}`, async () => {
@@ -116,6 +111,7 @@ describe('CurveV1Factory E2E', () => {
116
111
  tokenBAmount,
117
112
  );
118
113
  });
114
+
119
115
  describe('Mainnet crvUSD', () => {
120
116
  const network = Network.MAINNET;
121
117
 
@@ -152,7 +148,6 @@ describe('CurveV1Factory E2E', () => {
152
148
  tokenBAmount,
153
149
  );
154
150
  });
155
-
156
151
  describe('Mainnet SBTC2 pool', () => {
157
152
  const network = Network.MAINNET;
158
153
 
@@ -171,7 +166,6 @@ describe('CurveV1Factory E2E', () => {
171
166
  tokenBAmount,
172
167
  );
173
168
  });
174
-
175
169
  describe('Polygon', () => {
176
170
  const network = Network.POLYGON;
177
171
 
@@ -321,120 +315,4 @@ describe('CurveV1Factory E2E', () => {
321
315
  tokenBAmount,
322
316
  );
323
317
  });
324
-
325
- describe('Stable NG Pools', () => {
326
- describe('Mainnet Stable NG', () => {
327
- const network = Network.MAINNET;
328
-
329
- const tokenASymbol: string = 'GHO';
330
- const tokenBSymbol: string = 'USDe';
331
-
332
- const tokenAAmount: string = '100000000';
333
- const tokenBAmount: string = '1000000000000000000';
334
-
335
- testForNetwork(
336
- network,
337
- dexKey,
338
- tokenASymbol,
339
- tokenBSymbol,
340
- tokenAAmount,
341
- tokenBAmount,
342
- );
343
- });
344
-
345
- describe('Polygon Stable NG', () => {
346
- const network = Network.POLYGON;
347
-
348
- describe('crvUSD -> USDT', () => {
349
- const tokenASymbol: string = 'crvUSD';
350
- const tokenBSymbol: string = 'USDT';
351
-
352
- const tokenAAmount: string = '1000000000000000000';
353
- const tokenBAmount: string = '10000000';
354
-
355
- testForNetwork(
356
- network,
357
- dexKey,
358
- tokenASymbol,
359
- tokenBSymbol,
360
- tokenAAmount,
361
- tokenBAmount,
362
- );
363
- });
364
-
365
- describe('USDC.e -> USDC', () => {
366
- const tokenASymbol: string = 'USDCe';
367
- const tokenBSymbol: string = 'USDC';
368
-
369
- const tokenAAmount: string = '10000000';
370
- const tokenBAmount: string = '10000000';
371
-
372
- testForNetwork(
373
- network,
374
- dexKey,
375
- tokenASymbol,
376
- tokenBSymbol,
377
- tokenAAmount,
378
- tokenBAmount,
379
- );
380
- });
381
- });
382
-
383
- describe('Fantom Stable NG', () => {
384
- const network = Network.FANTOM;
385
-
386
- const tokenASymbol: string = 'scrvUSDC_e';
387
- const tokenBSymbol: string = 'scrvUSDC_p';
388
-
389
- const tokenAAmount: string = '1000000000000000000';
390
- const tokenBAmount: string = '1000000000000000000';
391
-
392
- testForNetwork(
393
- network,
394
- dexKey,
395
- tokenASymbol,
396
- tokenBSymbol,
397
- tokenAAmount,
398
- tokenBAmount,
399
- );
400
- });
401
-
402
- describe('Arbitrum Stable NG', () => {
403
- const network = Network.ARBITRUM;
404
-
405
- const tokenASymbol: string = 'crvUSD';
406
- const tokenBSymbol: string = 'USDCe';
407
-
408
- const tokenAAmount: string = '1000000000000000000';
409
- const tokenBAmount: string = '10000000';
410
-
411
- testForNetwork(
412
- network,
413
- dexKey,
414
- tokenASymbol,
415
- tokenBSymbol,
416
- tokenAAmount,
417
- tokenBAmount,
418
- );
419
- });
420
-
421
- describe('Optimism Stable NG', () => {
422
- const network = Network.OPTIMISM;
423
-
424
- const tokenASymbol: string = 'crvUSD';
425
- const tokenBSymbol: string = 'USDT';
426
-
427
- const tokenAAmount: string = '1000000000000000000';
428
- const tokenBAmount: string = '10000000';
429
-
430
- testForNetwork(
431
- network,
432
- dexKey,
433
- tokenASymbol,
434
- tokenBSymbol,
435
- tokenAAmount,
436
- tokenBAmount,
437
- );
438
- });
439
- });
440
318
  });