@paraswap/dex-lib 4.1.7 → 4.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/.idea/codeStyles/Project.xml +44 -4
  2. package/.idea/codeStyles/codeStyleConfig.xml +1 -1
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/paraswap-dex-lib.iml +7 -4
  5. package/build/dex/angle-staked-stable/angle-staked-stable.js +2 -1
  6. package/build/dex/angle-staked-stable/angle-staked-stable.js.map +1 -1
  7. package/build/dex/angle-transmuter/angle-transmuter.js.map +1 -1
  8. package/build/dex/balancer-v1/config.js +2 -1
  9. package/build/dex/balancer-v1/config.js.map +1 -1
  10. package/build/dex/jarvis.d.ts +2 -1
  11. package/build/dex/jarvis.js +58 -0
  12. package/build/dex/jarvis.js.map +1 -1
  13. package/build/dex/weth/weth.js +2 -1
  14. package/build/dex/weth/weth.js.map +1 -1
  15. package/build/dex/zerox/index.d.ts +3 -25
  16. package/build/dex/zerox/index.js +50 -42
  17. package/build/dex/zerox/index.js.map +1 -1
  18. package/build/dex/zerox/types.d.ts +29 -0
  19. package/build/dex/zerox/types.js +8 -1
  20. package/build/dex/zerox/types.js.map +1 -1
  21. package/package.json +1 -1
  22. package/scripts/get-uniswap-v3-dexes.ts +64 -0
  23. package/src/dex/aave-gsm/aave-gsm-gas-estimation.test.ts +32 -0
  24. package/src/dex/aave-v2/aave-v2-gas-estimation.test.ts +28 -0
  25. package/src/dex/aave-v3/aave-v3-gas-estimation.test.ts +66 -0
  26. package/src/dex/aave-v3-stata/aave-v3-stata-gas-estimation.test.ts +41 -0
  27. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-gas-estimation.test.ts +41 -0
  28. package/src/dex/angle-staked-stable/angle-staked-stable-gas-estimation.test.ts +29 -0
  29. package/src/dex/angle-staked-stable/angle-staked-stable.ts +2 -1
  30. package/src/dex/angle-transmuter/angle-transmuter-gas-estimation.test.ts +41 -0
  31. package/src/dex/angle-transmuter/angle-transmuter.ts +0 -1
  32. package/src/dex/balancer-v1/balancer-v1-gas-estimation.test.ts +29 -0
  33. package/src/dex/balancer-v1/config.ts +2 -1
  34. package/src/dex/balancer-v2/balancer-v2-gas-estimation.test.ts +98 -0
  35. package/src/dex/balancer-v3/balancer-v3-gas-estimation.test.ts +30 -0
  36. package/src/dex/bancor/bancor-gas-estimation.test.ts +30 -0
  37. package/src/dex/bebop/bebop-gas-estimation.test.ts +30 -0
  38. package/src/dex/concentrator-arusd/concentrator-arusd-gas-estimation.test.ts +29 -0
  39. package/src/dex/curve-v1/curve-v1-gas-estimation.test.ts +29 -0
  40. package/src/dex/curve-v2/curve-v2-gas-estimation.test.ts +29 -0
  41. package/src/dex/fluid-dex/fluid-dex-gas-estimation.test.ts +29 -0
  42. package/src/dex/fx-protocol-rusd/fx-protocol-rusd-gas-estimation.test.ts +29 -0
  43. package/src/dex/hashflow/hashflow-gas-estimation.test.ts +30 -0
  44. package/src/dex/idle-dao/idle-dao--gas-estimation.test.ts +30 -0
  45. package/src/dex/lido/lido-gas-estimation.test.ts +29 -0
  46. package/src/dex/lite-psm/lite-psm-gas-estimation.test.ts +34 -0
  47. package/src/dex/maker-psm/maker-psm-gas-estimation.test.ts +34 -0
  48. package/src/dex/maverick-v1/maverick-v1-gas-estimation.test.ts +29 -0
  49. package/src/dex/maverick-v2/maverick-v2-gas-estimation.test.ts +29 -0
  50. package/src/dex/pancakeswap-v3/pancakeswap-v3-gas-estimation.test.ts +29 -0
  51. package/src/dex/polygon-migrator/polygon-migrator-gas-estimation.test.ts +41 -0
  52. package/src/dex/sky-converter/sky-converter-gas-estimation.test.ts +78 -0
  53. package/src/dex/solidly/solidly-gas-estimation.test.ts +29 -0
  54. package/src/dex/solidly-v3/solidly-v3-gas-estimation.test.ts +29 -0
  55. package/src/dex/spark/spark-gas-estimation.test.ts +29 -0
  56. package/src/dex/stader/stader-gas-estimation.test.ts +29 -0
  57. package/src/dex/stkgho/stkgho-gas-estimation.test.ts +29 -0
  58. package/src/dex/swaap-v2/swaap-v2-estimation.test.ts +29 -0
  59. package/src/dex/swell/swell-estimation.test.ts +29 -0
  60. package/src/dex/trader-joe-v2.1/trader-joe-v2.1-gas-estimation.test.ts +29 -0
  61. package/src/dex/uniswap-v2/uniswap-v2-gas-estimation.test.ts +98 -0
  62. package/src/dex/uniswap-v3/uniswap-v3-gas-estimation.test.ts +98 -0
  63. package/src/dex/usual/usual-gas-estimation.test.ts +54 -0
  64. package/src/dex/usual-pp/usual-pp-gas-estimation.test.ts +29 -0
  65. package/src/dex/weth/weth-gas-estimation.test.ts +42 -0
  66. package/src/dex/weth/weth.ts +3 -1
  67. package/src/dex/wombat/wombat-gas-estimation.test.ts +29 -0
  68. package/src/dex/wsteth/wsteth-gas-estimation.test.ts +41 -0
  69. package/src/dex/wusdm/wusdm-gas-estimation.test.ts +41 -0
  70. package/tests/constants-e2e.ts +8 -0
  71. package/tests/tenderly-simulation-new.test.ts +151 -0
  72. package/tests/tenderly-simulation-new.ts +698 -0
  73. package/tests/token-storage-slots.json +532 -0
  74. package/tests/utils-e2e.ts +137 -1
  75. package/.idea/aws.xml +0 -17
  76. package/.idea/misc.xml +0 -6
  77. package/.idea/prettier.xml +0 -7
  78. package/build/abi/AaveV1_lending_pool.json +0 -27
  79. package/build/abi/integral/factory.json +0 -333
  80. package/build/abi/integral/oracle.json +0 -501
  81. package/build/abi/integral/pool.json +0 -1041
  82. package/build/abi/integral/relayer.json +0 -1536
  83. package/build/abi/platypus/asset.json +0 -490
  84. package/build/abi/platypus/avax-pool.json +0 -820
  85. package/build/abi/platypus/oracle.json +0 -119
  86. package/build/abi/platypus/pool.json +0 -677
  87. package/build/abi/smardex/all/smardex-router.json +0 -648
  88. package/build/abi/smardex/layer-1/smardex-factory.json +0 -242
  89. package/build/abi/smardex/layer-1/smardex-pool.json +0 -506
  90. package/build/abi/smardex/layer-2/smardex-factory.json +0 -185
  91. package/build/abi/smardex/layer-2/smardex-pool.json +0 -578
  92. package/build/abi/swaap-v1/pool.json +0 -1346
  93. package/build/dex/aave-v1/aave-v1.d.ts +0 -33
  94. package/build/dex/aave-v1/aave-v1.js +0 -158
  95. package/build/dex/aave-v1/aave-v1.js.map +0 -1
  96. package/build/dex/aave-v1/config.d.ts +0 -11
  97. package/build/dex/aave-v1/config.js +0 -20
  98. package/build/dex/aave-v1/config.js.map +0 -1
  99. package/build/dex/aave-v1/tokens-mainnet.json +0 -134
  100. package/build/dex/aave-v1/tokens.d.ts +0 -3
  101. package/build/dex/aave-v1/tokens.js +0 -50
  102. package/build/dex/aave-v1/tokens.js.map +0 -1
  103. package/build/dex/aave-v1/types.d.ts +0 -12
  104. package/build/dex/aave-v1/types.js +0 -3
  105. package/build/dex/aave-v1/types.js.map +0 -1
  106. package/build/dex/bProtocol.d.ts +0 -18
  107. package/build/dex/bProtocol.js +0 -39
  108. package/build/dex/bProtocol.js.map +0 -1
  109. package/build/dex/bancor.d.ts +0 -26
  110. package/build/dex/bancor.js +0 -58
  111. package/build/dex/bancor.js.map +0 -1
  112. package/build/dex/compound.d.ts +0 -18
  113. package/build/dex/compound.js +0 -46
  114. package/build/dex/compound.js.map +0 -1
  115. package/build/dex/curve-v2.d.ts +0 -58
  116. package/build/dex/curve-v2.js +0 -180
  117. package/build/dex/curve-v2.js.map +0 -1
  118. package/build/dex/dodo-v1.d.ts +0 -33
  119. package/build/dex/dodo-v1.js +0 -63
  120. package/build/dex/dodo-v1.js.map +0 -1
  121. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
  122. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
  123. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
  124. package/build/dex/integral/config.d.ts +0 -4
  125. package/build/dex/integral/config.js +0 -20
  126. package/build/dex/integral/config.js.map +0 -1
  127. package/build/dex/integral/context.d.ts +0 -40
  128. package/build/dex/integral/context.js +0 -158
  129. package/build/dex/integral/context.js.map +0 -1
  130. package/build/dex/integral/integral-factory.d.ts +0 -24
  131. package/build/dex/integral/integral-factory.js +0 -95
  132. package/build/dex/integral/integral-factory.js.map +0 -1
  133. package/build/dex/integral/integral-pool.d.ts +0 -50
  134. package/build/dex/integral/integral-pool.js +0 -149
  135. package/build/dex/integral/integral-pool.js.map +0 -1
  136. package/build/dex/integral/integral-pricing.d.ts +0 -18
  137. package/build/dex/integral/integral-pricing.js +0 -114
  138. package/build/dex/integral/integral-pricing.js.map +0 -1
  139. package/build/dex/integral/integral-relayer.d.ts +0 -42
  140. package/build/dex/integral/integral-relayer.js +0 -192
  141. package/build/dex/integral/integral-relayer.js.map +0 -1
  142. package/build/dex/integral/integral-token.d.ts +0 -27
  143. package/build/dex/integral/integral-token.js +0 -59
  144. package/build/dex/integral/integral-token.js.map +0 -1
  145. package/build/dex/integral/integral.d.ts +0 -41
  146. package/build/dex/integral/integral.js +0 -376
  147. package/build/dex/integral/integral.js.map +0 -1
  148. package/build/dex/integral/types.d.ts +0 -85
  149. package/build/dex/integral/types.js +0 -9
  150. package/build/dex/integral/types.js.map +0 -1
  151. package/build/dex/integral/utils-e2e.d.ts +0 -9
  152. package/build/dex/integral/utils-e2e.js +0 -131
  153. package/build/dex/integral/utils-e2e.js.map +0 -1
  154. package/build/dex/integral/utils.d.ts +0 -17
  155. package/build/dex/integral/utils.js +0 -94
  156. package/build/dex/integral/utils.js.map +0 -1
  157. package/build/dex/lido.d.ts +0 -19
  158. package/build/dex/lido.js +0 -42
  159. package/build/dex/lido.js.map +0 -1
  160. package/build/dex/m-token/config.d.ts +0 -3
  161. package/build/dex/m-token/config.js +0 -19
  162. package/build/dex/m-token/config.js.map +0 -1
  163. package/build/dex/m-token/m-token.d.ts +0 -29
  164. package/build/dex/m-token/m-token.js +0 -145
  165. package/build/dex/m-token/m-token.js.map +0 -1
  166. package/build/dex/m-token/m-wrapped-m.d.ts +0 -17
  167. package/build/dex/m-token/m-wrapped-m.js +0 -50
  168. package/build/dex/m-token/m-wrapped-m.js.map +0 -1
  169. package/build/dex/m-token/types.d.ts +0 -12
  170. package/build/dex/m-token/types.js +0 -3
  171. package/build/dex/m-token/types.js.map +0 -1
  172. package/build/dex/onebit.d.ts +0 -25
  173. package/build/dex/onebit.js +0 -42
  174. package/build/dex/onebit.js.map +0 -1
  175. package/build/dex/platypus/asset.d.ts +0 -14
  176. package/build/dex/platypus/asset.js +0 -97
  177. package/build/dex/platypus/asset.js.map +0 -1
  178. package/build/dex/platypus/config.d.ts +0 -11
  179. package/build/dex/platypus/config.js +0 -69
  180. package/build/dex/platypus/config.js.map +0 -1
  181. package/build/dex/platypus/platypus.d.ts +0 -62
  182. package/build/dex/platypus/platypus.js +0 -442
  183. package/build/dex/platypus/platypus.js.map +0 -1
  184. package/build/dex/platypus/pool-avax.d.ts +0 -8
  185. package/build/dex/platypus/pool-avax.js +0 -54
  186. package/build/dex/platypus/pool-avax.js.map +0 -1
  187. package/build/dex/platypus/pool-base.d.ts +0 -19
  188. package/build/dex/platypus/pool-base.js +0 -86
  189. package/build/dex/platypus/pool-base.js.map +0 -1
  190. package/build/dex/platypus/pool-pure.d.ts +0 -8
  191. package/build/dex/platypus/pool-pure.js +0 -37
  192. package/build/dex/platypus/pool-pure.js.map +0 -1
  193. package/build/dex/platypus/pool-subscriber.d.ts +0 -14
  194. package/build/dex/platypus/pool-subscriber.js +0 -167
  195. package/build/dex/platypus/pool-subscriber.js.map +0 -1
  196. package/build/dex/platypus/pool.d.ts +0 -8
  197. package/build/dex/platypus/pool.js +0 -58
  198. package/build/dex/platypus/pool.js.map +0 -1
  199. package/build/dex/platypus/types.d.ts +0 -92
  200. package/build/dex/platypus/types.js +0 -10
  201. package/build/dex/platypus/types.js.map +0 -1
  202. package/build/dex/quickswap/spiritswap-v3.d.ts +0 -6
  203. package/build/dex/quickswap/spiritswap-v3.js +0 -19
  204. package/build/dex/quickswap/spiritswap-v3.js.map +0 -1
  205. package/build/dex/smardex/config.d.ts +0 -4
  206. package/build/dex/smardex/config.js +0 -64
  207. package/build/dex/smardex/config.js.map +0 -1
  208. package/build/dex/smardex/constants.d.ts +0 -18
  209. package/build/dex/smardex/constants.js +0 -33
  210. package/build/dex/smardex/constants.js.map +0 -1
  211. package/build/dex/smardex/sdk/constants.d.ts +0 -6
  212. package/build/dex/smardex/sdk/constants.js +0 -13
  213. package/build/dex/smardex/sdk/constants.js.map +0 -1
  214. package/build/dex/smardex/sdk/core.d.ts +0 -113
  215. package/build/dex/smardex/sdk/core.js +0 -499
  216. package/build/dex/smardex/sdk/core.js.map +0 -1
  217. package/build/dex/smardex/sdk/errors.d.ts +0 -15
  218. package/build/dex/smardex/sdk/errors.js +0 -22
  219. package/build/dex/smardex/sdk/errors.js.map +0 -1
  220. package/build/dex/smardex/sdk/types.d.ts +0 -62
  221. package/build/dex/smardex/sdk/types.js +0 -3
  222. package/build/dex/smardex/sdk/types.js.map +0 -1
  223. package/build/dex/smardex/sdk/utils.d.ts +0 -44
  224. package/build/dex/smardex/sdk/utils.js +0 -133
  225. package/build/dex/smardex/sdk/utils.js.map +0 -1
  226. package/build/dex/smardex/smardex-event-pool.d.ts +0 -28
  227. package/build/dex/smardex/smardex-event-pool.js +0 -119
  228. package/build/dex/smardex/smardex-event-pool.js.map +0 -1
  229. package/build/dex/smardex/smardex.d.ts +0 -65
  230. package/build/dex/smardex/smardex.js +0 -519
  231. package/build/dex/smardex/smardex.js.map +0 -1
  232. package/build/dex/smardex/types.d.ts +0 -55
  233. package/build/dex/smardex/types.js +0 -3
  234. package/build/dex/smardex/types.js.map +0 -1
  235. package/build/dex/smoothy.d.ts +0 -26
  236. package/build/dex/smoothy.js +0 -48
  237. package/build/dex/smoothy.js.map +0 -1
  238. package/build/dex/solidly/forks-override/cone.d.ts +0 -22
  239. package/build/dex/solidly/forks-override/cone.js +0 -53
  240. package/build/dex/solidly/forks-override/cone.js.map +0 -1
  241. package/build/dex/solidly/forks-override/solisnek.d.ts +0 -8
  242. package/build/dex/solidly/forks-override/solisnek.js +0 -15
  243. package/build/dex/solidly/forks-override/solisnek.js.map +0 -1
  244. package/build/dex/stable-pool.d.ts +0 -28
  245. package/build/dex/stable-pool.js +0 -62
  246. package/build/dex/stable-pool.js.map +0 -1
  247. package/build/dex/swaap-v1/config.d.ts +0 -17
  248. package/build/dex/swaap-v1/config.js +0 -56
  249. package/build/dex/swaap-v1/config.js.map +0 -1
  250. package/build/dex/swaap-v1/constants.d.ts +0 -6
  251. package/build/dex/swaap-v1/constants.js +0 -17
  252. package/build/dex/swaap-v1/constants.js.map +0 -1
  253. package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +0 -25
  254. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +0 -62
  255. package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +0 -1
  256. package/build/dex/swaap-v1/libraries/Const.d.ts +0 -18
  257. package/build/dex/swaap-v1/libraries/Const.js +0 -26
  258. package/build/dex/swaap-v1/libraries/Const.js.map +0 -1
  259. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +0 -77
  260. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +0 -316
  261. package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +0 -1
  262. package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +0 -75
  263. package/build/dex/swaap-v1/libraries/LogExpMath.js +0 -418
  264. package/build/dex/swaap-v1/libraries/LogExpMath.js.map +0 -1
  265. package/build/dex/swaap-v1/libraries/MathMMM.d.ts +0 -185
  266. package/build/dex/swaap-v1/libraries/MathMMM.js +0 -453
  267. package/build/dex/swaap-v1/libraries/MathMMM.js.map +0 -1
  268. package/build/dex/swaap-v1/libraries/Num.d.ts +0 -31
  269. package/build/dex/swaap-v1/libraries/Num.js +0 -167
  270. package/build/dex/swaap-v1/libraries/Num.js.map +0 -1
  271. package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +0 -23
  272. package/build/dex/swaap-v1/libraries/PoolQuotations.js +0 -131
  273. package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +0 -1
  274. package/build/dex/swaap-v1/libraries/Struct.d.ts +0 -56
  275. package/build/dex/swaap-v1/libraries/Struct.js +0 -3
  276. package/build/dex/swaap-v1/libraries/Struct.js.map +0 -1
  277. package/build/dex/swaap-v1/swaap-v1-pool.d.ts +0 -45
  278. package/build/dex/swaap-v1/swaap-v1-pool.js +0 -656
  279. package/build/dex/swaap-v1/swaap-v1-pool.js.map +0 -1
  280. package/build/dex/swaap-v1/swaap-v1.d.ts +0 -61
  281. package/build/dex/swaap-v1/swaap-v1.js +0 -369
  282. package/build/dex/swaap-v1/swaap-v1.js.map +0 -1
  283. package/build/dex/swaap-v1/types.d.ts +0 -106
  284. package/build/dex/swaap-v1/types.js +0 -9
  285. package/build/dex/swaap-v1/types.js.map +0 -1
  286. package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
  287. package/build/dex/trader-joe-v2.1/optimizer.js +0 -47
  288. package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
  289. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  290. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  291. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  292. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  293. package/build/dex/trader-joe-v2.1.js +0 -79
  294. package/build/dex/trader-joe-v2.1.js.map +0 -1
@@ -1,442 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.Platypus = void 0;
30
- const abi_1 = require("@ethersproject/abi");
31
- const constants_1 = require("../../constants");
32
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
33
- const utils_1 = require("../../utils");
34
- const types_1 = require("./types");
35
- const simple_exchange_1 = require("../simple-exchange");
36
- const config_1 = require("./config");
37
- const chainlink_1 = require("../../lib/chainlink");
38
- const pool_1 = require("./pool");
39
- const pool_pure_1 = require("./pool-pure");
40
- const pool_avax_1 = require("./pool-avax");
41
- const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
42
- const pool_json_1 = __importDefault(require("../../abi/platypus/pool.json"));
43
- const avax_pool_json_1 = __importDefault(require("../../abi/platypus/avax-pool.json"));
44
- const asset_json_1 = __importDefault(require("../../abi/platypus/asset.json"));
45
- const oracle_json_1 = __importDefault(require("../../abi/platypus/oracle.json"));
46
- class Platypus extends simple_exchange_1.SimpleExchange {
47
- constructor(network, dexKey, dexHelper, adapters = config_1.Adapters[network]) {
48
- super(dexHelper, dexKey);
49
- this.network = network;
50
- this.dexHelper = dexHelper;
51
- this.adapters = adapters;
52
- this.hasConstantPriceLargeAmounts = false;
53
- this.isFeeOnTransferSupported = false;
54
- this.config = config_1.PlatypusConfig[dexKey][network];
55
- this.logger = dexHelper.getLogger(`${dexKey}-${network}`);
56
- }
57
- async generateConfigInfo(blockNumber) {
58
- const cfgInfo = {
59
- poolAddresses: [],
60
- pools: {},
61
- };
62
- // Need to filter pools in case we are testing against an old block where the pool didn't exist!
63
- for (const p of this.config.pools) {
64
- // When there's no code, getCode should return '0x' but could return '0x0' instead
65
- if ((await this.dexHelper.web3Provider.eth.getCode(p.address, blockNumber))
66
- .length > 3) {
67
- const poolAddress = p.address.toLowerCase();
68
- cfgInfo.poolAddresses.push(poolAddress);
69
- if (p.oracleType === types_1.PlatypusOracleType.None) {
70
- cfgInfo.pools[poolAddress] = {
71
- oracleType: types_1.PlatypusOracleType.None,
72
- tokenAddresses: [],
73
- tokens: {},
74
- };
75
- }
76
- else if (p.oracleType === types_1.PlatypusOracleType.ChainLink) {
77
- cfgInfo.pools[poolAddress] = {
78
- oracleType: types_1.PlatypusOracleType.ChainLink,
79
- priceOracleAddress: '',
80
- tokenAddresses: [],
81
- tokens: {},
82
- };
83
- }
84
- else if (p.oracleType === types_1.PlatypusOracleType.StakedAvax) {
85
- cfgInfo.pools[poolAddress] = {
86
- oracleType: types_1.PlatypusOracleType.StakedAvax,
87
- priceOracleAddress: '',
88
- tokenAddresses: [],
89
- tokens: {},
90
- };
91
- }
92
- else {
93
- throw new Error(`Invalid pool oracle type in ${this.dexKey}`);
94
- }
95
- }
96
- }
97
- let inputs = [];
98
- for (const poolAddress of cfgInfo.poolAddresses) {
99
- const pool = cfgInfo.pools[poolAddress];
100
- if (pool.oracleType !== types_1.PlatypusOracleType.None) {
101
- inputs.push({
102
- target: poolAddress,
103
- callData: Platypus.poolInterface.encodeFunctionData('getPriceOracle'),
104
- });
105
- }
106
- inputs.push({
107
- target: poolAddress,
108
- callData: Platypus.poolInterface.encodeFunctionData('getTokenAddresses'),
109
- });
110
- }
111
- let returnData = (await this.dexHelper.multiContract.methods
112
- .aggregate(inputs)
113
- .call({}, blockNumber)).returnData;
114
- let i = 0;
115
- for (const poolAddress of cfgInfo.poolAddresses) {
116
- const pool = cfgInfo.pools[poolAddress];
117
- if (pool.oracleType !== types_1.PlatypusOracleType.None) {
118
- pool.priceOracleAddress = Platypus.poolInterface
119
- .decodeFunctionResult('getPriceOracle', returnData[i++])[0]
120
- .toLowerCase();
121
- }
122
- pool.tokenAddresses = Platypus.poolInterface
123
- .decodeFunctionResult('getTokenAddresses', returnData[i++])[0]
124
- .map((a) => a.toLowerCase());
125
- }
126
- inputs = [];
127
- for (const poolAddress of cfgInfo.poolAddresses) {
128
- const pool = cfgInfo.pools[poolAddress];
129
- for (const tokenAddress of pool.tokenAddresses) {
130
- inputs.push({
131
- target: tokenAddress,
132
- callData: Platypus.erc20Interface.encodeFunctionData('symbol'),
133
- });
134
- inputs.push({
135
- target: tokenAddress,
136
- callData: Platypus.erc20Interface.encodeFunctionData('decimals'),
137
- });
138
- inputs.push({
139
- target: poolAddress,
140
- callData: Platypus.poolInterface.encodeFunctionData('assetOf', [
141
- tokenAddress,
142
- ]),
143
- });
144
- if (pool.oracleType === types_1.PlatypusOracleType.ChainLink) {
145
- inputs.push({
146
- target: pool.priceOracleAddress,
147
- callData: Platypus.oracleInterface.encodeFunctionData('getSourceOfAsset', [tokenAddress]),
148
- });
149
- }
150
- }
151
- }
152
- returnData = (await this.dexHelper.multiContract.methods
153
- .aggregate(inputs)
154
- .call({}, blockNumber)).returnData;
155
- i = 0;
156
- for (const poolAddress of cfgInfo.poolAddresses) {
157
- const pool = cfgInfo.pools[poolAddress];
158
- for (const tokenAddress of pool.tokenAddresses) {
159
- const tokenSymbol = Platypus.erc20Interface.decodeFunctionResult('symbol', returnData[i++])[0];
160
- const tokenDecimals = Platypus.erc20Interface.decodeFunctionResult('decimals', returnData[i++])[0];
161
- const assetAddress = Platypus.poolInterface
162
- .decodeFunctionResult('assetOf', returnData[i++])[0]
163
- .toLowerCase();
164
- if (pool.oracleType === types_1.PlatypusOracleType.ChainLink) {
165
- const proxyAddress = Platypus.oracleInterface
166
- .decodeFunctionResult('getSourceOfAsset', returnData[i++])[0]
167
- .toLowerCase();
168
- pool.tokens[tokenAddress] = {
169
- tokenSymbol,
170
- tokenDecimals,
171
- assetAddress,
172
- chainlink: {
173
- proxyAddress,
174
- aggregatorAddress: '',
175
- },
176
- };
177
- }
178
- else {
179
- pool.tokens[tokenAddress] = {
180
- tokenSymbol,
181
- tokenDecimals,
182
- assetAddress,
183
- };
184
- }
185
- }
186
- }
187
- inputs = [];
188
- for (const poolAddress of cfgInfo.poolAddresses) {
189
- const pool = cfgInfo.pools[poolAddress];
190
- if (pool.oracleType === types_1.PlatypusOracleType.ChainLink) {
191
- for (const tokenAddress of pool.tokenAddresses) {
192
- inputs.push(chainlink_1.ChainLinkSubscriber.getReadAggregatorMultiCallInput(pool.tokens[tokenAddress].chainlink.proxyAddress));
193
- }
194
- }
195
- }
196
- returnData = (await this.dexHelper.multiContract.methods
197
- .aggregate(inputs)
198
- .call({}, blockNumber)).returnData;
199
- i = 0;
200
- for (const poolAddress of cfgInfo.poolAddresses) {
201
- const pool = cfgInfo.pools[poolAddress];
202
- if (pool.oracleType === types_1.PlatypusOracleType.ChainLink) {
203
- for (const tokenAddress of pool.tokenAddresses) {
204
- pool.tokens[tokenAddress].chainlink.aggregatorAddress =
205
- chainlink_1.ChainLinkSubscriber.readAggregator(returnData[i++]).toLowerCase();
206
- }
207
- }
208
- }
209
- return cfgInfo;
210
- }
211
- async init(blockNumber) {
212
- if (this.cfgInfo)
213
- return;
214
- this.cfgInfo = await this.generateConfigInfo(blockNumber);
215
- }
216
- // Initialize pricing is called once in the start of
217
- // pricing service. It is intended to setup the integration
218
- // for pricing requests. It is optional for a DEX to
219
- // implement this function
220
- async initializePricing(blockNumber) {
221
- await this.init(blockNumber);
222
- if (!this.cfgInfo)
223
- throw new Error(`initializePricing: ${this.dexKey} cfgInfo still null after init`);
224
- const eventPools = {};
225
- for (const poolAddress of this.cfgInfo.poolAddresses) {
226
- const cfgPool = this.cfgInfo.pools[poolAddress];
227
- const poolName = this.config.pools.find(p => p.address.toLowerCase() === poolAddress).name;
228
- let pool;
229
- if (cfgPool.oracleType === types_1.PlatypusOracleType.None) {
230
- pool = new pool_pure_1.PlatypusPurePool(this.dexKey, this.network, poolName, poolAddress, cfgPool, this.dexHelper);
231
- }
232
- else if (cfgPool.oracleType === types_1.PlatypusOracleType.ChainLink) {
233
- pool = new pool_1.PlatypusPool(this.dexKey, this.network, poolName, poolAddress, cfgPool, this.dexHelper);
234
- }
235
- else if (cfgPool.oracleType === types_1.PlatypusOracleType.StakedAvax) {
236
- pool = new pool_avax_1.PlatypusAvaxPool(this.dexKey, this.network, poolName, poolAddress, cfgPool, this.dexHelper);
237
- }
238
- else {
239
- throw new Error(`${this.dexKey} cfgInfo invalid pool type`);
240
- }
241
- await pool.initialize(blockNumber);
242
- eventPools[poolAddress] = pool;
243
- }
244
- this.eventPools = eventPools;
245
- }
246
- // Returns the list of contract adapters (name and index)
247
- // for a buy/sell. Return null if there are no adapters.
248
- getAdapters(side) {
249
- return this.adapters[side];
250
- }
251
- findPools(srcTokenAddress, destTokenAddress) {
252
- if (!this.cfgInfo)
253
- return [];
254
- return Object.entries(this.cfgInfo.pools)
255
- .filter(([poolAddress, poolConfig]) => poolConfig.tokenAddresses.includes(srcTokenAddress) &&
256
- poolConfig.tokenAddresses.includes(destTokenAddress))
257
- .map(([poolAddress, poolConfig]) => poolAddress);
258
- }
259
- getPoolIdentifier(poolAddress) {
260
- return `${this.dexKey}_${poolAddress}`;
261
- }
262
- // Returns list of pool identifiers that can be used
263
- // for a given swap. poolIdentifers must be unique
264
- // across DEXes. It is recommended to use
265
- // ${dexKey}_${poolAddress} as a poolIdentifier
266
- async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
267
- if (side === constants_1.SwapSide.BUY)
268
- return [];
269
- return this.findPools(this.dexHelper.config.wrapETH(srcToken).address.toLowerCase(), this.dexHelper.config.wrapETH(destToken).address.toLowerCase()).map(p => this.getPoolIdentifier(p));
270
- }
271
- // Returns pool prices for amounts.
272
- // If limitPools is defined only pools in limitPools
273
- // should be used. If limitPools is undefined then
274
- // any pools can be used.
275
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
276
- if (side === constants_1.SwapSide.BUY)
277
- return null;
278
- if (!this.eventPools) {
279
- this.logger.error(`Missing event pools for ${this.dexKey} in getPricesVolume`);
280
- return null;
281
- }
282
- const srcTokenAddress = this.dexHelper.config
283
- .wrapETH(srcToken)
284
- .address.toLowerCase();
285
- const destTokenAddress = this.dexHelper.config
286
- .wrapETH(destToken)
287
- .address.toLowerCase();
288
- if (srcTokenAddress === destTokenAddress)
289
- return null;
290
- return (await Promise.all(this.findPools(srcTokenAddress, destTokenAddress)
291
- .filter(poolAddress => !limitPools ||
292
- limitPools.includes(this.getPoolIdentifier(poolAddress)))
293
- .map(poolAddress => (async (pool) => {
294
- let state = pool.getState(blockNumber);
295
- if (!state) {
296
- state = await pool.generateState(blockNumber);
297
- pool.setState(state, blockNumber);
298
- }
299
- if (state.params.paused)
300
- return null;
301
- const [unit, ...prices] = pool.computePrices({
302
- address: srcTokenAddress,
303
- decimals: srcToken.decimals,
304
- }, {
305
- address: destTokenAddress,
306
- decimals: destToken.decimals,
307
- }, [(0, utils_1.getBigIntPow)(srcToken.decimals), ...amounts], state);
308
- const ret = {
309
- prices,
310
- unit,
311
- data: {
312
- pool: poolAddress,
313
- },
314
- poolAddresses: [poolAddress],
315
- exchange: this.dexKey,
316
- gasCost: 260 * 1000,
317
- poolIdentifier: this.getPoolIdentifier(poolAddress),
318
- };
319
- return ret;
320
- })(this.eventPools[poolAddress])))).filter((p) => !!p);
321
- }
322
- // Returns estimated gas cost of calldata for this DEX in multiSwap
323
- getCalldataGasCost(poolPrices) {
324
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
325
- }
326
- // Encode params required by the exchange adapter
327
- // Used for multiSwap, buy & megaSwap
328
- // Hint: abiCoder.encodeParameter() couls be useful
329
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
330
- return {
331
- targetExchange: data.pool,
332
- payload: '0x',
333
- networkFee: '0',
334
- };
335
- }
336
- // Encode call data used by simpleSwap like routers
337
- // Used for simpleSwap & simpleBuy
338
- // Hint: this.buildSimpleParamWithoutWETHConversion
339
- // could be useful
340
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
341
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, (0, utils_1.isETHAddress)(srcToken)
342
- ? Platypus.avaxPoolInterface.encodeFunctionData('swapFromETH', [
343
- destToken,
344
- 1,
345
- this.augustusAddress,
346
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
347
- ])
348
- : (0, utils_1.isETHAddress)(destToken)
349
- ? Platypus.avaxPoolInterface.encodeFunctionData('swapToETH', [
350
- srcToken,
351
- srcAmount,
352
- 1,
353
- this.augustusAddress,
354
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
355
- ])
356
- : Platypus.poolInterface.encodeFunctionData('swap', [
357
- srcToken,
358
- destToken,
359
- srcAmount,
360
- 1,
361
- this.augustusAddress,
362
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
363
- ]), data.pool);
364
- }
365
- // This is called once before getTopPoolsForToken is
366
- // called for multiple tokens. This can be helpful to
367
- // update common state required for calculating
368
- // getTopPoolsForToken. It is optional for a DEX
369
- // to implement this
370
- async updatePoolState() {
371
- const blockNumber = await this.dexHelper.web3Provider.eth.getBlockNumber();
372
- await this.init(blockNumber);
373
- if (!this.cfgInfo)
374
- throw new Error('updatePoolState: Platypus cfgInfo still null after init');
375
- // All tokens are USD stablecoins so to estimate liquidity can just add
376
- // the cash balances of all the tokens
377
- const poolLiquidityUSD = {};
378
- let inputs = [];
379
- for (const poolAddress of this.cfgInfo.poolAddresses) {
380
- for (const tokenAddress of this.cfgInfo.pools[poolAddress]
381
- .tokenAddresses) {
382
- inputs.push({
383
- target: this.cfgInfo.pools[poolAddress].tokens[tokenAddress].assetAddress,
384
- callData: Platypus.assetInterface.encodeFunctionData('cash'),
385
- });
386
- }
387
- }
388
- const returnData = (await this.dexHelper.multiContract.methods
389
- .aggregate(inputs)
390
- .call({}, blockNumber)).returnData;
391
- const usdPromises = [];
392
- let i = 0;
393
- for (const poolAddress of this.cfgInfo.poolAddresses) {
394
- for (const tokenAddress of this.cfgInfo.pools[poolAddress]
395
- .tokenAddresses) {
396
- usdPromises.push(this.dexHelper.getTokenUSDPrice({
397
- address: tokenAddress,
398
- decimals: this.cfgInfo.pools[poolAddress].tokens[tokenAddress]
399
- .tokenDecimals,
400
- }, BigInt(Platypus.assetInterface
401
- .decodeFunctionResult('cash', returnData[i++])[0]
402
- .toString())));
403
- }
404
- }
405
- const usdValues = await Promise.all(usdPromises);
406
- i = 0;
407
- for (const poolAddress of this.cfgInfo.poolAddresses) {
408
- poolLiquidityUSD[poolAddress] = 0;
409
- for (const tokenAddress of this.cfgInfo.pools[poolAddress]
410
- .tokenAddresses) {
411
- poolLiquidityUSD[poolAddress] += usdValues[i++];
412
- }
413
- }
414
- this.poolLiquidityUSD = poolLiquidityUSD;
415
- }
416
- // Returns list of top pools based on liquidity. Max
417
- // limit number pools should be returned.
418
- async getTopPoolsForToken(tokenAddress, limit) {
419
- if (!this.cfgInfo || !this.poolLiquidityUSD)
420
- await this.updatePoolState();
421
- tokenAddress = tokenAddress.toLowerCase();
422
- const pools = this.cfgInfo.poolAddresses.filter(poolAddress => !!this.cfgInfo.pools[poolAddress].tokens[tokenAddress]);
423
- pools.sort((a, b) => this.poolLiquidityUSD[b] - this.poolLiquidityUSD[a]);
424
- return pools.slice(0, limit).map(poolAddress => ({
425
- exchange: this.dexKey,
426
- address: poolAddress,
427
- connectorTokens: this.cfgInfo.pools[poolAddress].tokenAddresses.filter(t => t !== tokenAddress).map(t => ({
428
- decimals: this.cfgInfo.pools[poolAddress].tokens[t].tokenDecimals,
429
- address: t,
430
- })),
431
- liquidityUSD: this.poolLiquidityUSD[poolAddress],
432
- }));
433
- }
434
- }
435
- exports.Platypus = Platypus;
436
- Platypus.erc20Interface = new abi_1.Interface(erc20_json_1.default);
437
- Platypus.poolInterface = new abi_1.Interface(pool_json_1.default);
438
- Platypus.avaxPoolInterface = new abi_1.Interface(avax_pool_json_1.default);
439
- Platypus.assetInterface = new abi_1.Interface(asset_json_1.default);
440
- Platypus.oracleInterface = new abi_1.Interface(oracle_json_1.default);
441
- Platypus.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.PlatypusConfig);
442
- //# sourceMappingURL=platypus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platypus.js","sourceRoot":"","sources":["../../../src/dex/platypus/platypus.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA+C;AAY/C,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAgF;AAGhF,mCAKiB;AACjB,wDAG4B;AAC5B,qCAAoD;AACpD,mDAA0D;AAE1D,iCAAsC;AACtC,2CAA+C;AAC/C,2CAA+C;AAC/C,sEAA4C;AAC5C,6EAAmD;AACnD,uFAA4D;AAC5D,+EAAqD;AACrD,iFAAuD;AAEvD,MAAa,QAAS,SAAQ,gCAAc;IAuB1C,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB,EACrB,WAAW,iBAAQ,CAAC,OAAO,CAAC;QAEtC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALf,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;QACrB,aAAQ,GAAR,QAAQ,CAAoB;QAZ/B,iCAA4B,GAAG,KAAK,CAAC;QACrC,6BAAwB,GAAG,KAAK,CAAC;QAcxC,IAAI,CAAC,MAAM,GAAG,uBAAc,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,kBAA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{ PlatypusAvaxPoolState, PlatypusAvaxPoolConfigInfo } from './types';
4
- import { PlatypusPoolBase } from './pool-base';
5
- export declare class PlatypusAvaxPool extends PlatypusPoolBase<PlatypusAvaxPoolState> {
6
- constructor(dexKey: string, network: number, name: string, poolAddress: Address, poolCfg: PlatypusAvaxPoolConfigInfo, dexHelper: IDexHelper);
7
- computePrices(srcToken: Token, destToken: Token, amounts: bigint[], state: PlatypusAvaxPoolState): bigint[];
8
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatypusAvaxPool = void 0;
4
- const lens_1 = require("../../lens");
5
- const staked_avax_1 = require("../../lib/benqi/staked-avax");
6
- const asset_1 = require("./asset");
7
- const pool_subscriber_1 = require("./pool-subscriber");
8
- const pool_base_1 = require("./pool-base");
9
- class PlatypusAvaxPool extends pool_base_1.PlatypusPoolBase {
10
- constructor(dexKey, network, name, poolAddress, poolCfg, dexHelper) {
11
- super(dexKey, network, name, dexHelper, [
12
- new pool_subscriber_1.PlatypusPoolSubscriber(poolAddress, (0, lens_1.lens)().params, dexHelper.getLogger(`${dexKey}-${network} Params ${name}`)),
13
- new staked_avax_1.StakedAvaxSubscriber(poolCfg.priceOracleAddress, (0, lens_1.lens)().stakedAvax, dexHelper.getLogger(`Staked AVAX for ${dexKey}-${network} ${name}`)),
14
- ...Object.entries(poolCfg.tokens).map(([tokenAddress, c]) => new asset_1.PlatypusAssetSubscriber(c.assetAddress, (0, lens_1.lens)().asset[tokenAddress], dexHelper.getLogger(`${dexKey}-${network} ${c.tokenSymbol} asset ${name}`))),
15
- ], {
16
- params: {
17
- paused: false,
18
- slippageParamK: 0n,
19
- slippageParamN: 0n,
20
- c1: 0n,
21
- xThreshold: 0n,
22
- haircutRate: 0n,
23
- retentionRatio: 0n,
24
- maxPriceDeviation: 0n,
25
- },
26
- asset: {},
27
- stakedAvax: {
28
- totalPooledAvax: 0n,
29
- totalShares: 0n,
30
- },
31
- });
32
- }
33
- computePrices(srcToken, destToken, amounts, state) {
34
- let fromShares;
35
- if (this.dexHelper.config.isWETH(destToken.address)) {
36
- fromShares = true;
37
- }
38
- else if (this.dexHelper.config.isWETH(srcToken.address)) {
39
- fromShares = false;
40
- }
41
- else {
42
- throw new Error(`Unexpected tokens being swapped in ${this.name}`);
43
- }
44
- const sAvaxRate = staked_avax_1.StakedAvaxSubscriber.getPooledAvaxByShares(pool_base_1.WAD, state.stakedAvax);
45
- return amounts.map(fromAmount => {
46
- const idealToAmount = fromShares
47
- ? (0, pool_base_1.wmul)(fromAmount, sAvaxRate)
48
- : (0, pool_base_1.wdiv)(fromAmount, sAvaxRate);
49
- return (0, pool_base_1.calcPrice)(srcToken, destToken, fromAmount, idealToAmount, state);
50
- });
51
- }
52
- }
53
- exports.PlatypusAvaxPool = PlatypusAvaxPool;
54
- //# sourceMappingURL=pool-avax.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-avax.js","sourceRoot":"","sources":["../../../src/dex/platypus/pool-avax.ts"],"names":[],"mappings":";;;AAEA,qCAAkC;AAClC,6DAAmE;AACnE,mCAAkD;AAClD,uDAA2D;AAG3D,2CAA2E;AAE3E,MAAa,gBAAiB,SAAQ,4BAAuC;IAC3E,YACE,MAAc,EACd,OAAe,EACf,IAAY,EACZ,WAAoB,EACpB,OAAmC,EACnC,SAAqB;QAErB,KAAK,CACH,MAAM,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT;YACE,IAAI,wCAAsB,CACxB,WAAW,EACX,IAAA,WAAI,GAAuC,CAAC,MAAM,EAClD,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,OAAO,WAAW,IAAI,EAAE,CAAC,CAC3D;YACD,IAAI,kCAAoB,CACtB,OAAO,CAAC,kBAAkB,EAC1B,IAAA,WAAI,GAAuC,CAAC,UAAU,EACtD,SAAS,CAAC,SAAS,CAAC,mBAAmB,MAAM,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC,CACpE;YACD,GA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AG,CAAC,UAAU,CAAC,EAAE;YAC9B,MAAM,aAAa,GAAG,UAAU;gBAC9B,CAAC,CAAC,IAAA,gBAAI,EAAC,UAAU,EAAE,SAAS,CAAC;gBAC7B,CAAC,CAAC,IAAA,gBAAI,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YAChC,OAAO,IAAA,qBAAS,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjFD,4CAiFC"}
@@ -1,19 +0,0 @@
1
- import { DeepReadonly } from 'ts-essentials';
2
- import { PartialEventSubscriber, ComposedEventSubscriber } from '../../composed-event-subscriber';
3
- import { IDexHelper } from '../../dex-helper/idex-helper';
4
- import { PlatypusPoolStateCommon } from './types';
5
- import { Token } from '../../types';
6
- export declare const ETH_UNIT: bigint;
7
- export declare const WAD: bigint;
8
- export declare const RAY: bigint;
9
- export declare function wmul(x: bigint, y: bigint): bigint;
10
- export declare function wdiv(x: bigint, y: bigint): bigint;
11
- export declare function rmul(x: bigint, y: bigint): bigint;
12
- export declare function rpow(x: bigint, n: bigint): bigint;
13
- export declare function calcPrice(srcToken: Token, destToken: Token, fromAmount: bigint, idealToAmount: bigint, state: PlatypusPoolStateCommon): bigint;
14
- export declare abstract class PlatypusPoolBase<State extends PlatypusPoolStateCommon> extends ComposedEventSubscriber<State> {
15
- readonly dexKey: string;
16
- protected readonly network: number;
17
- constructor(dexKey: string, network: number, name: string, dexHelper: IDexHelper, parts: PartialEventSubscriber<State, any>[], blankState: DeepReadonly<State>);
18
- abstract computePrices(srcToken: Token, destToken: Token, amounts: bigint[], state: State): bigint[];
19
- }
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatypusPoolBase = exports.calcPrice = exports.rpow = exports.rmul = exports.wdiv = exports.wmul = exports.RAY = exports.WAD = exports.ETH_UNIT = void 0;
4
- const composed_event_subscriber_1 = require("../../composed-event-subscriber");
5
- const bigint_constants_1 = require("../../bigint-constants");
6
- exports.ETH_UNIT = bigint_constants_1.BI_POWS[18];
7
- exports.WAD = bigint_constants_1.BI_POWS[18];
8
- exports.RAY = bigint_constants_1.BI_POWS[27];
9
- function wmul(x, y) {
10
- return (x * y + exports.WAD / 2n) / exports.WAD;
11
- }
12
- exports.wmul = wmul;
13
- function wdiv(x, y) {
14
- return (x * exports.WAD + y / 2n) / y;
15
- }
16
- exports.wdiv = wdiv;
17
- function rmul(x, y) {
18
- return (x * y + exports.RAY / 2n) / exports.RAY;
19
- }
20
- exports.rmul = rmul;
21
- function rpow(x, n) {
22
- let z = n % 2n !== 0n ? x : exports.RAY;
23
- for (n /= 2n; n !== 0n; n /= 2n) {
24
- x = rmul(x, x);
25
- if (n % 2n !== 0n) {
26
- z = rmul(z, x);
27
- }
28
- }
29
- return z;
30
- }
31
- exports.rpow = rpow;
32
- function slippageFunc(k, n, c1, xThreshold, x) {
33
- if (x < xThreshold) {
34
- return c1 - x;
35
- }
36
- else {
37
- return wdiv(k, (rpow((x * exports.RAY) / exports.WAD, n) * exports.WAD) / exports.RAY);
38
- }
39
- }
40
- function calcSlippage(k, n, c1, xThreshold, cash, liability, cashChange, addCash) {
41
- const covBefore = wdiv(cash, liability);
42
- let covAfter;
43
- if (addCash) {
44
- covAfter = wdiv(cash + cashChange, liability);
45
- }
46
- else {
47
- covAfter = wdiv(cash - cashChange, liability);
48
- }
49
- if (covBefore === covAfter) {
50
- return 0n;
51
- }
52
- const slippageBefore = slippageFunc(k, n, c1, xThreshold, covBefore);
53
- const slippageAfter = slippageFunc(k, n, c1, xThreshold, covAfter);
54
- if (covBefore > covAfter) {
55
- return wdiv(slippageAfter - slippageBefore, covBefore - covAfter);
56
- }
57
- else {
58
- return wdiv(slippageBefore - slippageAfter, covAfter - covBefore);
59
- }
60
- }
61
- function calcSwappingSlippage(si, sj) {
62
- return exports.WAD + si - sj;
63
- }
64
- function calcHaircut(amount, rate) {
65
- return wmul(amount, rate);
66
- }
67
- function calcPrice(srcToken, destToken, fromAmount, idealToAmount, state) {
68
- if (state.asset[destToken.address].cash < idealToAmount)
69
- return 0n;
70
- const slippageFrom = calcSlippage(state.params.slippageParamK, state.params.slippageParamN, state.params.c1, state.params.xThreshold, state.asset[srcToken.address].cash, state.asset[srcToken.address].liability, fromAmount, true);
71
- const slippageTo = calcSlippage(state.params.slippageParamK, state.params.slippageParamN, state.params.c1, state.params.xThreshold, state.asset[destToken.address].cash, state.asset[destToken.address].liability, idealToAmount, false);
72
- const swappingSlippage = calcSwappingSlippage(slippageFrom, slippageTo);
73
- const toAmount = wmul(idealToAmount, swappingSlippage);
74
- const haircut = calcHaircut(toAmount, state.params.haircutRate);
75
- return toAmount - haircut;
76
- }
77
- exports.calcPrice = calcPrice;
78
- class PlatypusPoolBase extends composed_event_subscriber_1.ComposedEventSubscriber {
79
- constructor(dexKey, network, name, dexHelper, parts, blankState) {
80
- super(dexKey, name, dexHelper.getLogger(`${dexKey}-${network} ${name}`), dexHelper, parts, blankState);
81
- this.dexKey = dexKey;
82
- this.network = network;
83
- }
84
- }
85
- exports.PlatypusPoolBase = PlatypusPoolBase;
86
- //# sourceMappingURL=pool-base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-base.js","sourceRoot":"","sources":["../../../src/dex/platypus/pool-base.ts"],"names":[],"mappings":";;;AACA,+EAGyC;AAIzC,6DAAiD;AAEpC,QAAA,QAAQ,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;AACvB,QAAA,GAAG,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;AAClB,QAAA,GAAG,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;AAE/B,SAAgB,IAAI,CAAC,CAAS,EAAE,CAAS;IACvC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,WAAG,GAAG,EAAE,CAAC,GAAG,WAAG,CAAC;AAClC,CAAC;AAFD,oBAEC;AAED,SAAg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