@paraswap/dex-lib 3.7.0 → 3.7.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 (304) hide show
  1. package/build/abi/Uncompressor.json +250 -0
  2. package/build/dex/aave-v1/aave-v1.d.ts +1 -2
  3. package/build/dex/aave-v1/aave-v1.js +0 -23
  4. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  5. package/build/dex/balancer-v2/balancer-v2.js +41 -19
  6. package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
  7. package/build/dex/compound.js +1 -1
  8. package/build/dex/compound.js.map +1 -1
  9. package/build/dex/etherfi/etherfi.d.ts +26 -0
  10. package/build/dex/etherfi/etherfi.js +96 -0
  11. package/build/dex/etherfi/etherfi.js.map +1 -0
  12. package/build/dex/platypus/platypus.d.ts +1 -2
  13. package/build/dex/platypus/platypus.js +0 -45
  14. package/build/dex/platypus/platypus.js.map +1 -1
  15. package/build/dex/sdai/config.d.ts +11 -0
  16. package/build/dex/sdai/config.js +21 -0
  17. package/build/dex/sdai/config.js.map +1 -0
  18. package/build/dex/sdai/constants.d.ts +2 -0
  19. package/build/dex/sdai/constants.js +6 -0
  20. package/build/dex/sdai/constants.js.map +1 -0
  21. package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
  22. package/build/dex/sdai/scripts/validate-state.js +102 -0
  23. package/build/dex/sdai/scripts/validate-state.js.map +1 -0
  24. package/build/dex/sdai/sdai-pool.d.ts +16 -0
  25. package/build/dex/sdai/sdai-pool.js +85 -0
  26. package/build/dex/sdai/sdai-pool.js.map +1 -0
  27. package/build/dex/sdai/sdai.d.ts +51 -0
  28. package/build/dex/sdai/sdai.js +172 -0
  29. package/build/dex/sdai/sdai.js.map +1 -0
  30. package/build/dex/sdai/types.d.ts +21 -0
  31. package/build/dex/sdai/types.js +11 -0
  32. package/build/dex/sdai/types.js.map +1 -0
  33. package/build/dex/sdai/utils.d.ts +4 -0
  34. package/build/dex/sdai/utils.js +39 -0
  35. package/build/dex/sdai/utils.js.map +1 -0
  36. package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
  37. package/build/dex/swaap-v1/swaap-v1.js +0 -14
  38. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  39. package/build/executor/compressor/Compressor.d.ts +23 -0
  40. package/build/executor/compressor/Compressor.js +144 -0
  41. package/build/executor/compressor/Compressor.js.map +1 -0
  42. package/build/executor/compressor/compress.d.ts +17 -0
  43. package/build/executor/compressor/compress.js +187 -0
  44. package/build/executor/compressor/compress.js.map +1 -0
  45. package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
  46. package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
  47. package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
  48. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
  49. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
  50. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
  51. package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
  52. package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
  53. package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
  54. package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
  55. package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
  56. package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
  57. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
  58. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
  59. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
  60. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
  61. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
  62. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
  63. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
  64. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
  65. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
  66. package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
  67. package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
  68. package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
  69. package/build/executor/compressor/fetchSaved.d.ts +0 -0
  70. package/build/executor/compressor/fetchSaved.js +17 -0
  71. package/build/executor/compressor/fetchSaved.js.map +1 -0
  72. package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
  73. package/build/executor/compressor/utils/computeCostL2.js +14 -0
  74. package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
  75. package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
  76. package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
  77. package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
  78. package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
  79. package/build/executor/compressor/utils/getAllIndexes.js +12 -0
  80. package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
  81. package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
  82. package/build/executor/compressor/utils/getByteForAddress.js +14 -0
  83. package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
  84. package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
  85. package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
  86. package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
  87. package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
  88. package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
  89. package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
  90. package/build/executor/compressor/utils/intToByte.d.ts +2 -0
  91. package/build/executor/compressor/utils/intToByte.js +10 -0
  92. package/build/executor/compressor/utils/intToByte.js.map +1 -0
  93. package/package.json +1 -1
  94. package/src/dex/balancer-v2/balancer-v2.ts +41 -19
  95. package/tests/utils-e2e.ts +114 -116
  96. package/.idea/aws.xml +0 -17
  97. package/.idea/codeStyles/Project.xml +0 -19
  98. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  99. package/.idea/misc.xml +0 -6
  100. package/.idea/modules.xml +0 -8
  101. package/.idea/paraswap-dex-lib.iml +0 -9
  102. package/.idea/prettier.xml +0 -7
  103. package/.idea/vcs.xml +0 -6
  104. package/build/abi/AugustusV6.abi.json +0 -395
  105. package/build/abi/algebra/AlgebraPool.abi.json +0 -727
  106. package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
  107. package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
  108. package/build/abi/integral/relayer.json +0 -1148
  109. package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
  110. package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
  111. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  112. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +0 -285
  113. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +0 -583
  114. package/build/abi/wBETH.json +0 -1527
  115. package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
  116. package/build/abi/woo-fi/WooPP.abi.json +0 -548
  117. package/build/abi/woo-fi/Wooracle.abi.json +0 -260
  118. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  119. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  120. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  121. package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
  122. package/build/dex/aave-v3/tokens/avalanche.json +0 -74
  123. package/build/dex/aave-v3/tokens/fantom.json +0 -62
  124. package/build/dex/aave-v3/tokens/optimism.json +0 -50
  125. package/build/dex/aave-v3/tokens/polygon.json +0 -116
  126. package/build/dex/algebra/algebra-pool.d.ts +0 -114
  127. package/build/dex/algebra/algebra-pool.js +0 -448
  128. package/build/dex/algebra/algebra-pool.js.map +0 -1
  129. package/build/dex/balancer-v2/Gyro3Pool.d.ts +0 -43
  130. package/build/dex/balancer-v2/Gyro3Pool.js +0 -160
  131. package/build/dex/balancer-v2/Gyro3Pool.js.map +0 -1
  132. package/build/dex/balancer-v2/LinearMath.d.ts +0 -88
  133. package/build/dex/balancer-v2/LinearMath.js +0 -285
  134. package/build/dex/balancer-v2/LinearMath.js.map +0 -1
  135. package/build/dex/balancer-v2/LinearPool.d.ts +0 -81
  136. package/build/dex/balancer-v2/LinearPool.js +0 -444
  137. package/build/dex/balancer-v2/LinearPool.js.map +0 -1
  138. package/build/dex/balancer-v2/PhantomStablePool.d.ts +0 -90
  139. package/build/dex/balancer-v2/PhantomStablePool.js +0 -418
  140. package/build/dex/balancer-v2/PhantomStablePool.js.map +0 -1
  141. package/build/dex/balancer-v2/StableMath.d.ts +0 -9
  142. package/build/dex/balancer-v2/StableMath.js +0 -272
  143. package/build/dex/balancer-v2/StableMath.js.map +0 -1
  144. package/build/dex/balancer-v2/balancer-v2-pool.d.ts +0 -140
  145. package/build/dex/balancer-v2/balancer-v2-pool.js +0 -647
  146. package/build/dex/balancer-v2/balancer-v2-pool.js.map +0 -1
  147. package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
  148. package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
  149. package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
  150. package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
  151. package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
  152. package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
  153. package/build/dex/integral/config.d.ts +0 -4
  154. package/build/dex/integral/config.js +0 -18
  155. package/build/dex/integral/config.js.map +0 -1
  156. package/build/dex/integral/integral-pool.d.ts +0 -39
  157. package/build/dex/integral/integral-pool.js +0 -67
  158. package/build/dex/integral/integral-pool.js.map +0 -1
  159. package/build/dex/integral/integral.d.ts +0 -48
  160. package/build/dex/integral/integral.js +0 -402
  161. package/build/dex/integral/integral.js.map +0 -1
  162. package/build/dex/integral/types.d.ts +0 -25
  163. package/build/dex/integral/types.js +0 -9
  164. package/build/dex/integral/types.js.map +0 -1
  165. package/build/dex/lighter-v1/abi/erc20.json +0 -222
  166. package/build/dex/lighter-v1/abi/factory.json +0 -291
  167. package/build/dex/lighter-v1/abi/order_book.json +0 -594
  168. package/build/dex/lighter-v1/abi/order_book_helper.json +0 -176
  169. package/build/dex/lighter-v1/abi/router.json +0 -488
  170. package/build/dex/lighter-v1/config.d.ts +0 -4
  171. package/build/dex/lighter-v1/config.js +0 -17
  172. package/build/dex/lighter-v1/config.js.map +0 -1
  173. package/build/dex/lighter-v1/constants.d.ts +0 -2
  174. package/build/dex/lighter-v1/constants.js +0 -13
  175. package/build/dex/lighter-v1/constants.js.map +0 -1
  176. package/build/dex/lighter-v1/lighter-v1-pool.d.ts +0 -57
  177. package/build/dex/lighter-v1/lighter-v1-pool.js +0 -310
  178. package/build/dex/lighter-v1/lighter-v1-pool.js.map +0 -1
  179. package/build/dex/lighter-v1/lighter-v1.d.ts +0 -45
  180. package/build/dex/lighter-v1/lighter-v1.js +0 -331
  181. package/build/dex/lighter-v1/lighter-v1.js.map +0 -1
  182. package/build/dex/lighter-v1/types.d.ts +0 -40
  183. package/build/dex/lighter-v1/types.js +0 -3
  184. package/build/dex/lighter-v1/types.js.map +0 -1
  185. package/build/dex/pancakeswap-v3/types.d.ts +0 -14
  186. package/build/dex/pancakeswap-v3/types.js +0 -3
  187. package/build/dex/pancakeswap-v3/types.js.map +0 -1
  188. package/build/dex/quickswap/camelot-v3.d.ts +0 -6
  189. package/build/dex/quickswap/camelot-v3.js +0 -19
  190. package/build/dex/quickswap/camelot-v3.js.map +0 -1
  191. package/build/dex/quickswap/zyberswap-v3.d.ts +0 -6
  192. package/build/dex/quickswap/zyberswap-v3.js +0 -19
  193. package/build/dex/quickswap/zyberswap-v3.js.map +0 -1
  194. package/build/dex/quickswap-v3.d.ts +0 -21
  195. package/build/dex/quickswap-v3.js +0 -40
  196. package/build/dex/quickswap-v3.js.map +0 -1
  197. package/build/dex/ramses-v2/config.d.ts +0 -4
  198. package/build/dex/ramses-v2/config.js +0 -28
  199. package/build/dex/ramses-v2/config.js.map +0 -1
  200. package/build/dex/ramses-v2/constants.d.ts +0 -28
  201. package/build/dex/ramses-v2/constants.js +0 -35
  202. package/build/dex/ramses-v2/constants.js.map +0 -1
  203. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
  204. package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
  205. package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
  206. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
  207. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
  208. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
  209. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
  210. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
  211. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
  212. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
  213. package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
  214. package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
  215. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
  216. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
  217. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
  218. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
  219. package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
  220. package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
  221. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
  222. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
  223. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
  224. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
  225. package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
  226. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
  227. package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
  228. package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
  229. package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
  230. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
  231. package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
  232. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
  233. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
  234. package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
  235. package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
  236. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
  237. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
  238. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
  239. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
  240. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
  241. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
  242. package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
  243. package/build/dex/ramses-v2/contract-math/utils.js +0 -16
  244. package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
  245. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
  246. package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
  247. package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
  248. package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
  249. package/build/dex/ramses-v2/ramses-v2.js +0 -690
  250. package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
  251. package/build/dex/ramses-v2/types.d.ts +0 -154
  252. package/build/dex/ramses-v2/types.js +0 -9
  253. package/build/dex/ramses-v2/types.js.map +0 -1
  254. package/build/dex/ramses-v2/utils.d.ts +0 -6
  255. package/build/dex/ramses-v2/utils.js +0 -71
  256. package/build/dex/ramses-v2/utils.js.map +0 -1
  257. package/build/dex/solidly/forks-override/fvm.d.ts +0 -20
  258. package/build/dex/solidly/forks-override/fvm.js +0 -42
  259. package/build/dex/solidly/forks-override/fvm.js.map +0 -1
  260. package/build/dex/sushiswap-v3/config.d.ts +0 -4
  261. package/build/dex/sushiswap-v3/config.js +0 -132
  262. package/build/dex/sushiswap-v3/config.js.map +0 -1
  263. package/build/dex/sushiswap-v3/constants.d.ts +0 -4
  264. package/build/dex/sushiswap-v3/constants.js +0 -32
  265. package/build/dex/sushiswap-v3/constants.js.map +0 -1
  266. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
  267. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
  268. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
  269. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
  270. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
  271. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
  272. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
  273. package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
  274. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
  275. package/build/dex/sushiswap-v3/token.d.ts +0 -6
  276. package/build/dex/sushiswap-v3/token.js +0 -23
  277. package/build/dex/sushiswap-v3/token.js.map +0 -1
  278. package/build/dex/sushiswap-v3/types.d.ts +0 -15
  279. package/build/dex/sushiswap-v3/types.js +0 -18
  280. package/build/dex/sushiswap-v3/types.js.map +0 -1
  281. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +0 -12
  282. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +0 -23
  283. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +0 -1
  284. package/build/dex/woo-fi/config.d.ts +0 -4
  285. package/build/dex/woo-fi/config.js +0 -141
  286. package/build/dex/woo-fi/config.js.map +0 -1
  287. package/build/dex/woo-fi/constants.d.ts +0 -5
  288. package/build/dex/woo-fi/constants.js +0 -20
  289. package/build/dex/woo-fi/constants.js.map +0 -1
  290. package/build/dex/woo-fi/types.d.ts +0 -48
  291. package/build/dex/woo-fi/types.js +0 -3
  292. package/build/dex/woo-fi/types.js.map +0 -1
  293. package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
  294. package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
  295. package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
  296. package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
  297. package/build/dex/woo-fi/woo-fi-math.js +0 -300
  298. package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
  299. package/build/dex/woo-fi/woo-fi.d.ts +0 -65
  300. package/build/dex/woo-fi/woo-fi.js +0 -480
  301. package/build/dex/woo-fi/woo-fi.js.map +0 -1
  302. package/build/executor/IExecutorBytecodeBuilder.d.ts +0 -6
  303. package/build/executor/IExecutorBytecodeBuilder.js +0 -3
  304. package/build/executor/IExecutorBytecodeBuilder.js.map +0 -1
@@ -1,21 +0,0 @@
1
- import { UniswapV3 } from '../uniswap-v3/uniswap-v3';
2
- import { Network } from '../../constants';
3
- import { IDexHelper } from '../../dex-helper';
4
- import { Interface } from '@ethersproject/abi';
5
- import { SimpleExchangeParam } from '../../types';
6
- import { UniswapV3Data } from '../uniswap-v3/types';
7
- export declare class SushiswapV3 extends UniswapV3 {
8
- protected network: Network;
9
- protected dexHelper: IDexHelper;
10
- protected adapters: import("../../types").AdapterMappings;
11
- readonly routerIface: Interface;
12
- readonly quoterIface: Interface;
13
- protected config: import("../uniswap-v3/types").DexParams;
14
- protected poolsToPreload: never[];
15
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: import("../../types").AdapterMappings, routerIface?: Interface, quoterIface?: Interface, config?: import("../uniswap-v3/types").DexParams, poolsToPreload?: never[]);
16
- static dexKeysWithNetwork: {
17
- key: string;
18
- networks: Network[];
19
- }[];
20
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data): Promise<SimpleExchangeParam>;
21
- }
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SushiswapV3 = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const viem_1 = require("viem");
9
- const router_1 = require("@sushiswap/router");
10
- const config_1 = require("./config");
11
- const uniswap_v3_1 = require("../uniswap-v3/uniswap-v3");
12
- const utils_1 = require("../../utils");
13
- const RouterProcessor3_json_1 = __importDefault(require("../../abi/sushiswap-v3/RouterProcessor3.json"));
14
- const QuoterV2_json_1 = __importDefault(require("../../abi/sushiswap-v3/QuoterV2.json"));
15
- const abi_1 = require("@ethersproject/abi");
16
- const config_2 = require("../../config");
17
- const ethers_1 = require("ethers");
18
- class SushiswapV3 extends uniswap_v3_1.UniswapV3 {
19
- constructor(network, dexKey, dexHelper, adapters = config_1.Adapters[network] || {}, routerIface = new abi_1.Interface(RouterProcessor3_json_1.default), quoterIface = new abi_1.Interface(QuoterV2_json_1.default), config = config_1.SushiSwapV3Config[dexKey][network], poolsToPreload = []) {
20
- super(network, dexKey, dexHelper, adapters, routerIface, quoterIface, config, poolsToPreload);
21
- this.network = network;
22
- this.dexHelper = dexHelper;
23
- this.adapters = adapters;
24
- this.routerIface = routerIface;
25
- this.quoterIface = quoterIface;
26
- this.config = config;
27
- this.poolsToPreload = poolsToPreload;
28
- }
29
- // Encode call data used by simpleSwap like routers
30
- // Used for simpleSwap & simpleBuy
31
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data) {
32
- const web3Client = (0, viem_1.createPublicClient)({
33
- chain: ViemChain[this.network],
34
- transport: (0, viem_1.http)((0, config_2.generateConfig)(this.network).privateHttpProvider),
35
- });
36
- const dataFetcher = new router_1.DataFetcher(web3Client.chain.id, web3Client);
37
- dataFetcher.startDataFetching([router_1.LiquidityProviders.SushiSwapV3]);
38
- const fromToken = await getToken({ web3Client, address: srcToken });
39
- const toToken = await getToken({ web3Client, address: destToken });
40
- await dataFetcher.fetchPoolsForToken(fromToken, toToken);
41
- const pcMap = dataFetcher.getCurrentPoolCodeMap(fromToken, toToken);
42
- const route = router_1.Router.findBestRoute(pcMap, this.network, fromToken, ethers_1.BigNumber.from(srcAmount), toToken, 50e9, [router_1.LiquidityProviders.SushiSwapV3]);
43
- const rpParams = router_1.Router.routeProcessor2Params(pcMap, route, fromToken, toToken, this.augustusAddress, this.config.router);
44
- const swapData = this.routerIface.encodeFunctionData('processRoute', [
45
- rpParams.tokenIn,
46
- rpParams.amountIn,
47
- rpParams.tokenOut,
48
- rpParams.amountOutMin,
49
- rpParams.to,
50
- rpParams.routeCode,
51
- ]);
52
- dataFetcher.stopDataFetching();
53
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.config.router);
54
- }
55
- }
56
- exports.SushiswapV3 = SushiswapV3;
57
- SushiswapV3.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(lodash_1.default.pick(config_1.SushiSwapV3Config, ['SushiSwapV3']));
58
- //# sourceMappingURL=sushiswap-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sushiswap-v3.js","sourceRoot":"","sources":["../../../src/dex/sushiswap-v3/sushiswap-v3.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,+BAAgD;AAChD,8CAA4E;AAC5E,qCAAuD;AACvD,yDAAqD;AAErD,uCAAoD;AACpD,yGAAgF;AAChF,yFAA0E;AAE1E,4CAA+C;AAE/C,yC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AC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { PublicClient, Transport, Chain } from 'viem';
2
- import { Token } from '@sushiswap/currency';
3
- export declare function getToken({ web3Client, address, }: {
4
- web3Client: PublicClient<Transport, Chain>;
5
- address: string;
6
- }): Promise<Token>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getToken = void 0;
7
- const currency_1 = require("@sushiswap/currency");
8
- const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
9
- async function getToken({ web3Client, address, }) {
10
- const decimals = (await web3Client.readContract({
11
- address: address,
12
- abi: erc20_json_1.default,
13
- functionName: 'decimals',
14
- args: [],
15
- }));
16
- return new currency_1.Token({
17
- address,
18
- chainId: web3Client.chain.id,
19
- decimals,
20
- });
21
- }
22
- exports.getToken = getToken;
23
- //# sourceMappingURL=token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/dex/sushiswap-v3/token.ts"],"names":[],"mappings":";;;;;;AACA,kDAA4C;AAE5C,sEAA4C;AAErC,KAAK,UAAU,QAAQ,CAAC,EAC7B,UAAU,EACV,OAAO,GAIR;IACC,MAAM,QAAQ,GAAW,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC;QACtD,OAAO,EAAE,OAAkB;QAC3B,GAAG,EAAE,oBAAQ;QACb,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,EAAE;KACT,CAAC,CAAsB,CAAC;IAEzB,OAAO,IAAI,gBAAK,CAAC;QACf,OAAO;QACP,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE;QAC5B,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAnBD,4BAmBC"}
@@ -1,15 +0,0 @@
1
- export * from '../uniswap-v3/types';
2
- export declare type QuoteExactInputSingleParams = {
3
- tokenIn: string;
4
- tokenOut: string;
5
- amountIn: bigint;
6
- fee: bigint;
7
- sqrtPriceLimitX96: bigint;
8
- };
9
- export declare type QuoteExactOutputSingleParams = {
10
- tokenIn: string;
11
- tokenOut: string;
12
- amount: bigint;
13
- fee: bigint;
14
- sqrtPriceLimitX96: bigint;
15
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("../uniswap-v3/types"), exports);
18
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/sushiswap-v3/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
@@ -1,12 +0,0 @@
1
- import { UniswapV3 } from '../../uniswap-v3';
2
- import { Network } from '../../../../constants';
3
- import { IDexHelper } from '../../../../dex-helper';
4
- export declare class PancakeswapV3 extends UniswapV3 {
5
- protected network: Network;
6
- protected dexHelper: IDexHelper;
7
- static dexKeysWithNetwork: {
8
- key: string;
9
- networks: Network[];
10
- }[];
11
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
12
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PancakeswapV3 = void 0;
7
- const uniswap_v3_1 = require("../../uniswap-v3");
8
- const abi_1 = require("@ethersproject/abi");
9
- const PancakeswapV3Router_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json"));
10
- const PancakeswapV3QuoterV2_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json"));
11
- const utils_1 = require("../../../../utils");
12
- const lodash_1 = __importDefault(require("lodash"));
13
- const config_1 = require("../../config");
14
- class PancakeswapV3 extends uniswap_v3_1.UniswapV3 {
15
- constructor(network, dexKey, dexHelper) {
16
- super(network, dexKey, dexHelper, undefined, new abi_1.Interface(PancakeswapV3Router_abi_json_1.default), new abi_1.Interface(PancakeswapV3QuoterV2_abi_json_1.default));
17
- this.network = network;
18
- this.dexHelper = dexHelper;
19
- }
20
- }
21
- exports.PancakeswapV3 = PancakeswapV3;
22
- PancakeswapV3.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(lodash_1.default.pick(config_1.UniswapV3Config, ['PancakeswapV3']));
23
- //# sourceMappingURL=pancakeswap-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pancakeswap-v3.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA6C;AAG7C,4CAA+C;AAC/C,0IAA4G;AAC5G,8IAAgH;AAChH,6CAA0D;AAC1D,oDAAuB;AACvB,yCAA+C;AAE/C,MAAa,aAAc,SAAQ,sBAAS;IAG1C,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB;QAE/B,KAAK,CACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,EACT,IAAI,eAAS,CAAC,sCAAsB,CAAC,EACrC,IAAI,eAAS,CAAC,wCAAwB,CAAC,CACxC,CAAC;QAXQ,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;IAUjC,CAAC;;AAhBH,sCAiBC;AAhBe,gCAAkB,GAC9B,IAAA,6BAAqB,EAAC,gBAAC,CAAC,IAAI,CAAC,wBAAe,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap, AdapterMappings } from '../../types';
3
- export declare const WooFiConfig: DexConfigMap<DexParams>;
4
- export declare const Adapters: Record<number, AdapterMappings>;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Adapters = exports.WooFiConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.WooFiConfig = {
6
- WooFi: {
7
- [constants_1.Network.BSC]: {
8
- wooPPAddress: '0xbf365Ce9cFcb2d5855521985E351bA3bcf77FD3F',
9
- wooOracleAddress: '0x6b6fBEc7934b104e81b2046D24A990e03e17afDC',
10
- wooFeeManagerAddress: '0xaA6c60D638d34261B764fEDB551E50Ab02c34C90',
11
- wooGuardianAddress: '0x910723e3c6a68276687b50613a1a9e42cc6589b4',
12
- quoteToken: {
13
- // USDT
14
- address: '0x55d398326f99059ff775485246999027b3197955',
15
- decimals: 18,
16
- },
17
- baseTokens: {
18
- WBNB: {
19
- address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
20
- decimals: 18,
21
- },
22
- BTCB: {
23
- address: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c',
24
- decimals: 18,
25
- },
26
- ETH: {
27
- address: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
28
- decimals: 18,
29
- },
30
- WOO: {
31
- address: '0x4691937a7508860f876c9c0a2a617e7d9e945d4b',
32
- decimals: 18,
33
- },
34
- },
35
- rebateTo: '0xcbb65ad3e64f404b5411486e15561bfb645ce642',
36
- },
37
- [constants_1.Network.AVALANCHE]: {
38
- wooPPAddress: '0x1df3009c57a8B143c6246149F00B090Bce3b8f88',
39
- wooOracleAddress: '0x25a4d4a094A084c7ad45Ac273cF7D6B6bfae7D4E',
40
- wooFeeManagerAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
41
- wooGuardianAddress: '0x58c73f7e102bc6bcdc6b092ef0399b3e06d6b3e3',
42
- quoteToken: {
43
- // USDC
44
- address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
45
- decimals: 6,
46
- },
47
- baseTokens: {
48
- WAVAX: {
49
- address: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',
50
- decimals: 18,
51
- },
52
- ['BTC.b']: {
53
- address: '0x152b9d0FdC40C096757F570A51E494bd4b943E50',
54
- decimals: 8,
55
- },
56
- ['WETH.e']: {
57
- address: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB',
58
- decimals: 18,
59
- },
60
- ['WOO.e']: {
61
- address: '0xaBC9547B534519fF73921b1FBA6E672b5f58D083',
62
- decimals: 18,
63
- },
64
- },
65
- rebateTo: '0x1bf4c97384e7bdc609017305edb23fd28c13e76a',
66
- },
67
- [constants_1.Network.FANTOM]: {
68
- wooPPAddress: '0x9503E7517D3C5bc4f9E4A1c6AE4f8B33AC2546f2',
69
- wooOracleAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
70
- wooFeeManagerAddress: '0xBE1a0FccCFA9c9065152B7770B918f7C59914E8D',
71
- wooGuardianAddress: '0x128758d0e909624841AB29D53919646BFBDa5dB2',
72
- quoteToken: {
73
- // USDC
74
- address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
75
- decimals: 6,
76
- },
77
- baseTokens: {
78
- WFTM: {
79
- address: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83',
80
- decimals: 18,
81
- },
82
- BTC: {
83
- address: '0x321162Cd933E2Be498Cd2267a90534A804051b11',
84
- decimals: 8,
85
- },
86
- ETH: {
87
- address: '0x74b23882a30290451A17c44f4F05243b6b58C76d',
88
- decimals: 18,
89
- },
90
- WOO: {
91
- address: '0x6626c47c00F1D87902fc13EECfaC3ed06D5E8D8a',
92
- decimals: 18,
93
- },
94
- },
95
- rebateTo: '0xced122f9b99d224675eeda13f0c14639c5633f91',
96
- },
97
- [constants_1.Network.POLYGON]: {
98
- wooPPAddress: '0x7400B665C8f4f3a951a99f1ee9872efb8778723d',
99
- wooOracleAddress: '0x2Fe5E5D341cFFa606a5d9DA1B6B646a381B0f7ec',
100
- wooFeeManagerAddress: '0x7214833BE05Ce39f6dCd97668e521162e6C18937',
101
- wooGuardianAddress: '0xF5d215d9C84778F85746D15762DaF39B9E83a2d6',
102
- quoteToken: {
103
- // USDC
104
- address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
105
- decimals: 6,
106
- },
107
- baseTokens: {
108
- WMATIC: {
109
- address: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
110
- decimals: 18,
111
- },
112
- WBTC: {
113
- address: '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6',
114
- decimals: 8,
115
- },
116
- WETH: {
117
- address: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
118
- decimals: 18,
119
- },
120
- WOO: {
121
- address: '0x1B815d120B3eF02039Ee11dC2d33DE7aA4a8C603',
122
- decimals: 18,
123
- },
124
- },
125
- rebateTo: '0x0c84cd406b8a4e07df9a1b15ef348023a1dcd075',
126
- },
127
- },
128
- };
129
- exports.Adapters = {
130
- [constants_1.Network.BSC]: { [constants_1.SwapSide.SELL]: [{ name: 'BscAdapter01', index: 13 }] },
131
- [constants_1.Network.AVALANCHE]: {
132
- [constants_1.SwapSide.SELL]: [{ name: 'AvalancheAdapter01', index: 12 }],
133
- },
134
- [constants_1.Network.FANTOM]: {
135
- [constants_1.SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 8 }],
136
- },
137
- [constants_1.Network.POLYGON]: {
138
- [constants_1.SwapSide.SELL]: [{ name: 'PolygonAdapter02', index: 4 }],
139
- },
140
- };
141
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,WAAW,GAA4B;IAClD,KAAK,EAAE;QACL,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE;YACb,YAAY,EAAE,4CAA4C;YAC1D,gBAAgB,EAAE,4CAA4C;YAC9D,oBAAoB,EAAE,4CAA4C;YAClE,kBAAkB,EAAE,4CAA4C;YAChE,UAAU,EAAE;gBACV,OAAO;gBACP,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,EAAE;aACb;YACD,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,QAAQ,EAAE,4CAA4C;SACvD;QACD,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE;YACnB,YAAY,EAAE,4CAA4C;YAC1D,gBAAgB,EAAE,4CAA4C;YAC9D,oBAAoB,EAAE,4CAA4C;YAClE,kBAAkB,EAAE,4CAA4C;YAChE,UAAU,EAAE;gBACV,OAAO;gBACP,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,CAAC;aACZ;YACD,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,CAAC,OAAO,CAAC,EAAE;oBACT,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,CAAC;iBACZ;gBAC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AAC;iBACZ;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,QAAQ,EAAE,4CAA4C;SACvD;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE;IACzE,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE;QACnB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;KAC7D;IACD,CAAC,mBAAO,CAAC,MAAM,CAAC,EAAE;QAChB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KACzD;IACD,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;QACjB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC1D;CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- import { PoolState } from './types';
2
- export declare const WOO_FI_GAS_COST: number;
3
- export declare const USD_PRECISION = 2;
4
- export declare const MIN_CONVERSION_RATE = 1;
5
- export declare const NULL_STATE: PoolState;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NULL_STATE = exports.MIN_CONVERSION_RATE = exports.USD_PRECISION = exports.WOO_FI_GAS_COST = void 0;
4
- exports.WOO_FI_GAS_COST = 270 * 1000;
5
- exports.USD_PRECISION = 2;
6
- exports.MIN_CONVERSION_RATE = 1;
7
- exports.NULL_STATE = {
8
- feeRates: {},
9
- tokenInfos: {},
10
- tokenStates: {},
11
- oracleTimestamp: 0n,
12
- isPaused: false,
13
- guardian: {
14
- globalBound: 0n,
15
- refInfos: {},
16
- },
17
- chainlink: { latestRoundDatas: {} },
18
- wooPPBalances: {},
19
- };
20
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7B,QAAA,aAAa,GAAG,CAAC,CAAC;AAElB,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAExB,QAAA,UAAU,GAAc;IACnC,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,eAAe,EAAE,EAAE;IACnB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,EAAE;KACb;IACD,SAAS,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;IACnC,aAAa,EAAE,EAAE;CAClB,CAAC"}
@@ -1,48 +0,0 @@
1
- import { Address, Token } from '../../types';
2
- export declare type TokenInfo = {
3
- reserve: bigint;
4
- R: bigint;
5
- threshold: bigint;
6
- target: bigint;
7
- lastResetTimestamp: bigint;
8
- };
9
- export declare type TokenState = {
10
- priceNow: bigint;
11
- spreadNow: bigint;
12
- coeffNow: bigint;
13
- };
14
- export declare type RefInfo = {
15
- chainlinkRefOracle: Address;
16
- refPriceFixCoeff: bigint;
17
- minInputAmount: bigint;
18
- maxInputAmount: bigint;
19
- bound: bigint;
20
- };
21
- export declare type LatestRoundData = {
22
- answer: bigint;
23
- };
24
- export declare type PoolState = {
25
- feeRates: Record<Address, bigint>;
26
- tokenInfos: Record<Address, TokenInfo>;
27
- tokenStates: Record<Address, TokenState>;
28
- oracleTimestamp: bigint;
29
- isPaused: boolean;
30
- guardian: {
31
- globalBound: bigint;
32
- refInfos: Record<Address, RefInfo>;
33
- };
34
- chainlink: {
35
- latestRoundDatas: Record<Address, LatestRoundData>;
36
- };
37
- wooPPBalances: Record<Address, bigint>;
38
- };
39
- export declare type WooFiData = {};
40
- export declare type DexParams = {
41
- wooPPAddress: Address;
42
- wooOracleAddress: Address;
43
- wooFeeManagerAddress: Address;
44
- wooGuardianAddress: Address;
45
- quoteToken: Token;
46
- baseTokens: Record<string, Token>;
47
- rebateTo: Address;
48
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/types.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- declare class WooFiDecimalMath {
2
- readonly ONE: bigint;
3
- readonly TWO: bigint;
4
- readonly ONE2: bigint;
5
- mulFloor(target: bigint, d: bigint): bigint;
6
- mulCeil(target: bigint, d: bigint): bigint;
7
- divFloor(target: bigint, d: bigint): bigint;
8
- divCeil(target: bigint, d: bigint): bigint;
9
- reciprocalFloor(target: bigint): bigint;
10
- reciprocalCeil(target: bigint): bigint;
11
- private _divCeil;
12
- }
13
- export declare const wooFiDecimalMath: WooFiDecimalMath;
14
- export {};
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wooFiDecimalMath = void 0;
4
- const bigint_constants_1 = require("../../bigint-constants");
5
- class WooFiDecimalMath {
6
- constructor() {
7
- this.ONE = bigint_constants_1.BI_POWS[18];
8
- this.TWO = 2n * bigint_constants_1.BI_POWS[18];
9
- this.ONE2 = bigint_constants_1.BI_POWS[36];
10
- }
11
- mulFloor(target, d) {
12
- // target.mul(d) / (10**18);
13
- return (target * d) / bigint_constants_1.BI_POWS[18];
14
- }
15
- mulCeil(target, d) {
16
- // _divCeil(target.mul(d), 10 ** 18);
17
- return this._divCeil(target * d, bigint_constants_1.BI_POWS[18]);
18
- }
19
- divFloor(target, d) {
20
- // target.mul(10 ** 18).div(d);
21
- return (target * bigint_constants_1.BI_POWS[18]) / d;
22
- }
23
- divCeil(target, d) {
24
- // _divCeil(target.mul(10 ** 18), d);
25
- return this._divCeil(target * bigint_constants_1.BI_POWS[18], d);
26
- }
27
- reciprocalFloor(target) {
28
- // uint256(10 ** 36).div(target);
29
- return bigint_constants_1.BI_POWS[36] / target;
30
- }
31
- reciprocalCeil(target) {
32
- // _divCeil(uint256(10 ** 36), target);
33
- return this._divCeil(bigint_constants_1.BI_POWS[36], target);
34
- }
35
- _divCeil(a, b) {
36
- const quotient = a / b;
37
- const remainder = a - quotient * b;
38
- return remainder > 0n ? quotient + 1n : quotient;
39
- }
40
- }
41
- exports.wooFiDecimalMath = new WooFiDecimalMath();
42
- //# sourceMappingURL=woo-fi-decimal-math.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"woo-fi-decimal-math.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/woo-fi-decimal-math.ts"],"names":[],"mappings":";;;AAAA,6DAAiD;AAEjD,MAAM,gBAAgB;IAAtB;QACW,QAAG,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;QAClB,QAAG,GAAG,EAAE,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;QACvB,SAAI,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IAqC9B,CAAC;IAnCC,QAAQ,CAAC,MAAc,EAAE,CAAS;QAChC,4BAA4B;QAC5B,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,CAAS;QAC/B,qCAAqC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,0BAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,MAAc,EAAE,CAAS;QAChC,+BAA+B;QAC/B,OAAO,CAAC,MAAM,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,CAAS;QAC/B,qCAAqC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,0BAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,eAAe,CAAC,MAAc;QAC5B,iCAAiC;QACjC,OAAO,0BAAO,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,cAAc,CAAC,MAAc;QAC3B,uCAAuC;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,0BAAO,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAEO,QAAQ,CAAC,CAAS,EAAE,CAAS;QACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,SAAS,GAAG,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC;QACnC,OAAO,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnD,CAAC;CACF;AAEY,QAAA,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC"}
@@ -1,31 +0,0 @@
1
- import { PoolState, TokenInfo } from './types';
2
- import { wooFiDecimalMath } from './woo-fi-decimal-math';
3
- import { Address, Logger } from '../../types';
4
- export declare class WooFiMath {
5
- private readonly logger;
6
- private readonly _quoteToken;
7
- readonly dMath: typeof wooFiDecimalMath;
8
- private readonly _MIN_INPUT_DEFAULT;
9
- private readonly _MAX_INPUT_DEFAULT;
10
- state: PoolState;
11
- constructor(logger: Logger, _quoteToken: Address);
12
- querySellBase(baseToken: Address, baseAmounts: bigint[]): bigint[] | null;
13
- querySellQuote(baseToken: Address, quoteAmounts: bigint[]): bigint[] | null;
14
- protected _takeFee(amounts: bigint[], feeRate: bigint): bigint[];
15
- protected _getQuoteAmountSellBase(baseToken: Address, baseAmounts: bigint[]): bigint[];
16
- protected _getBaseAmountSellQuote(baseToken: string, quoteAmounts: bigint[]): bigint[];
17
- protected _getBoughtAmount(baseInfo: TokenInfo, quoteInfo: TokenInfo, p: bigint, k: bigint, isSellBase: boolean): {
18
- baseBought: bigint;
19
- quoteBought: bigint;
20
- };
21
- protected _getBaseAmountLowBaseSide(p: bigint, k: bigint, r: bigint, quoteAmount: bigint): bigint;
22
- protected _getQuoteAmountLowQuoteSide(p: bigint, k: bigint, r: bigint, baseAmount: bigint): bigint;
23
- protected _getBaseAmountLowQuoteSide(p: bigint, k: bigint, r: bigint, quoteAmount: bigint): bigint;
24
- protected _getQuoteAmountLowBaseSide(p: bigint, k: bigint, r: bigint, baseAmount: bigint): bigint;
25
- protected _autoUpdate(quoteTokenAddress: string, baseTokenAddress: string): void;
26
- private _checkInputAmount;
27
- private _checkSwapAmount;
28
- checkSwapPrice(price: bigint, fromToken: Address, toToken: Address): void;
29
- private _refPrice;
30
- private _boundForTokens;
31
- }