@paraswap/dex-lib 2.28.9-take-surplus.0 → 2.28.9-take-surplus.1

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 (330) hide show
  1. package/build/abi/RamsesV2StateMulticall.abi.json +891 -0
  2. package/build/abi/aerodrome/aerodrome-pool-factory.json +586 -0
  3. package/build/abi/algebra/AlgebraFactory-v1_1.abi.json +250 -0
  4. package/build/abi/api3-proxy.json +53 -0
  5. package/build/abi/api3-server-v1.json +463 -0
  6. package/build/abi/nomiswap-v2/nomiswap-v2-pool.json +773 -0
  7. package/build/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
  8. package/build/abi/quick-perps/fast-price-events.json +70 -0
  9. package/build/abi/quick-perps/fast-price-feed.json +741 -0
  10. package/build/abi/quick-perps/reader.json +313 -0
  11. package/build/abi/quick-perps/vault-price-feed.json +323 -0
  12. package/build/abi/quick-perps/vault.json +1953 -0
  13. package/build/abi/quickPerps/fast-price-events.json +70 -0
  14. package/build/abi/quickPerps/fast-price-feed.json +748 -0
  15. package/build/abi/quickPerps/reader.json +313 -0
  16. package/build/abi/quickPerps/vault-price-feed.json +477 -0
  17. package/build/abi/quickPerps/vault.json +1953 -0
  18. package/build/abi/ramses-v2/RamsesV2Pool.abi.json +1599 -0
  19. package/build/abi/uniswap-v3/UniswapV3Factory.abi.json +148 -0
  20. package/build/abi/uniswap-v3/UniswapV3QuoterV2.abi.json +155 -0
  21. package/build/composed-event-subscriber.js +8 -2
  22. package/build/composed-event-subscriber.js.map +1 -1
  23. package/build/config.d.ts +0 -1
  24. package/build/config.js +75 -14
  25. package/build/config.js.map +1 -1
  26. package/build/constants.d.ts +2 -1
  27. package/build/constants.js +1 -0
  28. package/build/constants.js.map +1 -1
  29. package/build/dex/algebra/algebra-factory.d.ts +25 -0
  30. package/build/dex/algebra/algebra-factory.js +43 -0
  31. package/build/dex/algebra/algebra-factory.js.map +1 -0
  32. package/build/dex/algebra/algebra-pool-v1_1.d.ts +16 -2
  33. package/build/dex/algebra/algebra-pool-v1_1.js +166 -4
  34. package/build/dex/algebra/algebra-pool-v1_1.js.map +1 -1
  35. package/build/dex/algebra/algebra.d.ts +4 -1
  36. package/build/dex/algebra/algebra.js +42 -21
  37. package/build/dex/algebra/algebra.js.map +1 -1
  38. package/build/dex/algebra/config.js +1 -0
  39. package/build/dex/algebra/config.js.map +1 -1
  40. package/build/dex/algebra/lib/TickTable.js +51 -40
  41. package/build/dex/algebra/lib/TickTable.js.map +1 -1
  42. package/build/dex/algebra/types.d.ts +5 -2
  43. package/build/dex/algebra/utils.d.ts +3 -1
  44. package/build/dex/algebra/utils.js +59 -1
  45. package/build/dex/algebra/utils.js.map +1 -1
  46. package/build/dex/balancer-v2/balancer-v2.js +79 -6
  47. package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
  48. package/build/dex/balancer-v2/config.js +10 -2
  49. package/build/dex/balancer-v2/config.js.map +1 -1
  50. package/build/dex/balancer-v2/optimizer.js +38 -51
  51. package/build/dex/balancer-v2/optimizer.js.map +1 -1
  52. package/build/dex/balancer-v2/types.d.ts +0 -4
  53. package/build/dex/balancer-v2/types.js.map +1 -1
  54. package/build/dex/curve-v1/config.js +40 -38
  55. package/build/dex/curve-v1/config.js.map +1 -1
  56. package/build/dex/curve-v1-factory/config.js +17 -9
  57. package/build/dex/curve-v1-factory/config.js.map +1 -1
  58. package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +1 -1
  59. package/build/dex/curve-v1-factory/curve-v1-factory.js +205 -182
  60. package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
  61. package/build/dex/curve-v1-factory/curve-v1-pool-manager.d.ts +2 -1
  62. package/build/dex/curve-v1-factory/curve-v1-pool-manager.js +8 -2
  63. package/build/dex/curve-v1-factory/curve-v1-pool-manager.js.map +1 -1
  64. package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js +1 -0
  65. package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js.map +1 -1
  66. package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js +1 -0
  67. package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js.map +1 -1
  68. package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js +2 -1
  69. package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js.map +1 -1
  70. package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js +1 -0
  71. package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js.map +1 -1
  72. package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js +1 -0
  73. package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js.map +1 -1
  74. package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js +61 -14
  75. package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js.map +1 -1
  76. package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js +1 -0
  77. package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js.map +1 -1
  78. package/build/dex/curve-v1-factory/price-handlers/functions/constants.js +10 -0
  79. package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
  80. package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js +1 -0
  81. package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js.map +1 -1
  82. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js +1 -0
  83. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js.map +1 -1
  84. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js +1 -0
  85. package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js.map +1 -1
  86. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js +1 -0
  87. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js.map +1 -1
  88. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js +1 -0
  89. package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js.map +1 -1
  90. package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js +1 -0
  91. package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js.map +1 -1
  92. package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js +1 -0
  93. package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js.map +1 -1
  94. package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js +11 -4
  95. package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js.map +1 -1
  96. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.d.ts +1 -1
  97. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +2 -2
  98. package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
  99. package/build/dex/curve-v1-factory/types.d.ts +4 -1
  100. package/build/dex/curve-v1-factory/types.js +1 -0
  101. package/build/dex/curve-v1-factory/types.js.map +1 -1
  102. package/build/dex/generic-rfq/generic-rfq.d.ts +2 -1
  103. package/build/dex/generic-rfq/generic-rfq.js +9 -5
  104. package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
  105. package/build/dex/generic-rfq/rate-fetcher.d.ts +1 -1
  106. package/build/dex/generic-rfq/rate-fetcher.js +2 -1
  107. package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
  108. package/build/dex/generic-rfq/types.d.ts +1 -0
  109. package/build/dex/generic-rfq/types.js.map +1 -1
  110. package/build/dex/hashflow/hashflow.d.ts +1 -0
  111. package/build/dex/hashflow/hashflow.js +1 -0
  112. package/build/dex/hashflow/hashflow.js.map +1 -1
  113. package/build/dex/idex.d.ts +1 -0
  114. package/build/dex/index.d.ts +1 -0
  115. package/build/dex/index.js +21 -0
  116. package/build/dex/index.js.map +1 -1
  117. package/build/dex/maverick-v1/config.js +9 -0
  118. package/build/dex/maverick-v1/config.js.map +1 -1
  119. package/build/dex/maverick-v1/maverick-v1.js +11 -2
  120. package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
  121. package/build/dex/maverick-v1/scripts/event-sequence.d.ts +1 -0
  122. package/build/dex/maverick-v1/scripts/event-sequence.js +110 -0
  123. package/build/dex/maverick-v1/scripts/event-sequence.js.map +1 -0
  124. package/build/dex/pancakeswap-v3/config.js +17 -0
  125. package/build/dex/pancakeswap-v3/config.js.map +1 -1
  126. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.d.ts +26 -0
  127. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js +44 -0
  128. package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js.map +1 -0
  129. package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -0
  130. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +26 -2
  131. package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
  132. package/build/dex/quick-perps/config.d.ts +11 -0
  133. package/build/dex/quick-perps/config.js +27 -0
  134. package/build/dex/quick-perps/config.js.map +1 -0
  135. package/build/dex/quick-perps/fast-price-feed.d.ts +26 -0
  136. package/build/dex/quick-perps/fast-price-feed.js +176 -0
  137. package/build/dex/quick-perps/fast-price-feed.js.map +1 -0
  138. package/build/dex/quick-perps/pool.d.ts +21 -0
  139. package/build/dex/quick-perps/pool.js +225 -0
  140. package/build/dex/quick-perps/pool.js.map +1 -0
  141. package/build/dex/quick-perps/quick-perps.d.ts +52 -0
  142. package/build/dex/quick-perps/quick-perps.js +211 -0
  143. package/build/dex/quick-perps/quick-perps.js.map +1 -0
  144. package/build/dex/quick-perps/types.d.ts +98 -0
  145. package/build/dex/quick-perps/types.js +3 -0
  146. package/build/dex/quick-perps/types.js.map +1 -0
  147. package/build/dex/quick-perps/usdq.d.ts +15 -0
  148. package/build/dex/quick-perps/usdq.js +61 -0
  149. package/build/dex/quick-perps/usdq.js.map +1 -0
  150. package/build/dex/quick-perps/vault-price-feed.d.ts +43 -0
  151. package/build/dex/quick-perps/vault-price-feed.js +194 -0
  152. package/build/dex/quick-perps/vault-price-feed.js.map +1 -0
  153. package/build/dex/quick-perps/vault-utils.d.ts +8 -0
  154. package/build/dex/quick-perps/vault-utils.js +41 -0
  155. package/build/dex/quick-perps/vault-utils.js.map +1 -0
  156. package/build/dex/quick-perps/vault.d.ts +46 -0
  157. package/build/dex/quick-perps/vault.js +166 -0
  158. package/build/dex/quick-perps/vault.js.map +1 -0
  159. package/build/dex/solidly/config.js +52 -2
  160. package/build/dex/solidly/config.js.map +1 -1
  161. package/build/dex/solidly/forks-override/aerodrome.d.ts +14 -0
  162. package/build/dex/solidly/forks-override/aerodrome.js +48 -0
  163. package/build/dex/solidly/forks-override/aerodrome.js.map +1 -0
  164. package/build/dex/solidly/forks-override/equalizer.d.ts +20 -0
  165. package/build/dex/solidly/forks-override/equalizer.js +46 -0
  166. package/build/dex/solidly/forks-override/equalizer.js.map +1 -0
  167. package/build/dex/solidly/forks-override/ramses.d.ts +44 -0
  168. package/build/dex/solidly/forks-override/ramses.js +144 -0
  169. package/build/dex/solidly/forks-override/ramses.js.map +1 -0
  170. package/build/dex/solidly/forks-override/velodromeV2.d.ts +20 -0
  171. package/build/dex/solidly/forks-override/velodromeV2.js +50 -0
  172. package/build/dex/solidly/forks-override/velodromeV2.js.map +1 -0
  173. package/build/dex/solidly/solidly.js +4 -0
  174. package/build/dex/solidly/solidly.js.map +1 -1
  175. package/build/dex/uniswap-v2/nomiswap-v2.d.ts +24 -0
  176. package/build/dex/uniswap-v2/nomiswap-v2.js +44 -0
  177. package/build/dex/uniswap-v2/nomiswap-v2.js.map +1 -0
  178. package/build/dex/uniswap-v3/config.js +166 -0
  179. package/build/dex/uniswap-v3/config.js.map +1 -1
  180. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.d.ts +19 -0
  181. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js +99 -0
  182. package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js.map +1 -0
  183. package/build/dex/uniswap-v3/forks/ramses-v2/utils.d.ts +4 -0
  184. package/build/dex/uniswap-v3/forks/ramses-v2/utils.js +63 -0
  185. package/build/dex/uniswap-v3/forks/ramses-v2/utils.js.map +1 -0
  186. package/build/dex/uniswap-v3/types.d.ts +10 -1
  187. package/build/dex/uniswap-v3/types.js.map +1 -1
  188. package/build/dex/uniswap-v3/uniswap-v3-factory.d.ts +26 -0
  189. package/build/dex/uniswap-v3/uniswap-v3-factory.js +44 -0
  190. package/build/dex/uniswap-v3/uniswap-v3-factory.js.map +1 -0
  191. package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +8 -6
  192. package/build/dex/uniswap-v3/uniswap-v3-pool.js +5 -2
  193. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  194. package/build/dex/uniswap-v3/uniswap-v3.d.ts +7 -4
  195. package/build/dex/uniswap-v3/uniswap-v3.js +51 -10
  196. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  197. package/build/dex/weth/config.js +3 -0
  198. package/build/dex/weth/config.js.map +1 -1
  199. package/build/dex/woo-fi-v2/config.js +13 -0
  200. package/build/dex/woo-fi-v2/config.js.map +1 -1
  201. package/build/dex-helper/dummy-dex-helper.js +7 -1
  202. package/build/dex-helper/dummy-dex-helper.js.map +1 -1
  203. package/build/dex-helper/icache.d.ts +1 -0
  204. package/build/lib/api3-feed.d.ts +30 -0
  205. package/build/lib/api3-feed.js +100 -0
  206. package/build/lib/api3-feed.js.map +1 -0
  207. package/build/lib/decoders.d.ts +3 -0
  208. package/build/lib/decoders.js +9 -1
  209. package/build/lib/decoders.js.map +1 -1
  210. package/build/stateful-event-subscriber.d.ts +1 -0
  211. package/build/stateful-event-subscriber.js +6 -0
  212. package/build/stateful-event-subscriber.js.map +1 -1
  213. package/build/types.d.ts +2 -0
  214. package/build/workers.d.ts +0 -0
  215. package/build/workers.js +2 -0
  216. package/build/workers.js.map +1 -0
  217. package/package.json +1 -1
  218. package/src/abi/RamsesV2Pool.abi.json +1554 -0
  219. package/src/abi/RamsesV2Quoter.abi.json +274 -0
  220. package/src/abi/RamsesV2StateMulticall.abi.json +891 -0
  221. package/src/abi/aerodrome/aerodrome-pool-factory.json +586 -0
  222. package/src/abi/algebra/AlgebraFactory-v1_1.abi.json +250 -0
  223. package/src/abi/api3-proxy.json +53 -0
  224. package/src/abi/api3-server-v1.json +463 -0
  225. package/src/abi/nomiswap-v2/nomiswap-v2-pool.json +773 -0
  226. package/src/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
  227. package/src/abi/quick-perps/fast-price-events.json +70 -0
  228. package/src/abi/quick-perps/fast-price-feed.json +741 -0
  229. package/src/abi/quick-perps/reader.json +313 -0
  230. package/src/abi/quick-perps/vault-price-feed.json +323 -0
  231. package/src/abi/quick-perps/vault.json +1953 -0
  232. package/src/abi/ramses-v2/RamsesV2Pool.abi.json +1599 -0
  233. package/src/composed-event-subscriber.ts +16 -11
  234. package/src/config.ts +80 -14
  235. package/src/constants.ts +1 -0
  236. package/src/dex/algebra/algebra-factory.ts +70 -0
  237. package/src/dex/algebra/algebra-integration.test.ts +316 -16
  238. package/src/dex/algebra/algebra-pool-v1_1.ts +259 -8
  239. package/src/dex/algebra/algebra.ts +73 -22
  240. package/src/dex/algebra/config.ts +1 -0
  241. package/src/dex/algebra/lib/TickTable.ts +75 -74
  242. package/src/dex/algebra/types.ts +6 -2
  243. package/src/dex/algebra/utils.ts +83 -2
  244. package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +133 -4
  245. package/src/dex/balancer-v2/balancer-v2.ts +87 -6
  246. package/src/dex/balancer-v2/config.ts +11 -2
  247. package/src/dex/balancer-v2/optimizer.ts +49 -62
  248. package/src/dex/balancer-v2/types.ts +0 -4
  249. package/src/dex/curve-v1/config.ts +40 -38
  250. package/src/dex/curve-v1-factory/config.ts +17 -9
  251. package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +19 -0
  252. package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +165 -45
  253. package/src/dex/curve-v1-factory/curve-v1-factory.ts +477 -415
  254. package/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +15 -2
  255. package/src/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.ts +1 -0
  256. package/src/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.ts +1 -0
  257. package/src/dex/curve-v1-factory/price-handlers/functions/_rates.ts +2 -1
  258. package/src/dex/curve-v1-factory/price-handlers/functions/_xp.ts +1 -0
  259. package/src/dex/curve-v1-factory/price-handlers/functions/_xp_mem.ts +1 -0
  260. package/src/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.ts +71 -13
  261. package/src/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.ts +1 -0
  262. package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +11 -0
  263. package/src/dex/curve-v1-factory/price-handlers/functions/get_D.ts +2 -0
  264. package/src/dex/curve-v1-factory/price-handlers/functions/get_D_mem.ts +1 -0
  265. package/src/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.ts +1 -0
  266. package/src/dex/curve-v1-factory/price-handlers/functions/get_dy.ts +1 -0
  267. package/src/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.ts +1 -0
  268. package/src/dex/curve-v1-factory/price-handlers/functions/get_y.ts +1 -0
  269. package/src/dex/curve-v1-factory/price-handlers/functions/get_y_D.ts +1 -0
  270. package/src/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.ts +13 -5
  271. package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +2 -1
  272. package/src/dex/curve-v1-factory/types.ts +3 -1
  273. package/src/dex/generic-rfq/example-api.test.ts +1 -1
  274. package/src/dex/generic-rfq/generic-rfq.ts +12 -4
  275. package/src/dex/generic-rfq/rate-fetcher.ts +4 -2
  276. package/src/dex/generic-rfq/types.ts +1 -0
  277. package/src/dex/hashflow/hashflow-e2e.test.ts +36 -3
  278. package/src/dex/hashflow/hashflow.ts +2 -1
  279. package/src/dex/idex.ts +1 -0
  280. package/src/dex/index.ts +21 -0
  281. package/src/dex/maverick-v1/config.ts +10 -0
  282. package/src/dex/maverick-v1/maverick-v1-e2e.test.ts +115 -1
  283. package/src/dex/maverick-v1/maverick-v1.ts +12 -2
  284. package/src/dex/pancakeswap-v3/config.ts +19 -0
  285. package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +114 -0
  286. package/src/dex/pancakeswap-v3/pancakeswap-v3-factory.ts +73 -0
  287. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +50 -2
  288. package/src/dex/quick-perps/config.ts +31 -0
  289. package/src/dex/quick-perps/fast-price-feed.ts +279 -0
  290. package/src/dex/quick-perps/pool.ts +407 -0
  291. package/src/dex/quick-perps/quick-perps-e2e.test.ts +65 -0
  292. package/src/dex/quick-perps/quick-perps-events.test.ts +100 -0
  293. package/src/dex/quick-perps/quick-perps-integration.test.ts +153 -0
  294. package/src/dex/quick-perps/quick-perps.ts +302 -0
  295. package/src/dex/quick-perps/types.ts +97 -0
  296. package/src/dex/quick-perps/usdq.ts +83 -0
  297. package/src/dex/quick-perps/vault-price-feed.ts +322 -0
  298. package/src/dex/quick-perps/vault-utils.ts +53 -0
  299. package/src/dex/quick-perps/vault.ts +290 -0
  300. package/src/dex/solidly/config.ts +58 -2
  301. package/src/dex/solidly/forks-override/aerodrome.ts +53 -0
  302. package/src/dex/solidly/forks-override/equalizer.ts +58 -0
  303. package/src/dex/solidly/forks-override/ramses.ts +253 -0
  304. package/src/dex/solidly/forks-override/velodromeV2.ts +63 -0
  305. package/src/dex/solidly/solidly-e2e.test.ts +313 -1
  306. package/src/dex/solidly/solidly-integration.test.ts +540 -41
  307. package/src/dex/solidly/solidly.ts +5 -0
  308. package/src/dex/uniswap-v2/nomiswap-v2.ts +63 -0
  309. package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +120 -1
  310. package/src/dex/uniswap-v3/config.ts +174 -0
  311. package/src/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.ts +156 -0
  312. package/src/dex/uniswap-v3/forks/ramses-v2/utils.ts +72 -0
  313. package/src/dex/uniswap-v3/types.ts +14 -1
  314. package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +1071 -346
  315. package/src/dex/uniswap-v3/uniswap-v3-factory.ts +73 -0
  316. package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +787 -14
  317. package/src/dex/uniswap-v3/uniswap-v3-pool.ts +13 -5
  318. package/src/dex/uniswap-v3/uniswap-v3.ts +87 -20
  319. package/src/dex/weth/config.ts +3 -0
  320. package/src/dex/woo-fi-v2/config.ts +13 -0
  321. package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +64 -0
  322. package/src/dex-helper/dummy-dex-helper.ts +8 -1
  323. package/src/dex-helper/icache.ts +2 -0
  324. package/src/lib/api3-feed.ts +175 -0
  325. package/src/lib/decoders.ts +13 -0
  326. package/src/stateful-event-subscriber.ts +8 -0
  327. package/src/types.ts +2 -0
  328. package/tests/constants-e2e.ts +102 -6
  329. package/tests/tenderly-simulation.ts +48 -4
  330. package/tests/utils-e2e.ts +21 -11
package/src/dex/index.ts CHANGED
@@ -42,13 +42,17 @@ import { WooFiV2 } from './woo-fi-v2/woo-fi-v2';
42
42
  import { ParaSwapLimitOrders } from './paraswap-limit-orders/paraswap-limit-orders';
43
43
  import { AugustusRFQOrder } from './augustus-rfq';
44
44
  import { Solidly } from './solidly/solidly';
45
+ import { Ramses } from './solidly/forks-override/ramses';
45
46
  import { Thena } from './solidly/forks-override/thena';
46
47
  import { Chronos } from './solidly/forks-override/chronos';
47
48
  import { Velodrome } from './solidly/forks-override/velodrome';
49
+ import { VelodromeV2 } from './solidly/forks-override/velodromeV2';
50
+ import { Aerodrome } from './solidly/forks-override/aerodrome';
48
51
  import { SpiritSwapV2 } from './solidly/forks-override/spiritSwapV2';
49
52
  import { Synthetix } from './synthetix/synthetix';
50
53
  import { Cone } from './solidly/forks-override/cone';
51
54
  import { SoliSnek } from './solidly/forks-override/solisnek';
55
+ import { Equalizer } from './solidly/forks-override/equalizer';
52
56
  import { BalancerV1 } from './balancer-v1/balancer-v1';
53
57
  import { balancerV1Merge } from './balancer-v1/optimizer';
54
58
  import { CurveV1 } from './curve-v1/curve-v1';
@@ -70,6 +74,8 @@ import { SpiritSwapV3 } from './quickswap/spiritswap-v3';
70
74
  import { TraderJoeV21 } from './trader-joe-v2.1';
71
75
  import { PancakeswapV3 } from './pancakeswap-v3/pancakeswap-v3';
72
76
  import { Algebra } from './algebra/algebra';
77
+ import { QuickPerps } from './quick-perps/quick-perps';
78
+ import { NomiswapV2 } from './uniswap-v2/nomiswap-v2';
73
79
 
74
80
  const LegacyDexes = [
75
81
  CurveV2,
@@ -124,11 +130,15 @@ const Dexes = [
124
130
  Solidly,
125
131
  SolidlyEthereum,
126
132
  SpiritSwapV2,
133
+ Ramses,
127
134
  Thena,
128
135
  Chronos,
129
136
  Velodrome,
137
+ VelodromeV2,
138
+ Aerodrome,
130
139
  Cone,
131
140
  SoliSnek,
141
+ Equalizer,
132
142
  Synthetix,
133
143
  CurveV1Factory,
134
144
  SwaapV1,
@@ -137,6 +147,8 @@ const Dexes = [
137
147
  MaverickV1,
138
148
  Camelot,
139
149
  SwaapV2,
150
+ QuickPerps,
151
+ NomiswapV2,
140
152
  ];
141
153
 
142
154
  export type LegacyDexConstructor = new (dexHelper: IDexHelper) => IDexTxBuilder<
@@ -303,4 +315,13 @@ export class DexAdapterService {
303
315
  ? this.sellAdapters[specialDexKey]
304
316
  : this.buyAdapters[specialDexKey];
305
317
  }
318
+
319
+ doesPreProcessingRequireSequentiality(dexKey: string): boolean {
320
+ try {
321
+ const dex = this.getDexByKey(dexKey);
322
+ return !!dex.needsSequentialPreprocessing;
323
+ } catch (e) {
324
+ return false;
325
+ }
326
+ }
306
327
  }
@@ -14,6 +14,12 @@ export const MaverickV1Config: DexConfigMap<DexParams> = {
14
14
  routerAddress: '0x4a585e0f7c18e2c414221d6402652d5e0990e5f8',
15
15
  poolInspectorAddress: '0xaA5BF61a664109e959D69C38734d4EA7dF74e456',
16
16
  },
17
+ [Network.BASE]: {
18
+ subgraphURL:
19
+ 'https://api.studio.thegraph.com/query/42519/maverick-base/version/latest',
20
+ routerAddress: '0x32AED3Bce901DA12ca8489788F3A99fCe1056e14',
21
+ poolInspectorAddress: '0x65A3AD03Be97619284bA7AA1E3Ca05638B9d6364',
22
+ },
17
23
  },
18
24
  };
19
25
 
@@ -22,4 +28,8 @@ export const Adapters: Record<number, AdapterMappings> = {
22
28
  [SwapSide.SELL]: [{ name: 'Adapter04', index: 2 }],
23
29
  [SwapSide.BUY]: [{ name: 'BuyAdapter', index: 8 }],
24
30
  },
31
+ [Network.BASE]: {
32
+ [SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 2 }],
33
+ [SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 2 }],
34
+ },
25
35
  };
@@ -11,10 +11,103 @@ import { Network, ContractMethod, SwapSide } from '../../constants';
11
11
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
12
12
  import { generateConfig } from '../../config';
13
13
 
14
+ function testForNetwork(
15
+ network: Network,
16
+ dexKey: string,
17
+ tokenASymbol: string,
18
+ tokenBSymbol: string,
19
+ tokenAAmount: string,
20
+ tokenBAmount: string,
21
+ nativeTokenAmount: string,
22
+ slippage?: number | undefined,
23
+ ) {
24
+ const provider = new StaticJsonRpcProvider(
25
+ generateConfig(network).privateHttpProvider,
26
+ network,
27
+ );
28
+ const tokens = Tokens[network];
29
+ const holders = Holders[network];
30
+ const nativeTokenSymbol = NativeTokenSymbols[network];
31
+
32
+ const sideToContractMethods = new Map([
33
+ [
34
+ SwapSide.SELL,
35
+ [
36
+ ContractMethod.simpleSwap,
37
+ ContractMethod.multiSwap,
38
+ ContractMethod.megaSwap,
39
+ ],
40
+ ],
41
+ [SwapSide.BUY, [ContractMethod.simpleBuy, ContractMethod.buy]],
42
+ ]);
43
+
44
+ describe(`${network}`, () => {
45
+ sideToContractMethods.forEach((contractMethods, side) =>
46
+ describe(`${side}`, () => {
47
+ contractMethods.forEach((contractMethod: ContractMethod) => {
48
+ describe(`${contractMethod}`, () => {
49
+ it(`${nativeTokenSymbol} -> ${tokenASymbol}`, async () => {
50
+ await testE2E(
51
+ tokens[nativeTokenSymbol],
52
+ tokens[tokenASymbol],
53
+ holders[nativeTokenSymbol],
54
+ side === SwapSide.SELL ? nativeTokenAmount : tokenAAmount,
55
+ side,
56
+ dexKey,
57
+ contractMethod,
58
+ network,
59
+ provider,
60
+ undefined,
61
+ undefined,
62
+ undefined,
63
+ slippage,
64
+ );
65
+ });
66
+ it(`${tokenASymbol} -> ${nativeTokenSymbol}`, async () => {
67
+ await testE2E(
68
+ tokens[tokenASymbol],
69
+ tokens[nativeTokenSymbol],
70
+ holders[tokenASymbol],
71
+ side === SwapSide.SELL ? tokenAAmount : nativeTokenAmount,
72
+ side,
73
+ dexKey,
74
+ contractMethod,
75
+ network,
76
+ provider,
77
+ undefined,
78
+ undefined,
79
+ undefined,
80
+ slippage,
81
+ );
82
+ });
83
+ it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
84
+ await testE2E(
85
+ tokens[tokenASymbol],
86
+ tokens[tokenBSymbol],
87
+ holders[tokenASymbol],
88
+ side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
89
+ side,
90
+ dexKey,
91
+ contractMethod,
92
+ network,
93
+ provider,
94
+ undefined,
95
+ undefined,
96
+ undefined,
97
+ slippage,
98
+ );
99
+ });
100
+ });
101
+ });
102
+ }),
103
+ );
104
+ });
105
+ }
106
+
14
107
  describe('MaverickV1 E2E', () => {
15
108
  const dexKey = 'MaverickV1';
16
109
 
17
- describe('MaverickV1 MAINNET', () => {
110
+ describe('MAINNET', () => {
18
111
  const network = Network.MAINNET;
19
112
  const tokens = Tokens[network];
20
113
  const holders = Holders[network];
@@ -121,4 +214,25 @@ describe('MaverickV1 E2E', () => {
121
214
  );
122
215
  });
123
216
  });
217
+
218
+ describe('BASE', () => {
219
+ const network = Network.BASE;
220
+
221
+ const tokenASymbol: string = 'USDbC';
222
+ const tokenBSymbol: string = 'MAV';
223
+
224
+ const tokenAAmount: string = '1111100000';
225
+ const tokenBAmount: string = '1100000000000000000';
226
+ const nativeTokenAmount = '100000000000000000';
227
+
228
+ testForNetwork(
229
+ network,
230
+ dexKey,
231
+ tokenASymbol,
232
+ tokenBSymbol,
233
+ tokenAAmount,
234
+ tokenBAmount,
235
+ nativeTokenAmount,
236
+ );
237
+ });
124
238
  });
@@ -78,6 +78,7 @@ export class MaverickV1
78
78
 
79
79
  async setupEventPools(blockNumber: number) {
80
80
  const pools = await this.fetchAllSubgraphPools();
81
+
81
82
  await Promise.all(
82
83
  pools.map(async (pool: any) => {
83
84
  const eventPool = new MaverickV1EventPool(
@@ -181,8 +182,17 @@ export class MaverickV1
181
182
  getCalldataGasCost(
182
183
  poolPrices: PoolPrices<MaverickV1Data>,
183
184
  ): number | number[] {
184
- // TODO: update if there is any payload in getAdapterParam
185
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
185
+ const gasCost = CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
186
+
187
+ const arr = new Array(poolPrices.prices.length);
188
+ poolPrices.prices.forEach((p, index) => {
189
+ if (p == 0n) {
190
+ arr[index] = 0;
191
+ } else {
192
+ arr[index] = gasCost;
193
+ }
194
+ });
195
+ return arr;
186
196
  }
187
197
 
188
198
  // Returns pool prices for amounts.
@@ -53,6 +53,21 @@ export const PancakeswapV3Config: DexConfigMap<DexParams> = {
53
53
  subgraphURL:
54
54
  'https://api.studio.thegraph.com/query/45376/exchange-v3-arbitrum/version/latest',
55
55
  },
56
+ [Network.BASE]: {
57
+ factory: '0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865',
58
+ deployer: '0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9',
59
+ quoter: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997',
60
+ router: '0x1b81D678ffb9C0263b24A97847620C99d213eB14',
61
+ supportedFees: PANCAKE_SUPPORTED_FEES,
62
+ stateMulticall: '0xeBF40A40CA3D4310Bf53048F48e860656e1D7C81',
63
+ uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
64
+ chunksCount: 10,
65
+ initRetryFrequency: 30,
66
+ initHash:
67
+ '0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2',
68
+ subgraphURL:
69
+ 'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest',
70
+ },
56
71
  },
57
72
  };
58
73
 
@@ -69,4 +84,8 @@ export const Adapters: Record<number, AdapterMappings> = {
69
84
  [SwapSide.SELL]: [{ name: 'ArbitrumAdapter01', index: 3 }],
70
85
  [SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 2 }],
71
86
  },
87
+ [Network.BASE]: {
88
+ [SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 1 }],
89
+ [SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 1 }],
90
+ },
72
91
  };
@@ -11,6 +11,99 @@ import { Network, ContractMethod, SwapSide } from '../../constants';
11
11
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
12
12
  import { generateConfig } from '../../config';
13
13
 
14
+ function testForNetwork(
15
+ network: Network,
16
+ dexKey: string,
17
+ tokenASymbol: string,
18
+ tokenBSymbol: string,
19
+ tokenAAmount: string,
20
+ tokenBAmount: string,
21
+ nativeTokenAmount: string,
22
+ slippage?: number | undefined,
23
+ ) {
24
+ const provider = new StaticJsonRpcProvider(
25
+ generateConfig(network).privateHttpProvider,
26
+ network,
27
+ );
28
+ const tokens = Tokens[network];
29
+ const holders = Holders[network];
30
+ const nativeTokenSymbol = NativeTokenSymbols[network];
31
+
32
+ const sideToContractMethods = new Map([
33
+ [
34
+ SwapSide.SELL,
35
+ [
36
+ ContractMethod.simpleSwap,
37
+ ContractMethod.multiSwap,
38
+ ContractMethod.megaSwap,
39
+ ],
40
+ ],
41
+ [SwapSide.BUY, [ContractMethod.simpleBuy, ContractMethod.buy]],
42
+ ]);
43
+
44
+ describe(`${network}`, () => {
45
+ sideToContractMethods.forEach((contractMethods, side) =>
46
+ describe(`${side}`, () => {
47
+ contractMethods.forEach((contractMethod: ContractMethod) => {
48
+ describe(`${contractMethod}`, () => {
49
+ it(`${nativeTokenSymbol} -> ${tokenASymbol}`, async () => {
50
+ await testE2E(
51
+ tokens[nativeTokenSymbol],
52
+ tokens[tokenASymbol],
53
+ holders[nativeTokenSymbol],
54
+ side === SwapSide.SELL ? nativeTokenAmount : tokenAAmount,
55
+ side,
56
+ dexKey,
57
+ contractMethod,
58
+ network,
59
+ provider,
60
+ undefined,
61
+ undefined,
62
+ undefined,
63
+ slippage,
64
+ );
65
+ });
66
+ it(`${tokenASymbol} -> ${nativeTokenSymbol}`, async () => {
67
+ await testE2E(
68
+ tokens[tokenASymbol],
69
+ tokens[nativeTokenSymbol],
70
+ holders[tokenASymbol],
71
+ side === SwapSide.SELL ? tokenAAmount : nativeTokenAmount,
72
+ side,
73
+ dexKey,
74
+ contractMethod,
75
+ network,
76
+ provider,
77
+ undefined,
78
+ undefined,
79
+ undefined,
80
+ slippage,
81
+ );
82
+ });
83
+ it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
84
+ await testE2E(
85
+ tokens[tokenASymbol],
86
+ tokens[tokenBSymbol],
87
+ holders[tokenASymbol],
88
+ side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
89
+ side,
90
+ dexKey,
91
+ contractMethod,
92
+ network,
93
+ provider,
94
+ undefined,
95
+ undefined,
96
+ undefined,
97
+ slippage,
98
+ );
99
+ });
100
+ });
101
+ });
102
+ }),
103
+ );
104
+ });
105
+ }
106
+
14
107
  describe('PancakeswapV3 E2E', () => {
15
108
  const dexKey = 'PancakeswapV3';
16
109
 
@@ -307,4 +400,25 @@ describe('PancakeswapV3 E2E', () => {
307
400
  }),
308
401
  );
309
402
  });
403
+
404
+ describe('PancakeswapV3 Base', () => {
405
+ const network = Network.BASE;
406
+
407
+ const tokenASymbol: string = 'USDbC';
408
+ const tokenBSymbol: string = 'DAI';
409
+
410
+ const tokenAAmount: string = '11111000000';
411
+ const tokenBAmount: string = '210000000000000000';
412
+ const nativeTokenAmount = '110000000000000000000';
413
+
414
+ testForNetwork(
415
+ network,
416
+ dexKey,
417
+ tokenASymbol,
418
+ tokenBSymbol,
419
+ tokenAAmount,
420
+ tokenBAmount,
421
+ nativeTokenAmount,
422
+ );
423
+ });
310
424
  });
@@ -0,0 +1,73 @@
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { DeepReadonly } from 'ts-essentials';
3
+ import FactoryABI from '../../abi/pancakeswap-v3/PancakeswapV3Factory.abi.json';
4
+ import { IDexHelper } from '../../dex-helper/idex-helper';
5
+ import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
6
+ import { Address, Log, Logger } from '../../types';
7
+ import { LogDescription } from 'ethers/lib/utils';
8
+ import { FactoryState } from '../uniswap-v3/types';
9
+
10
+ export type OnPoolCreatedCallback = ({
11
+ token0,
12
+ token1,
13
+ fee,
14
+ }: {
15
+ token0: string;
16
+ token1: string;
17
+ fee: bigint;
18
+ }) => Promise<void>;
19
+
20
+ /*
21
+ * "Stateless" event subscriber in order to capture "PoolCreated" event on new pools created.
22
+ * State is present, but it's a placeholder to actually make the events reach handlers (if there's no previous state - `processBlockLogs` is not called)
23
+ */
24
+ export class PancakeswapV3Factory extends StatefulEventSubscriber<FactoryState> {
25
+ handlers: {
26
+ [event: string]: (event: any) => Promise<void>;
27
+ } = {};
28
+
29
+ logDecoder: (log: Log) => any;
30
+
31
+ public readonly factoryIface = new Interface(FactoryABI);
32
+
33
+ constructor(
34
+ readonly dexHelper: IDexHelper,
35
+ parentName: string,
36
+ protected readonly factoryAddress: Address,
37
+ logger: Logger,
38
+ protected readonly onPoolCreated: OnPoolCreatedCallback,
39
+ mapKey: string = '',
40
+ ) {
41
+ super(parentName, `${parentName} Factory`, dexHelper, logger, true, mapKey);
42
+
43
+ this.addressesSubscribed = [factoryAddress];
44
+
45
+ this.logDecoder = (log: Log) => this.factoryIface.parseLog(log);
46
+
47
+ this.handlers['PoolCreated'] = this.handleNewPool.bind(this);
48
+ }
49
+
50
+ generateState(): FactoryState {
51
+ return {};
52
+ }
53
+
54
+ protected async processLog(
55
+ _: DeepReadonly<FactoryState>,
56
+ log: Readonly<Log>,
57
+ ): Promise<FactoryState> {
58
+ const event = this.logDecoder(log);
59
+ if (event.name in this.handlers) {
60
+ await this.handlers[event.name](event);
61
+ }
62
+
63
+ return {};
64
+ }
65
+
66
+ async handleNewPool(event: LogDescription) {
67
+ const token0 = event.args.token0.toLowerCase();
68
+ const token1 = event.args.token1.toLowerCase();
69
+ const fee = event.args.fee;
70
+
71
+ await this.onPoolCreated({ token0, token1, fee });
72
+ }
73
+ }
@@ -56,6 +56,10 @@ import {
56
56
  DEFAULT_ID_ERC20,
57
57
  DEFAULT_ID_ERC20_AS_STRING,
58
58
  } from '../../lib/tokens/types';
59
+ import {
60
+ OnPoolCreatedCallback,
61
+ PancakeswapV3Factory,
62
+ } from './pancakeswap-v3-factory';
59
63
 
60
64
  type PoolPairsInfo = {
61
65
  token0: Address;
@@ -63,14 +67,15 @@ type PoolPairsInfo = {
63
67
  fee: string;
64
68
  };
65
69
 
66
- const PANCAKESWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS = 60 * 60 * 24 * 1000; // 24 hours
67
- const PANCAKESWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 30 * 60 * 1000; // Once in 30 minutes
70
+ const PANCAKESWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS = 3 * 24 * 60 * 60 * 1000; // 3 days
71
+ const PANCAKESWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 24 * 60 * 60 * 1000; // Once in a day
68
72
  const PANCAKESWAPV3_QUOTE_GASLIMIT = 200_000;
69
73
 
70
74
  export class PancakeswapV3
71
75
  extends SimpleExchange
72
76
  implements IDex<UniswapV3Data>
73
77
  {
78
+ private readonly factory: PancakeswapV3Factory;
74
79
  readonly isFeeOnTransferSupported: boolean = false;
75
80
  readonly eventPools: Record<string, PancakeSwapV3EventPool | null> = {};
76
81
 
@@ -117,6 +122,14 @@ export class PancakeswapV3
117
122
 
118
123
  this.notExistingPoolSetKey =
119
124
  `${CACHE_PREFIX}_${network}_${dexKey}_not_existings_pool_set`.toLowerCase();
125
+
126
+ this.factory = new PancakeswapV3Factory(
127
+ dexHelper,
128
+ dexKey,
129
+ this.config.factory,
130
+ this.logger,
131
+ this.onPoolCreatedDeleteFromNonExistingSet,
132
+ );
120
133
  }
121
134
 
122
135
  get supportedFees() {
@@ -133,6 +146,9 @@ export class PancakeswapV3
133
146
  }
134
147
 
135
148
  async initializePricing(blockNumber: number) {
149
+ // Init listening to new pools creation
150
+ await this.factory.initialize(blockNumber);
151
+
136
152
  if (!this.dexHelper.config.isSlave) {
137
153
  const cleanExpiredNotExistingPoolsKeys = async () => {
138
154
  const maxTimestamp =
@@ -151,6 +167,38 @@ export class PancakeswapV3
151
167
  }
152
168
  }
153
169
 
170
+ /*
171
+ * When a non existing pool is queried, it's blacklisted for an arbitrary long period in order to prevent issuing too many rpc calls
172
+ * Once the pool is created, it gets immediately flagged
173
+ */
174
+ onPoolCreatedDeleteFromNonExistingSet: OnPoolCreatedCallback = async ({
175
+ token0,
176
+ token1,
177
+ fee,
178
+ }) => {
179
+ const logPrefix = '[PancakeV3.onPoolCreatedDeleteFromNonExistingSet]';
180
+ const [_token0, _token1] = this._sortTokens(token0, token1);
181
+ const poolKey = `${_token0}_${_token1}_${fee}`;
182
+
183
+ // consider doing it only from master pool for less calls to distant cache
184
+
185
+ // delete entry locally to let local instance discover the pool
186
+ delete this.eventPools[this.getPoolIdentifier(_token0, _token1, fee)];
187
+
188
+ try {
189
+ this.logger.info(
190
+ `${logPrefix} delete pool from not existing set: ${poolKey}`,
191
+ );
192
+ // delete pool record from set
193
+ await this.dexHelper.cache.zrem(this.notExistingPoolSetKey, [poolKey]);
194
+ } catch (error) {
195
+ this.logger.error(
196
+ `${logPrefix} failed to delete pool from set :${poolKey}`,
197
+ error,
198
+ );
199
+ }
200
+ };
201
+
154
202
  async getPool(
155
203
  srcAddress: Address,
156
204
  destAddress: Address,
@@ -0,0 +1,31 @@
1
+ import { DexParams } from './types';
2
+ import { DexConfigMap } from '../../types';
3
+ import { Network, SwapSide } from '../../constants';
4
+
5
+ export const QuickPerpsConfig: DexConfigMap<DexParams> = {
6
+ QuickPerps: {
7
+ [Network.ZKEVM]: {
8
+ vault: '0x99B31498B0a1Dae01fc3433e3Cb60F095340935C',
9
+ reader: '0xf1CFB75854DE535475B88Bb6FBad317eea98c0F9',
10
+ priceFeed: '0x5b1F500134bdD7f4359F5B2adC65f839737290f4',
11
+ fastPriceFeed: '0x73903fEc691a80Ec47bc830bf3F0baD127A06e30',
12
+ fastPriceEvents: '0x08bC8ef0b71238055f9Ee6BBc90869D8d0DBdCCa',
13
+ usdq: '0x48aC594dd00c4aAcF40f83337fc6dA31F9F439A7',
14
+ },
15
+ },
16
+ };
17
+
18
+ export const Adapters: {
19
+ [chainId: number]: {
20
+ [side: string]: { name: string; index: number }[] | null;
21
+ };
22
+ } = {
23
+ [Network.ZKEVM]: {
24
+ [SwapSide.SELL]: [
25
+ {
26
+ name: 'PolygonZkEvmAdapter01',
27
+ index: 2,
28
+ },
29
+ ],
30
+ },
31
+ };