@paraswap/dex-lib 4.1.2-pubsub-fluid → 4.1.2

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 (279) hide show
  1. package/.idea/aws.xml +17 -0
  2. package/.idea/codeStyles/Project.xml +19 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/misc.xml +6 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/paraswap-dex-lib.iml +9 -0
  7. package/.idea/prettier.xml +7 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/build/abi/fluid-dex/resolver.abi.json +0 -30
  10. package/build/abi/integral/factory.json +333 -0
  11. package/build/abi/{angle-transmuter/ChainlinkEACAggregatorProxy.json → integral/oracle.json} +239 -247
  12. package/build/abi/{curve-v1/StableSwapUSDN.json → integral/pool.json} +487 -450
  13. package/build/abi/{RamsesV2Pool.abi.json → integral/relayer.json} +833 -851
  14. package/build/dex/aave-v1/aave-v1.d.ts +1 -2
  15. package/build/dex/aave-v1/aave-v1.js +0 -22
  16. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  17. package/build/dex/bProtocol.d.ts +18 -0
  18. package/build/dex/bProtocol.js +39 -0
  19. package/build/dex/bProtocol.js.map +1 -0
  20. package/build/dex/bancor.d.ts +26 -0
  21. package/build/dex/bancor.js +58 -0
  22. package/build/dex/bancor.js.map +1 -0
  23. package/build/dex/compound.d.ts +18 -0
  24. package/build/dex/compound.js +46 -0
  25. package/build/dex/compound.js.map +1 -0
  26. package/build/dex/curve-v2.d.ts +58 -0
  27. package/build/dex/curve-v2.js +180 -0
  28. package/build/dex/curve-v2.js.map +1 -0
  29. package/build/dex/dodo-v1.d.ts +33 -0
  30. package/build/dex/dodo-v1.js +63 -0
  31. package/build/dex/dodo-v1.js.map +1 -0
  32. package/build/dex/fluid-dex/config.js +2 -2
  33. package/build/dex/fluid-dex/constants.d.ts +1 -1
  34. package/build/dex/fluid-dex/constants.js +1 -2
  35. package/build/dex/fluid-dex/constants.js.map +1 -1
  36. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +49 -0
  37. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +104 -0
  38. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +1 -0
  39. package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js +1 -3
  40. package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js.map +1 -1
  41. package/build/dex/fluid-dex/fluid-dex.d.ts +5 -4
  42. package/build/dex/fluid-dex/fluid-dex.js +57 -63
  43. package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
  44. package/build/dex/fluid-dex/types.d.ts +0 -3
  45. package/build/dex/generic-rfq/generic-rfq.js +2 -1
  46. package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
  47. package/build/dex/generic-rfq/rate-fetcher.d.ts +1 -4
  48. package/build/dex/generic-rfq/rate-fetcher.js +20 -53
  49. package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
  50. package/build/dex/integral/config.d.ts +4 -0
  51. package/build/dex/integral/config.js +20 -0
  52. package/build/dex/integral/config.js.map +1 -0
  53. package/build/dex/integral/context.d.ts +40 -0
  54. package/build/dex/integral/context.js +158 -0
  55. package/build/dex/integral/context.js.map +1 -0
  56. package/build/dex/integral/integral-factory.d.ts +24 -0
  57. package/build/dex/integral/integral-factory.js +95 -0
  58. package/build/dex/integral/integral-factory.js.map +1 -0
  59. package/build/dex/integral/integral-pool.d.ts +50 -0
  60. package/build/dex/integral/integral-pool.js +149 -0
  61. package/build/dex/integral/integral-pool.js.map +1 -0
  62. package/build/dex/integral/integral-pricing.d.ts +18 -0
  63. package/build/dex/integral/integral-pricing.js +114 -0
  64. package/build/dex/integral/integral-pricing.js.map +1 -0
  65. package/build/dex/integral/integral-relayer.d.ts +42 -0
  66. package/build/dex/integral/integral-relayer.js +192 -0
  67. package/build/dex/integral/integral-relayer.js.map +1 -0
  68. package/build/dex/integral/integral-token.d.ts +27 -0
  69. package/build/dex/integral/integral-token.js +59 -0
  70. package/build/dex/integral/integral-token.js.map +1 -0
  71. package/build/dex/{inception/inception-native.d.ts → integral/integral.d.ts} +19 -21
  72. package/build/dex/integral/integral.js +376 -0
  73. package/build/dex/integral/integral.js.map +1 -0
  74. package/build/dex/integral/types.d.ts +85 -0
  75. package/build/dex/integral/types.js +9 -0
  76. package/build/dex/integral/types.js.map +1 -0
  77. package/build/dex/integral/utils-e2e.d.ts +9 -0
  78. package/build/dex/integral/utils-e2e.js +131 -0
  79. package/build/dex/integral/utils-e2e.js.map +1 -0
  80. package/build/dex/integral/utils.d.ts +17 -0
  81. package/build/dex/integral/utils.js +94 -0
  82. package/build/dex/integral/utils.js.map +1 -0
  83. package/build/dex/jarvis.d.ts +1 -2
  84. package/build/dex/jarvis.js +0 -58
  85. package/build/dex/jarvis.js.map +1 -1
  86. package/build/dex/lido.d.ts +19 -0
  87. package/build/dex/lido.js +42 -0
  88. package/build/dex/lido.js.map +1 -0
  89. package/build/dex/onebit.d.ts +25 -0
  90. package/build/dex/onebit.js +42 -0
  91. package/build/dex/onebit.js.map +1 -0
  92. package/build/dex/platypus/platypus.d.ts +1 -2
  93. package/build/dex/platypus/platypus.js +0 -31
  94. package/build/dex/platypus/platypus.js.map +1 -1
  95. package/build/dex/smoothy.d.ts +26 -0
  96. package/build/dex/smoothy.js +48 -0
  97. package/build/dex/smoothy.js.map +1 -0
  98. package/build/dex/stable-pool.d.ts +28 -0
  99. package/build/dex/stable-pool.js +62 -0
  100. package/build/dex/stable-pool.js.map +1 -0
  101. package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
  102. package/build/dex/swaap-v1/swaap-v1.js +0 -10
  103. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  104. package/build/dex/trader-joe-v2.1/optimizer.d.ts +2 -0
  105. package/build/dex/trader-joe-v2.1/optimizer.js +47 -0
  106. package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -0
  107. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +7 -0
  108. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +20 -0
  109. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +1 -0
  110. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  111. package/build/dex/trader-joe-v2.1.js +79 -0
  112. package/build/dex/trader-joe-v2.1.js.map +1 -0
  113. package/build/dex/zerox/index.d.ts +26 -4
  114. package/build/dex/zerox/index.js +42 -50
  115. package/build/dex/zerox/index.js.map +1 -1
  116. package/build/dex/zerox/types.d.ts +0 -29
  117. package/build/dex/zerox/types.js +1 -8
  118. package/build/dex/zerox/types.js.map +1 -1
  119. package/build/lib/pub-sub.d.ts +0 -15
  120. package/build/lib/pub-sub.js +1 -72
  121. package/build/lib/pub-sub.js.map +1 -1
  122. package/package.json +1 -1
  123. package/src/abi/fluid-dex/resolver.abi.json +0 -30
  124. package/src/dex/fluid-dex/config.ts +2 -2
  125. package/src/dex/fluid-dex/constants.ts +1 -2
  126. package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +71 -31
  127. package/src/dex/fluid-dex/fluid-dex-liquidity-proxy.ts +0 -3
  128. package/src/dex/fluid-dex/fluid-dex.ts +91 -98
  129. package/src/dex/fluid-dex/types.ts +0 -3
  130. package/src/dex/generic-rfq/generic-rfq.ts +6 -1
  131. package/src/dex/generic-rfq/rate-fetcher.ts +47 -83
  132. package/src/lib/pub-sub.ts +0 -86
  133. package/tests/constants-e2e.ts +1 -1
  134. package/tests/tenderly-simulation.ts +0 -1
  135. package/build/abi/Aave_GSM.json +0 -751
  136. package/build/abi/Balancer.json +0 -257
  137. package/build/abi/BalancerV2.json +0 -1179
  138. package/build/abi/RamsesV2Quoter.abi.json +0 -274
  139. package/build/abi/USDM.json +0 -807
  140. package/build/abi/UniswapV2Router.json +0 -397
  141. package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +0 -1246
  142. package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
  143. package/build/abi/curve-v1/CurveTokenV1.json +0 -305
  144. package/build/abi/curve-v1/CurveTokenV2.json +0 -318
  145. package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
  146. package/build/abi/curve-v1/CurveV2Swap.json +0 -700
  147. package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
  148. package/build/abi/curve-v1/FactoryRegistry.json +0 -508
  149. package/build/abi/curve-v1/StableSwapAave.json +0 -1152
  150. package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
  151. package/build/abi/curve-v1/StableSwapCompound.json +0 -814
  152. package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
  153. package/build/abi/curve-v1/StableSwapPax.json +0 -865
  154. package/build/abi/curve-v1/StableSwapSnow.json +0 -900
  155. package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
  156. package/build/abi/curve-v1/StableSwapY.json +0 -814
  157. package/build/abi/inception/inception-ineth-pool.json +0 -1062
  158. package/build/abi/inception/inception-ineth.json +0 -609
  159. package/build/abi/inception/inception-ratio-feed.json +0 -329
  160. package/build/abi/inception/inception-vault.json +0 -991
  161. package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
  162. package/build/abi/kyberdmm.abi.json +0 -1148
  163. package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
  164. package/build/abi/nerve/nerve-metapool.json +0 -790
  165. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  166. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
  167. package/build/dex/balancer-v1/balancer-pools.json +0 -33333
  168. package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
  169. package/build/dex/bebop/websocket-fetcher.js +0 -87
  170. package/build/dex/bebop/websocket-fetcher.js.map +0 -1
  171. package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
  172. package/build/dex/idle-dao/idle-dao-pool.js +0 -176
  173. package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
  174. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
  175. package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
  176. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
  177. package/build/dex/idle-dao/scripts.d.ts +0 -9
  178. package/build/dex/idle-dao/scripts.js +0 -552
  179. package/build/dex/idle-dao/scripts.js.map +0 -1
  180. package/build/dex/inception/config.d.ts +0 -4
  181. package/build/dex/inception/config.js +0 -109
  182. package/build/dex/inception/config.js.map +0 -1
  183. package/build/dex/inception/inception-event-pool.d.ts +0 -16
  184. package/build/dex/inception/inception-event-pool.js +0 -51
  185. package/build/dex/inception/inception-event-pool.js.map +0 -1
  186. package/build/dex/inception/inception-native.js +0 -131
  187. package/build/dex/inception/inception-native.js.map +0 -1
  188. package/build/dex/inception/inception-pool.d.ts +0 -18
  189. package/build/dex/inception/inception-pool.js +0 -32
  190. package/build/dex/inception/inception-pool.js.map +0 -1
  191. package/build/dex/inception/inception-price-feed.d.ts +0 -19
  192. package/build/dex/inception/inception-price-feed.js +0 -51
  193. package/build/dex/inception/inception-price-feed.js.map +0 -1
  194. package/build/dex/inception/inception.d.ts +0 -43
  195. package/build/dex/inception/inception.js +0 -204
  196. package/build/dex/inception/inception.js.map +0 -1
  197. package/build/dex/inception/tokens.d.ts +0 -9
  198. package/build/dex/inception/tokens.js +0 -28
  199. package/build/dex/inception/tokens.js.map +0 -1
  200. package/build/dex/inception/types.d.ts +0 -22
  201. package/build/dex/inception/types.js +0 -3
  202. package/build/dex/inception/types.js.map +0 -1
  203. package/build/dex/inception/utils.d.ts +0 -6
  204. package/build/dex/inception/utils.js +0 -37
  205. package/build/dex/inception/utils.js.map +0 -1
  206. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
  207. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
  208. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
  209. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
  210. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
  211. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
  212. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
  213. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
  214. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
  215. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
  216. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
  217. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
  218. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
  219. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
  220. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
  221. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
  222. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
  223. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
  224. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
  225. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
  226. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
  227. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
  228. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
  229. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
  230. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
  231. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
  232. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
  233. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
  234. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
  235. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
  236. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
  237. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
  238. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
  239. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
  240. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
  241. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
  242. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
  243. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
  244. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
  245. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
  246. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
  247. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
  248. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
  249. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
  250. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
  251. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
  252. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
  253. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
  254. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
  255. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
  256. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
  257. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
  258. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
  259. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
  260. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
  261. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
  262. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
  263. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
  264. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
  265. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
  266. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
  267. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
  268. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
  269. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
  270. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
  271. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
  272. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
  273. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
  274. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
  275. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
  276. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
  277. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
  278. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
  279. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
@@ -48,6 +48,11 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
48
48
 
49
49
  pools: FluidDexPool[] = [];
50
50
 
51
+ // temporarily limit FLUID-ETH Dex Pool.
52
+ restrictedIds: string[] = [
53
+ 'FluidDex_0xc800b0e15c40a1ff0539218100c86f4c1bac8d9c',
54
+ ];
55
+
51
56
  eventPools: FluidDexEventPool[] = [];
52
57
 
53
58
  readonly factory: FluidDexFactory;
@@ -110,7 +115,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
110
115
  // implement this function
111
116
  async initializePricing(blockNumber: number) {
112
117
  await this.factory.initialize(blockNumber);
113
- this.pools = await this.fetchFluidDexPools(blockNumber);
118
+ this.pools = (await this.fetchFluidDexPools(blockNumber)).filter(
119
+ pool => !this.restrictedIds.includes(pool.id),
120
+ );
114
121
  this.eventPools = await Promise.all(
115
122
  this.pools.map(async pool => {
116
123
  const eventPool = new FluidDexEventPool(
@@ -133,7 +140,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
133
140
  }
134
141
 
135
142
  protected onPoolCreatedUpdatePools(poolsFromFactory: readonly Pool[]) {
136
- this.pools = this.generateFluidDexPoolsFromPoolsFactory(poolsFromFactory);
143
+ this.pools = this.generateFluidDexPoolsFromPoolsFactory(
144
+ poolsFromFactory,
145
+ ).filter(pool => !this.restrictedIds.includes(pool.id));
137
146
  this.logger.info(`${this.dexKey}: pools list was updated ...`);
138
147
  }
139
148
 
@@ -173,6 +182,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
173
182
  // A pair must have 2 different tokens.
174
183
  if (srcAddress === destAddress) return [];
175
184
 
185
+ this.pools = this.pools.filter(
186
+ pool => !this.restrictedIds.includes(pool.id),
187
+ );
176
188
  const pools = this.pools.filter(
177
189
  pool =>
178
190
  (srcAddress === pool.token0 && destAddress === pool.token1) ||
@@ -248,7 +260,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
248
260
  destToken.decimals,
249
261
  BigInt(currentPoolReserves.fee),
250
262
  currentPoolReserves.dexLimits,
251
- BigInt(currentPoolReserves.centerPrice),
252
263
  Math.floor(Date.now() / 1000),
253
264
  );
254
265
  } else {
@@ -261,7 +272,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
261
272
  destToken.decimals,
262
273
  BigInt(currentPoolReserves.fee),
263
274
  currentPoolReserves.dexLimits,
264
- BigInt(currentPoolReserves.centerPrice),
265
275
  Math.floor(Date.now() / 1000),
266
276
  );
267
277
  }
@@ -293,7 +303,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
293
303
  }, ${side}:`,
294
304
  e,
295
305
  );
296
- throw e;
297
306
  return null;
298
307
  }
299
308
  }
@@ -371,19 +380,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
371
380
  }
372
381
  } else {
373
382
  if (pool!.token0.toLowerCase() !== srcToken.toLowerCase()) {
374
- args = [
375
- false,
376
- (BigInt(destAmount) * 1000001n) / 1000000n, // 0.0001% increase target out amount when calling Fluid Dex as it is not 100% exact. Guarantees meeting reaching exact out amount condition
377
- BigInt(srcAmount),
378
- recipient,
379
- ];
383
+ args = [false, BigInt(destAmount), BigInt(srcAmount), recipient];
380
384
  } else {
381
- args = [
382
- true,
383
- (BigInt(destAmount) * 1000001n) / 1000000n, // 0.0001% increase target out amount when calling Fluid Dex as it is not 100% exact. Guarantees meeting reaching exact out amount condition
384
- BigInt(srcAmount),
385
- recipient,
386
- ];
385
+ args = [true, BigInt(destAmount), BigInt(srcAmount), recipient];
387
386
  }
388
387
  }
389
388
  const swapData = this.fluidDexPoolIface.encodeFunctionData(method, args);
@@ -416,7 +415,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
416
415
  outDecimals: number,
417
416
  fee: bigint,
418
417
  currentLimits: DexLimits,
419
- centerPrice: bigint,
420
418
  syncTime: number,
421
419
  ): bigint {
422
420
  if (amountIn === 0n) {
@@ -440,7 +438,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
440
438
  fee,
441
439
  outDecimals,
442
440
  currentLimits,
443
- centerPrice,
444
441
  syncTime,
445
442
  );
446
443
  return (amountOut * BigInt(10 ** outDecimals)) / BigInt(10 ** 12);
@@ -462,7 +459,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
462
459
  fee: bigint,
463
460
  outDecimals: number,
464
461
  currentLimits: DexLimits,
465
- centerPrice: bigint,
466
462
  syncTime: number,
467
463
  ): bigint {
468
464
  const {
@@ -607,40 +603,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
607
603
  return 0n;
608
604
  }
609
605
 
610
- if (amountInCollateral > 0) {
611
- let reservesRatioValid = swap0To1
612
- ? this.verifyToken1Reserves(
613
- colReserveIn + amountInCollateral,
614
- colReserveOut - amountOutCollateral,
615
- centerPrice,
616
- )
617
- : this.verifyToken0Reserves(
618
- colReserveOut - amountOutCollateral,
619
- colReserveIn + amountInCollateral,
620
- centerPrice,
621
- );
622
- if (!reservesRatioValid) {
623
- return 0n;
624
- }
625
- }
626
-
627
- if (amountInDebt > 0) {
628
- let reservesRatioValid = swap0To1
629
- ? this.verifyToken1Reserves(
630
- debtReserveIn + amountInDebt,
631
- debtReserveOut - amountOutDebt,
632
- centerPrice,
633
- )
634
- : this.verifyToken0Reserves(
635
- debtReserveOut - amountOutDebt,
636
- debtReserveIn + amountInDebt,
637
- centerPrice,
638
- );
639
- if (!reservesRatioValid) {
640
- return 0n;
641
- }
642
- }
643
-
644
606
  // For price calculations, we'll use a precision factor for bigint division
645
607
  const PRECISION = 1000000000000000000000000000n; // 1e27
646
608
 
@@ -680,6 +642,40 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
680
642
  return 0n;
681
643
  }
682
644
 
645
+ if (amountInCollateral > 0) {
646
+ let reservesRatioValid = swap0To1
647
+ ? this.verifyToken1Reserves(
648
+ colReserveIn + amountInCollateral,
649
+ colReserveOut - amountOutCollateral,
650
+ oldPrice,
651
+ )
652
+ : this.verifyToken0Reserves(
653
+ colReserveOut - amountOutCollateral,
654
+ colReserveIn + amountInCollateral,
655
+ oldPrice,
656
+ );
657
+ if (!reservesRatioValid) {
658
+ return 0n;
659
+ }
660
+ }
661
+
662
+ if (amountInDebt > 0) {
663
+ let reservesRatioValid = swap0To1
664
+ ? this.verifyToken1Reserves(
665
+ debtReserveIn + amountInDebt,
666
+ debtReserveOut - amountOutDebt,
667
+ oldPrice,
668
+ )
669
+ : this.verifyToken0Reserves(
670
+ debtReserveOut - amountOutDebt,
671
+ debtReserveIn + amountInDebt,
672
+ oldPrice,
673
+ );
674
+ if (!reservesRatioValid) {
675
+ return 0n;
676
+ }
677
+ }
678
+
683
679
  const totalAmountOut = amountOutCollateral + amountOutDebt;
684
680
 
685
681
  return totalAmountOut;
@@ -883,7 +879,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
883
879
  outDecimals: number,
884
880
  fee: bigint,
885
881
  currentLimits: DexLimits,
886
- centerPrice: bigint,
887
882
  syncTime: number,
888
883
  ): bigint {
889
884
  const amountOutAdjusted =
@@ -897,7 +892,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
897
892
  fee,
898
893
  outDecimals,
899
894
  currentLimits,
900
- centerPrice,
901
895
  syncTime,
902
896
  );
903
897
 
@@ -906,7 +900,7 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
906
900
  }
907
901
  const ans = (amountIn * BigInt(10 ** inDecimals)) / BigInt(10 ** 12);
908
902
 
909
- return (ans * (100000n - 5n)) / 100000n;
903
+ return ans;
910
904
  }
911
905
 
912
906
  /**
@@ -925,7 +919,6 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
925
919
  fee: bigint,
926
920
  outDecimals: number,
927
921
  currentLimits: DexLimits,
928
- centerPrice: bigint,
929
922
  syncTime: number,
930
923
  ): bigint {
931
924
  if (amountOut === 0n) {
@@ -1043,10 +1036,10 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
1043
1036
  );
1044
1037
  amountInDebt = this.applyFeeForBuy(amountInDebt, fee);
1045
1038
  if (amountOut > debtReserveOut) {
1046
- return 0n;
1039
+ return 2n ** 256n - 1n;
1047
1040
  }
1048
1041
  if (amountOut > borrowable) {
1049
- return 0n;
1042
+ return 2n ** 256n - 1n;
1050
1043
  }
1051
1044
  } else if (a >= amountOut) {
1052
1045
  // Entire trade routes through collateral pool
@@ -1058,10 +1051,10 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
1058
1051
  );
1059
1052
  amountInCollateral = this.applyFeeForBuy(amountInCollateral, fee);
1060
1053
  if (amountOut > colReserveOut) {
1061
- return 0n;
1054
+ return 2n ** 256n - 1n;
1062
1055
  }
1063
1056
  if (amountOut > withdrawable) {
1064
- return 0n;
1057
+ return 2n ** 256n - 1n;
1065
1058
  }
1066
1059
  } else {
1067
1060
  // Trade routes through both pools
@@ -1079,43 +1072,10 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
1079
1072
 
1080
1073
  amountInDebt = this.applyFeeForBuy(amountInDebt, fee);
1081
1074
  if (amountOutDebt > debtReserveOut || a > colReserveOut) {
1082
- return 0n;
1075
+ return 2n ** 256n - 1n;
1083
1076
  }
1084
1077
  if (amountOutDebt > borrowable || a > withdrawable) {
1085
- return 0n;
1086
- }
1087
- }
1088
-
1089
- if (amountInCollateral > 0) {
1090
- let reservesRatioValid = swap0to1
1091
- ? this.verifyToken1Reserves(
1092
- colReserveIn + amountInCollateral,
1093
- colReserveOut - amountOutCollateral,
1094
- centerPrice,
1095
- )
1096
- : this.verifyToken0Reserves(
1097
- colReserveOut - amountOutCollateral,
1098
- colReserveIn + amountInCollateral,
1099
- centerPrice,
1100
- );
1101
- if (!reservesRatioValid) {
1102
- return 0n;
1103
- }
1104
- }
1105
- if (amountInDebt > 0) {
1106
- let reservesRatioValid = swap0to1
1107
- ? this.verifyToken1Reserves(
1108
- debtReserveIn + amountInDebt,
1109
- debtReserveOut - amountOutDebt,
1110
- centerPrice,
1111
- )
1112
- : this.verifyToken0Reserves(
1113
- debtReserveOut - amountOutDebt,
1114
- debtReserveIn + amountInDebt,
1115
- centerPrice,
1116
- );
1117
- if (!reservesRatioValid) {
1118
- return 0n;
1078
+ return 2n ** 256n - 1n;
1119
1079
  }
1120
1080
  }
1121
1081
 
@@ -1152,7 +1112,40 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
1152
1112
  (oldPrice / BigInt(100)) * MAX_PRICE_DIFF
1153
1113
  ) {
1154
1114
  // if price diff is > 5% then swap would revert.
1155
- return 0n;
1115
+ return 2n ** 256n - 1n;
1116
+ }
1117
+
1118
+ if (amountInCollateral > 0) {
1119
+ let reservesRatioValid = swap0to1
1120
+ ? this.verifyToken1Reserves(
1121
+ colReserveIn + amountInCollateral,
1122
+ colReserveOut - amountOutCollateral,
1123
+ oldPrice,
1124
+ )
1125
+ : this.verifyToken0Reserves(
1126
+ colReserveOut - amountOutCollateral,
1127
+ colReserveIn + amountInCollateral,
1128
+ oldPrice,
1129
+ );
1130
+ if (!reservesRatioValid) {
1131
+ return 0n;
1132
+ }
1133
+ }
1134
+ if (amountInDebt > 0) {
1135
+ let reservesRatioValid = swap0to1
1136
+ ? this.verifyToken1Reserves(
1137
+ debtReserveIn + amountInDebt,
1138
+ debtReserveOut - amountOutDebt,
1139
+ oldPrice,
1140
+ )
1141
+ : this.verifyToken0Reserves(
1142
+ debtReserveOut - amountOutDebt,
1143
+ debtReserveIn + amountInDebt,
1144
+ oldPrice,
1145
+ );
1146
+ if (!reservesRatioValid) {
1147
+ return 0n;
1148
+ }
1156
1149
  }
1157
1150
 
1158
1151
  const totalAmountIn = amountInCollateral + amountInDebt;
@@ -6,7 +6,6 @@ export type PoolReserve = {
6
6
  token0: string;
7
7
  token1: string;
8
8
  fee: number;
9
- centerPrice: number;
10
9
  collateralReserves: CollateralReserves;
11
10
  debtReserves: DebtReserves;
12
11
  dexLimits: DexLimits;
@@ -17,7 +16,6 @@ export type PoolReserveResponse = [
17
16
  string,
18
17
  string,
19
18
  BigNumber,
20
- BigNumber,
21
19
  BigNumber[],
22
20
  BigNumber[],
23
21
  DexLimitResponse,
@@ -70,7 +68,6 @@ export interface PoolWithReserves {
70
68
  token0: string;
71
69
  token1: string;
72
70
  fee: number;
73
- centerPrice: number;
74
71
  collateralReserves: CollateralReserves;
75
72
  debtReserves: DebtReserves;
76
73
  }
@@ -447,7 +447,12 @@ export class GenericRFQ extends ParaSwapLimitOrders {
447
447
  }
448
448
 
449
449
  async setBlacklist(userAddress: string): Promise<boolean> {
450
- return this.rateFetcher.setBlacklist(userAddress);
450
+ await this.dexHelper.cache.hset(
451
+ this.rateFetcher.blackListCacheKey,
452
+ userAddress.toLowerCase(),
453
+ 'true',
454
+ );
455
+ return true;
451
456
  }
452
457
 
453
458
  releaseResources(): void {
@@ -37,7 +37,6 @@ import {
37
37
  ERC1271Contract,
38
38
  } from '../../lib/erc1271-utils';
39
39
  import { isContractAddress } from '../../utils';
40
- import { ExpKeyValuePubSub, NonExpSetPubSub } from '../../lib/pub-sub';
41
40
 
42
41
  const GET_FIRM_RATE_TIMEOUT_MS = 2000;
43
42
  export const reversePrice = (price: PriceAndAmountBigNumber) =>
@@ -56,9 +55,6 @@ export class RateFetcher {
56
55
  private addressToTokenMap: Record<string, TokenWithInfo> = {};
57
56
  private pairs: PairMap = {};
58
57
 
59
- private pricesPubSub: ExpKeyValuePubSub;
60
- private blacklistPubSub?: NonExpSetPubSub;
61
-
62
58
  private firmRateAuth?: (options: RequestConfig) => void;
63
59
 
64
60
  public blackListCacheKey: string;
@@ -127,13 +123,6 @@ export class RateFetcher {
127
123
  logger,
128
124
  );
129
125
 
130
- this.pricesPubSub = new ExpKeyValuePubSub(
131
- this.dexHelper,
132
- this.dexKey,
133
- 'prices',
134
- );
135
-
136
- this.blackListCacheKey = `${this.dexHelper.config.data.network}_${this.dexKey}_blacklist`;
137
126
  if (config.blacklistConfig) {
138
127
  this.blackListFetcher = new Fetcher<BlackListResponse>(
139
128
  dexHelper.httpRequest,
@@ -153,14 +142,9 @@ export class RateFetcher {
153
142
  config.blacklistConfig.intervalMs,
154
143
  logger,
155
144
  );
156
-
157
- this.blacklistPubSub = new NonExpSetPubSub(
158
- this.dexHelper,
159
- this.dexKey,
160
- 'blacklist',
161
- );
162
145
  }
163
146
 
147
+ this.blackListCacheKey = `${this.dexHelper.config.data.network}_${this.dexKey}_blacklist`;
164
148
  if (this.config.firmRateConfig.secret) {
165
149
  this.firmRateAuth = this.authHttp(this.config.firmRateConfig.secret);
166
150
  }
@@ -177,16 +161,6 @@ export class RateFetcher {
177
161
  this.config.maker,
178
162
  );
179
163
  }
180
-
181
- if (this.dexHelper.config.isSlave) {
182
- this.pricesPubSub.subscribe();
183
- if (this.blacklistPubSub) {
184
- const initSet = await this.dexHelper.cache.smembers(
185
- this.blackListCacheKey,
186
- );
187
- this.blacklistPubSub.initializeAndSubscribe(initSet);
188
- }
189
- }
190
164
  }
191
165
 
192
166
  start() {
@@ -240,22 +214,16 @@ export class RateFetcher {
240
214
  for (const address of resp.blacklist) {
241
215
  this.dexHelper.cache.sadd(this.blackListCacheKey, address.toLowerCase());
242
216
  }
243
-
244
- if (this.blacklistPubSub) {
245
- this.blacklistPubSub.publish(resp.blacklist);
246
- }
247
217
  }
248
218
 
249
219
  public isBlackListed(userAddress: string) {
250
- if (this.blacklistPubSub) {
251
- return this.blacklistPubSub.has(userAddress.toLowerCase());
252
- }
253
- return false;
220
+ return this.dexHelper.cache.sismember(
221
+ this.blackListCacheKey,
222
+ userAddress.toLowerCase(),
223
+ );
254
224
  }
255
225
 
256
226
  private handleRatesResponse(resp: RatesResponse) {
257
- const pubSubData: Record<string, unknown> = {};
258
- const ttl = this.config.rateConfig.dataTTLS;
259
227
  const pairs = this.pairs;
260
228
 
261
229
  if (isEmpty(pairs)) return;
@@ -284,51 +252,37 @@ export class RateFetcher {
284
252
  }
285
253
 
286
254
  if (prices.bids.length) {
287
- const key = `${baseToken.address}_${quoteToken.address}_bids`;
288
- const value = prices.bids;
289
- pubSubData[key] = value;
290
-
291
255
  this.dexHelper.cache.setex(
292
256
  this.dexKey,
293
257
  this.dexHelper.config.data.network,
294
- key,
295
- ttl,
296
- JSON.stringify(value),
258
+ `${baseToken.address}_${quoteToken.address}_bids`,
259
+ this.config.rateConfig.dataTTLS,
260
+ JSON.stringify(prices.bids),
297
261
  );
298
262
  currentPricePairs.add(`${baseToken.address}_${quoteToken.address}`);
299
263
  }
300
264
 
301
265
  if (prices.asks.length) {
302
- const key = `${baseToken.address}_${quoteToken.address}_asks`;
303
- const value = prices.asks;
304
- pubSubData[key] = value;
305
-
306
266
  this.dexHelper.cache.setex(
307
267
  this.dexKey,
308
268
  this.dexHelper.config.data.network,
309
- key,
310
- ttl,
311
- JSON.stringify(value),
269
+ `${baseToken.address}_${quoteToken.address}_asks`,
270
+ this.config.rateConfig.dataTTLS,
271
+ JSON.stringify(prices.asks),
312
272
  );
313
273
  currentPricePairs.add(`${quoteToken.address}_${baseToken.address}`);
314
274
  }
315
275
  });
316
276
 
317
277
  if (currentPricePairs.size > 0) {
318
- const key = `pairs`;
319
- const value = Array.from(currentPricePairs);
320
- pubSubData[key] = value;
321
-
322
278
  this.dexHelper.cache.setex(
323
279
  this.dexKey,
324
280
  this.dexHelper.config.data.network,
325
- key,
326
- ttl,
327
- JSON.stringify(value),
281
+ `pairs`,
282
+ this.config.rateConfig.dataTTLS,
283
+ JSON.stringify(Array.from(currentPricePairs)),
328
284
  );
329
285
  }
330
-
331
- this.pricesPubSub.publish(pubSubData, ttl);
332
286
  }
333
287
 
334
288
  checkHealth(): boolean {
@@ -368,13 +322,18 @@ export class RateFetcher {
368
322
  }
369
323
 
370
324
  public async getAvailablePairs(): Promise<string[]> {
371
- const pairs = await this.pricesPubSub.getAndCache<string[]>(`pairs`);
325
+ const pairs = await this.dexHelper.cache.getAndCacheLocally(
326
+ this.dexKey,
327
+ this.dexHelper.config.data.network,
328
+ `pairs`,
329
+ this.config.rateConfig.intervalMs / 1000,
330
+ );
372
331
 
373
332
  if (!pairs) {
374
333
  return [];
375
334
  }
376
335
 
377
- return pairs;
336
+ return JSON.parse(pairs) as string[];
378
337
  }
379
338
 
380
339
  public async getOrderPrice(
@@ -384,36 +343,53 @@ export class RateFetcher {
384
343
  ): Promise<PriceAndAmountBigNumber[] | null> {
385
344
  let reversed = false;
386
345
 
387
- let prices: PriceAndAmount[] | null = null;
346
+ let pricesAsString: string | null = null;
388
347
  if (side === SwapSide.SELL) {
389
- prices = await this.pricesPubSub.getAndCache(
348
+ pricesAsString = await this.dexHelper.cache.getAndCacheLocally(
349
+ this.dexKey,
350
+ this.dexHelper.config.data.network,
390
351
  `${srcToken.address}_${destToken.address}_bids`,
352
+ this.config.rateConfig.intervalMs / 1000,
391
353
  );
392
354
 
393
- if (!prices) {
394
- prices = await this.pricesPubSub.getAndCache(
355
+ if (!pricesAsString) {
356
+ pricesAsString = await this.dexHelper.cache.getAndCacheLocally(
357
+ this.dexKey,
358
+ this.dexHelper.config.data.network,
395
359
  `${destToken.address}_${srcToken.address}_asks`,
360
+ this.config.rateConfig.intervalMs / 1000,
396
361
  );
397
362
  reversed = true;
398
363
  }
399
364
  } else {
400
- prices = await this.pricesPubSub.getAndCache(
365
+ pricesAsString = await this.dexHelper.cache.getAndCacheLocally(
366
+ this.dexKey,
367
+ this.dexHelper.config.data.network,
401
368
  `${destToken.address}_${srcToken.address}_asks`,
369
+ this.config.rateConfig.intervalMs / 1000,
402
370
  );
403
371
 
404
- if (!prices) {
405
- prices = await this.pricesPubSub.getAndCache(
372
+ if (!pricesAsString) {
373
+ pricesAsString = await this.dexHelper.cache.getAndCacheLocally(
374
+ this.dexKey,
375
+ this.dexHelper.config.data.network,
406
376
  `${srcToken.address}_${destToken.address}_bids`,
377
+ this.config.rateConfig.intervalMs / 1000,
407
378
  );
408
379
  reversed = true;
409
380
  }
410
381
  }
411
382
 
412
- if (!prices) {
383
+ if (!pricesAsString) {
413
384
  return null;
414
385
  }
415
386
 
416
- let orderPrices = prices.map(price => [
387
+ const orderPricesAsString: PriceAndAmount[] = JSON.parse(pricesAsString);
388
+ if (!orderPricesAsString) {
389
+ return null;
390
+ }
391
+
392
+ let orderPrices = orderPricesAsString.map(price => [
417
393
  new BigNumber(price[0]),
418
394
  new BigNumber(price[1]),
419
395
  ]);
@@ -512,16 +488,4 @@ export class RateFetcher {
512
488
  throw e;
513
489
  }
514
490
  }
515
-
516
- async setBlacklist(userAddress: string): Promise<boolean> {
517
- await this.dexHelper.cache.hset(
518
- this.blackListCacheKey,
519
- userAddress.toLowerCase(),
520
- 'true',
521
- );
522
- if (this.blacklistPubSub) {
523
- this.blacklistPubSub.publish([userAddress.toLowerCase()]);
524
- }
525
- return true;
526
- }
527
491
  }