@paraswap/dex-lib 3.8.13 → 3.8.15

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 (287) hide show
  1. package/.vscode/launch.json +16 -0
  2. package/.vscode/settings.json +3 -0
  3. package/build/abi/Uncompressor.json +250 -0
  4. package/build/abi/concentrator/arUSD5115.json +1746 -0
  5. package/build/abi/fx-protocol/FxMarket.json +1284 -0
  6. package/build/abi/fx-protocol/weETHOralce.json +676 -0
  7. package/build/abi/integral/factory.json +333 -0
  8. package/build/abi/integral/oracle.json +501 -0
  9. package/build/abi/{inception/inception-ineth-pool.json → integral/pool.json} +522 -543
  10. package/build/abi/integral/relayer.json +1536 -0
  11. package/build/abi/maverick-v2/MaverickV2Router.json +778 -0
  12. package/build/dex/aave-v1/aave-v1.d.ts +1 -2
  13. package/build/dex/aave-v1/aave-v1.js +0 -22
  14. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  15. package/build/dex/bProtocol.d.ts +18 -0
  16. package/build/dex/bProtocol.js +39 -0
  17. package/build/dex/bProtocol.js.map +1 -0
  18. package/build/dex/bancor.d.ts +26 -0
  19. package/build/dex/bancor.js +58 -0
  20. package/build/dex/bancor.js.map +1 -0
  21. package/build/dex/compound.d.ts +18 -0
  22. package/build/dex/compound.js +46 -0
  23. package/build/dex/compound.js.map +1 -0
  24. package/build/dex/concentrator-arusd/concentrator-arusd-event.d.ts +17 -0
  25. package/build/dex/concentrator-arusd/concentrator-arusd-event.js +66 -0
  26. package/build/dex/concentrator-arusd/concentrator-arusd-event.js.map +1 -0
  27. package/build/dex/concentrator-arusd/concentrator-arusd.d.ts +6 -3
  28. package/build/dex/concentrator-arusd/concentrator-arusd.js +45 -41
  29. package/build/dex/concentrator-arusd/concentrator-arusd.js.map +1 -1
  30. package/build/dex/concentrator-arusd/config.d.ts +1 -2
  31. package/build/dex/concentrator-arusd/config.js +2 -6
  32. package/build/dex/concentrator-arusd/config.js.map +1 -1
  33. package/build/dex/concentrator-arusd/types.d.ts +7 -3
  34. package/build/dex/concentrator-arusd/utils.d.ts +4 -0
  35. package/build/dex/concentrator-arusd/utils.js +27 -0
  36. package/build/dex/concentrator-arusd/utils.js.map +1 -0
  37. package/build/dex/curve-v2.d.ts +58 -0
  38. package/build/dex/curve-v2.js +180 -0
  39. package/build/dex/curve-v2.js.map +1 -0
  40. package/build/dex/dodo-v1.d.ts +33 -0
  41. package/build/dex/dodo-v1.js +63 -0
  42. package/build/dex/dodo-v1.js.map +1 -0
  43. package/build/dex/etherfi/etherfi.d.ts +26 -0
  44. package/build/dex/etherfi/etherfi.js +96 -0
  45. package/build/dex/etherfi/etherfi.js.map +1 -0
  46. package/build/dex/fx-protocol-rusd/config.d.ts +1 -2
  47. package/build/dex/fx-protocol-rusd/config.js +3 -6
  48. package/build/dex/fx-protocol-rusd/config.js.map +1 -1
  49. package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.d.ts +18 -0
  50. package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.js +71 -0
  51. package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.js.map +1 -0
  52. package/build/dex/fx-protocol-rusd/fx-protocol-rusd.d.ts +10 -10
  53. package/build/dex/fx-protocol-rusd/fx-protocol-rusd.js +75 -70
  54. package/build/dex/fx-protocol-rusd/fx-protocol-rusd.js.map +1 -1
  55. package/build/dex/fx-protocol-rusd/types.d.ts +6 -3
  56. package/build/dex/fx-protocol-rusd/utils.d.ts +4 -0
  57. package/build/dex/fx-protocol-rusd/utils.js +26 -0
  58. package/build/dex/fx-protocol-rusd/utils.js.map +1 -0
  59. package/build/dex/index.js +4 -0
  60. package/build/dex/index.js.map +1 -1
  61. package/build/dex/{infusion → integral}/config.d.ts +1 -1
  62. package/build/dex/integral/config.js +20 -0
  63. package/build/dex/integral/config.js.map +1 -0
  64. package/build/dex/integral/context.d.ts +40 -0
  65. package/build/dex/integral/context.js +158 -0
  66. package/build/dex/integral/context.js.map +1 -0
  67. package/build/dex/integral/helpers.d.ts +17 -0
  68. package/build/dex/integral/helpers.js +157 -0
  69. package/build/dex/integral/helpers.js.map +1 -0
  70. package/build/dex/integral/integral-factory.d.ts +24 -0
  71. package/build/dex/integral/integral-factory.js +95 -0
  72. package/build/dex/integral/integral-factory.js.map +1 -0
  73. package/build/dex/integral/integral-pool.d.ts +50 -0
  74. package/build/dex/integral/integral-pool.js +149 -0
  75. package/build/dex/integral/integral-pool.js.map +1 -0
  76. package/build/dex/integral/integral-pricing.d.ts +18 -0
  77. package/build/dex/integral/integral-pricing.js +114 -0
  78. package/build/dex/integral/integral-pricing.js.map +1 -0
  79. package/build/dex/integral/integral-relayer.d.ts +42 -0
  80. package/build/dex/integral/integral-relayer.js +192 -0
  81. package/build/dex/integral/integral-relayer.js.map +1 -0
  82. package/build/dex/integral/integral-token.d.ts +27 -0
  83. package/build/dex/integral/integral-token.js +59 -0
  84. package/build/dex/integral/integral-token.js.map +1 -0
  85. package/build/dex/{inception/inception-native.d.ts → integral/integral.d.ts} +19 -21
  86. package/build/dex/integral/integral.js +377 -0
  87. package/build/dex/integral/integral.js.map +1 -0
  88. package/build/dex/integral/types.d.ts +84 -0
  89. package/build/dex/integral/types.js +9 -0
  90. package/build/dex/integral/types.js.map +1 -0
  91. package/build/dex/integral/utils-e2e.d.ts +9 -0
  92. package/build/dex/integral/utils-e2e.js +131 -0
  93. package/build/dex/integral/utils-e2e.js.map +1 -0
  94. package/build/dex/integral/utils.d.ts +17 -0
  95. package/build/dex/integral/utils.js +94 -0
  96. package/build/dex/integral/utils.js.map +1 -0
  97. package/build/dex/lido.d.ts +19 -0
  98. package/build/dex/lido.js +42 -0
  99. package/build/dex/lido.js.map +1 -0
  100. package/build/dex/onebit.d.ts +25 -0
  101. package/build/dex/onebit.js +42 -0
  102. package/build/dex/onebit.js.map +1 -0
  103. package/build/dex/oswap/oswap.js +4 -1
  104. package/build/dex/oswap/oswap.js.map +1 -1
  105. package/build/dex/platypus/platypus.d.ts +1 -2
  106. package/build/dex/platypus/platypus.js +0 -31
  107. package/build/dex/platypus/platypus.js.map +1 -1
  108. package/build/dex/sdai/config.d.ts +11 -0
  109. package/build/dex/sdai/config.js +21 -0
  110. package/build/dex/sdai/config.js.map +1 -0
  111. package/build/dex/sdai/constants.d.ts +2 -0
  112. package/build/dex/sdai/constants.js +6 -0
  113. package/build/dex/sdai/constants.js.map +1 -0
  114. package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
  115. package/build/dex/sdai/scripts/validate-state.js +102 -0
  116. package/build/dex/sdai/scripts/validate-state.js.map +1 -0
  117. package/build/dex/sdai/sdai-pool.d.ts +16 -0
  118. package/build/dex/sdai/sdai-pool.js +85 -0
  119. package/build/dex/sdai/sdai-pool.js.map +1 -0
  120. package/build/dex/sdai/sdai.d.ts +51 -0
  121. package/build/dex/sdai/sdai.js +172 -0
  122. package/build/dex/sdai/sdai.js.map +1 -0
  123. package/build/dex/sdai/types.d.ts +21 -0
  124. package/build/dex/sdai/types.js +11 -0
  125. package/build/dex/sdai/types.js.map +1 -0
  126. package/build/dex/sdai/utils.d.ts +4 -0
  127. package/build/dex/sdai/utils.js +39 -0
  128. package/build/dex/sdai/utils.js.map +1 -0
  129. package/build/dex/smoothy.d.ts +26 -0
  130. package/build/dex/smoothy.js +48 -0
  131. package/build/dex/smoothy.js.map +1 -0
  132. package/build/dex/stable-pool.d.ts +28 -0
  133. package/build/dex/stable-pool.js +62 -0
  134. package/build/dex/stable-pool.js.map +1 -0
  135. package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
  136. package/build/dex/swaap-v1/swaap-v1.js +0 -10
  137. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  138. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  139. package/build/dex/trader-joe-v2.1.js +79 -0
  140. package/build/dex/trader-joe-v2.1.js.map +1 -0
  141. package/build/executor/Executor01BytecodeBuilder.js +4 -5
  142. package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
  143. package/build/executor/Executor02BytecodeBuilder.js +2 -3
  144. package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
  145. package/build/executor/Executor03BytecodeBuilder.js +24 -14
  146. package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
  147. package/build/executor/compressor/Compressor.d.ts +23 -0
  148. package/build/executor/compressor/Compressor.js +144 -0
  149. package/build/executor/compressor/Compressor.js.map +1 -0
  150. package/build/executor/compressor/compress.d.ts +17 -0
  151. package/build/executor/compressor/compress.js +187 -0
  152. package/build/executor/compressor/compress.js.map +1 -0
  153. package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
  154. package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
  155. package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
  156. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
  157. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
  158. package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
  159. package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
  160. package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
  161. package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
  162. package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
  163. package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
  164. package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
  165. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
  166. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
  167. package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
  168. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
  169. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
  170. package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
  171. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
  172. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
  173. package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
  174. package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
  175. package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
  176. package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
  177. package/build/executor/compressor/fetchSaved.d.ts +0 -0
  178. package/build/executor/compressor/fetchSaved.js +17 -0
  179. package/build/executor/compressor/fetchSaved.js.map +1 -0
  180. package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
  181. package/build/executor/compressor/utils/computeCostL2.js +14 -0
  182. package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
  183. package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
  184. package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
  185. package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
  186. package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
  187. package/build/executor/compressor/utils/getAllIndexes.js +12 -0
  188. package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
  189. package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
  190. package/build/executor/compressor/utils/getByteForAddress.js +14 -0
  191. package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
  192. package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
  193. package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
  194. package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
  195. package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
  196. package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
  197. package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
  198. package/build/executor/compressor/utils/intToByte.d.ts +2 -0
  199. package/build/executor/compressor/utils/intToByte.js +10 -0
  200. package/build/executor/compressor/utils/intToByte.js.map +1 -0
  201. package/build/generic-swap-transaction-builder.d.ts +1 -1
  202. package/build/generic-swap-transaction-builder.js +10 -10
  203. package/build/generic-swap-transaction-builder.js.map +1 -1
  204. package/package.json +1 -1
  205. package/src/abi/concentrator/arUSD.json +568 -0
  206. package/src/abi/concentrator/arUSD5115.json +1746 -0
  207. package/src/abi/fx-protocol/FxMarket.json +1284 -0
  208. package/src/abi/fx-protocol/FxUSD.json +1227 -0
  209. package/src/abi/fx-protocol/weETHOralce.json +676 -0
  210. package/src/dex/concentrator-arusd/concentrator-arusd-e2e.test.ts +92 -0
  211. package/src/dex/concentrator-arusd/concentrator-arusd-event.ts +100 -0
  212. package/src/dex/concentrator-arusd/concentrator-arusd-integration.test.ts +104 -0
  213. package/src/dex/concentrator-arusd/concentrator-arusd.ts +269 -0
  214. package/src/dex/concentrator-arusd/concetrator-arusd-events.test.ts +97 -0
  215. package/src/dex/concentrator-arusd/config.ts +13 -0
  216. package/src/dex/concentrator-arusd/types.ts +16 -0
  217. package/src/dex/concentrator-arusd/utils.ts +36 -0
  218. package/src/dex/fx-protocol-rusd/config.ts +14 -0
  219. package/src/dex/fx-protocol-rusd/fx-protocol-e2e.test.ts +96 -0
  220. package/src/dex/fx-protocol-rusd/fx-protocol-events.test.ts +101 -0
  221. package/src/dex/fx-protocol-rusd/fx-protocol-integration.test.ts +104 -0
  222. package/src/dex/fx-protocol-rusd/fx-protocol-rusd-event.ts +112 -0
  223. package/src/dex/fx-protocol-rusd/fx-protocol-rusd.ts +282 -0
  224. package/src/dex/fx-protocol-rusd/types.ts +16 -0
  225. package/src/dex/fx-protocol-rusd/utils.ts +47 -0
  226. package/src/dex/index.ts +4 -0
  227. package/src/dex/wsteth/wsteth-integration.test.ts +0 -1
  228. package/src/executor/Executor01BytecodeBuilder.ts +4 -8
  229. package/src/executor/Executor02BytecodeBuilder.ts +2 -7
  230. package/src/executor/Executor03BytecodeBuilder.ts +34 -19
  231. package/src/generic-swap-transaction-builder.ts +3 -5
  232. package/tests/constants-e2e.ts +10 -0
  233. package/build/abi/inception/inception-ineth.json +0 -609
  234. package/build/abi/inception/inception-ratio-feed.json +0 -93
  235. package/build/abi/inception/inception-vault.json +0 -991
  236. package/build/abi/infusion/InfusionFactory.json +0 -147
  237. package/build/abi/infusion/InfusionPair.json +0 -658
  238. package/build/abi/infusion/InfusionRouter.json +0 -442
  239. package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
  240. package/build/dex/idle-dao/idle-dao-pool.js +0 -176
  241. package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
  242. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
  243. package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
  244. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
  245. package/build/dex/idle-dao/scripts.d.ts +0 -9
  246. package/build/dex/idle-dao/scripts.js +0 -552
  247. package/build/dex/idle-dao/scripts.js.map +0 -1
  248. package/build/dex/inception/config.d.ts +0 -5
  249. package/build/dex/inception/config.js +0 -112
  250. package/build/dex/inception/config.js.map +0 -1
  251. package/build/dex/inception/inception-event-pool.d.ts +0 -23
  252. package/build/dex/inception/inception-event-pool.js +0 -34
  253. package/build/dex/inception/inception-event-pool.js.map +0 -1
  254. package/build/dex/inception/inception-native.js +0 -131
  255. package/build/dex/inception/inception-native.js.map +0 -1
  256. package/build/dex/inception/inception-pool.d.ts +0 -18
  257. package/build/dex/inception/inception-pool.js +0 -32
  258. package/build/dex/inception/inception-pool.js.map +0 -1
  259. package/build/dex/inception/inception-price-feed.d.ts +0 -19
  260. package/build/dex/inception/inception-price-feed.js +0 -51
  261. package/build/dex/inception/inception-price-feed.js.map +0 -1
  262. package/build/dex/inception/inception.d.ts +0 -44
  263. package/build/dex/inception/inception.js +0 -162
  264. package/build/dex/inception/inception.js.map +0 -1
  265. package/build/dex/inception/tokens.d.ts +0 -9
  266. package/build/dex/inception/tokens.js +0 -28
  267. package/build/dex/inception/tokens.js.map +0 -1
  268. package/build/dex/inception/types.d.ts +0 -22
  269. package/build/dex/inception/types.js +0 -3
  270. package/build/dex/inception/types.js.map +0 -1
  271. package/build/dex/inception/utils.d.ts +0 -7
  272. package/build/dex/inception/utils.js +0 -58
  273. package/build/dex/inception/utils.js.map +0 -1
  274. package/build/dex/infusion/config.js +0 -25
  275. package/build/dex/infusion/config.js.map +0 -1
  276. package/build/dex/infusion/infusion-stable-pool.d.ts +0 -4
  277. package/build/dex/infusion/infusion-stable-pool.js +0 -74
  278. package/build/dex/infusion/infusion-stable-pool.js.map +0 -1
  279. package/build/dex/infusion/infusion.d.ts +0 -54
  280. package/build/dex/infusion/infusion.js +0 -532
  281. package/build/dex/infusion/infusion.js.map +0 -1
  282. package/build/dex/infusion/types.d.ts +0 -47
  283. package/build/dex/infusion/types.js +0 -3
  284. package/build/dex/infusion/types.js.map +0 -1
  285. package/build/dex/infusion/utils/isStablePair.d.ts +0 -2
  286. package/build/dex/infusion/utils/isStablePair.js +0 -18
  287. package/build/dex/infusion/utils/isStablePair.js.map +0 -1
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Adapters = exports.InceptionPricePoolConfig = exports.InceptionConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.InceptionConfig = {
6
- InceptionLRT: {
7
- [constants_1.Network.MAINNET]: [
8
- {
9
- symbol: 'instETH',
10
- token: '0x7FA768E035F956c41d6aeaa3Bd857e7E5141CAd5',
11
- vault: '0x814CC6B8fd2555845541FB843f37418b05977d8d',
12
- baseToken: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
13
- baseTokenSlug: 'STETH',
14
- },
15
- {
16
- symbol: 'inrETH',
17
- token: '0x80d69e79258FE9D056c822461c4eb0B4ca8802E2',
18
- vault: '0x1Aa53BC4Beb82aDf7f5EDEE9e3bBF3434aD59F12',
19
- baseToken: '0xae78736Cd615f374D3085123A210448E74Fc6393',
20
- baseTokenSlug: 'rETH',
21
- },
22
- {
23
- symbol: 'inoETH',
24
- token: '0x9181f633e9b9f15a32d5e37094f4c93b333e0e92',
25
- vault: '0x4878F636A9Aa314B776Ac51A25021C44CAF86bEd',
26
- baseToken: '0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3',
27
- baseTokenSlug: 'oETH',
28
- },
29
- {
30
- symbol: 'inosETH',
31
- token: '0xfD07fD5EBEa6F24888a397997E262179Bf494336',
32
- vault: '0xA9F8c770661BeE8DF2D026edB1Cb6FF763C780FF',
33
- baseToken: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38',
34
- baseTokenSlug: 'osETH',
35
- },
36
- {
37
- symbol: 'inankrETH',
38
- token: '0xfa2629B9cF3998D52726994E0FcdB750224D8B9D',
39
- vault: '0x36B429439AB227fAB170A4dFb3321741c8815e55',
40
- baseToken: '0xE95A203B1a91a908F9B9CE46459d101078c2c3cb',
41
- baseTokenSlug: 'AnkETH',
42
- },
43
- {
44
- symbol: 'incbETH',
45
- token: '0xbf19eead55a6b100667f04f8fbc5371e03e8ab2e',
46
- vault: '0xfE715358368416E01d3A961D3a037b7359735d5e',
47
- baseToken: '0xBe9895146f7AF43049ca1c1AE358B0541Ea49704',
48
- baseTokenSlug: 'cbETH',
49
- },
50
- {
51
- symbol: 'inwbETH',
52
- token: '0xda9b11cd701e10c2ec1a284f80820edd128c5246',
53
- vault: '0xC0660932C5dCaD4A1409b7975d147203B1e9A2B6',
54
- baseToken: '0xa2E3356610840701BDf5611a53974510Ae27E2e1',
55
- baseTokenSlug: 'wbETH',
56
- },
57
- {
58
- symbol: 'inswETH',
59
- token: '0xc3ade5ace1bbb033ccae8177c12ecbfa16bd6a9d',
60
- vault: '0xc4181dC7BB31453C4A48689ce0CBe975e495321c',
61
- baseToken: '0xf951E335afb289353dc249e82926178EaC7DEd78',
62
- baseTokenSlug: 'SWETH',
63
- },
64
- {
65
- symbol: 'inETHx',
66
- token: '0x57a5a0567187ff4a8dcc1a9bba86155e355878f2',
67
- vault: '0x90E80E25ABDB6205B08DeBa29a87f7eb039023C2',
68
- baseToken: '0xA35b1B31Ce002FBF2058D22F30f95D405200A15b',
69
- baseTokenSlug: 'ETHx',
70
- },
71
- {
72
- symbol: 'insfrxETH',
73
- token: '0x668308d77be3533c909a692302cb4d135bf8041c',
74
- vault: '0x295234B7E370a5Db2D2447aCA83bc7448f151161',
75
- baseToken: '0xac3E018457B222d93114458476f3E3416Abbe38F',
76
- baseTokenSlug: 'sfrxETH',
77
- },
78
- {
79
- symbol: 'inmETH',
80
- token: '0xeCf3672A6d2147E2A77f07069Fb48d8Cf6F6Fbf9',
81
- vault: '0xd0ee89d82183D7Ddaef14C6b4fC0AA742F426355',
82
- baseToken: '0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa',
83
- baseTokenSlug: 'mETH',
84
- },
85
- {
86
- symbol: 'inlsETH',
87
- token: '0x94b888e11a9e960a9c3b3528eb6ac807b27ca62e',
88
- vault: '0x6E17a8b5D33e6DBdB9fC61d758BF554b6AD93322',
89
- baseToken: '0x8c1BEd5b9a0928467c9B1341Da1D7BD5e10b6549',
90
- baseTokenSlug: 'lsETH',
91
- },
92
- {
93
- symbol: 'inETH',
94
- token: '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C',
95
- vault: '0x46199cAa0e453971cedf97f926368d9E5415831a',
96
- baseToken: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
97
- baseTokenSlug: 'ETH',
98
- },
99
- ],
100
- },
101
- };
102
- exports.InceptionPricePoolConfig = {
103
- InceptionLRT: {
104
- [constants_1.Network.MAINNET]: {
105
- ratioFeed: '0xFd73Be536503B5Aa80Bf99D1Fd65b1306c69B191',
106
- },
107
- },
108
- };
109
- exports.Adapters = {
110
- [constants_1.Network.MAINNET]: { [constants_1.SwapSide.SELL]: [{ name: '', index: 0 }] },
111
- };
112
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/inception/config.ts"],"names":[],"mappings":";;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Aa,EAAE,OAAO;aACvB;YACD;gBACE,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,MAAM;aACtB;YACD;gBACE,MAAM,EAAE,WAAW;gBACnB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,SAAS;aACzB;YACD;gBACE,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,MAAM;aACtB;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,OAAO;aACvB;YACD;gBACE,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,KAAK;aACrB;SACF;KACF;CACF,CAAC;AAEW,QAAA,wBAAwB,GAAkC;IACrE,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,SAAS,EAAE,4CAA4C;SACxD;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE;CACjE,CAAC"}
@@ -1,23 +0,0 @@
1
- import { Logger } from '../../types';
2
- import { ComposedEventSubscriber } from '../../composed-event-subscriber';
3
- import { IDexHelper } from '../../dex-helper/idex-helper';
4
- import { PoolConfig, PoolState } from './types';
5
- import { Interface } from '@ethersproject/abi';
6
- export declare class InceptionEventPool extends ComposedEventSubscriber<PoolState> {
7
- protected network: number;
8
- protected dexHelper: IDexHelper;
9
- poolConfig: PoolConfig;
10
- poolInterface: Interface;
11
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, poolConfig: PoolConfig, poolInterface: Interface);
12
- getIdentifier(): string;
13
- /**
14
- * The function generates state using on-chain calls. This
15
- * function is called to regenerate state if the event based
16
- * system fails to fetch events and the local state is no
17
- * more correct.
18
- * @param blockNumber - Blocknumber for which the state should
19
- * should be generated
20
- * @returns state of the event subscriber at blocknumber
21
- */
22
- generateState(blockNumber: number): Promise<Readonly<PoolState>>;
23
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InceptionEventPool = void 0;
4
- const composed_event_subscriber_1 = require("../../composed-event-subscriber");
5
- const lens_1 = require("../../lens");
6
- const utils_1 = require("./utils");
7
- const inception_price_feed_1 = require("./inception-price-feed");
8
- class InceptionEventPool extends composed_event_subscriber_1.ComposedEventSubscriber {
9
- constructor(parentName, network, dexHelper, logger, poolConfig, poolInterface) {
10
- const ratioFeedEvent = new inception_price_feed_1.InceptionPriceFeed(poolConfig.ratioFeedAddress, network, (0, lens_1.lens)(), logger);
11
- super(parentName, 'pool', logger, dexHelper, [ratioFeedEvent], poolConfig.initState);
12
- this.network = network;
13
- this.dexHelper = dexHelper;
14
- this.poolConfig = poolConfig;
15
- this.poolInterface = poolInterface;
16
- }
17
- getIdentifier() {
18
- return `${this.parentName}_${this.poolConfig.ratioFeedAddress}`.toLowerCase();
19
- }
20
- /**
21
- * The function generates state using on-chain calls. This
22
- * function is called to regenerate state if the event based
23
- * system fails to fetch events and the local state is no
24
- * more correct.
25
- * @param blockNumber - Blocknumber for which the state should
26
- * should be generated
27
- * @returns state of the event subscriber at blocknumber
28
- */
29
- async generateState(blockNumber) {
30
- return (0, utils_1.getOnChainState)(this.dexHelper.multiContract, this.poolInterface, this.network, blockNumber);
31
- }
32
- }
33
- exports.InceptionEventPool = InceptionEventPool;
34
- //# sourceMappingURL=inception-event-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inception-event-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-event-pool.ts"],"names":[],"mappings":";;;AAEA,+EAA0E;AAE1E,qCAAkC;AAElC,mCAA0C;AAE1C,iEAA4D;AAE5D,MAAa,kBAAmB,SAAQ,mDAAkC;IACxE,YACE,UAAkB,EACR,OAAe,EACf,SAAqB,EAC/B,MAAc,EACP,UAAsB,EACtB,aAAwB;QAE/B,MAAM,cAAc,GAAG,IAAI,yCAAkB,CAC3C,UAAU,CAAC,gBAAgB,EAC3B,OAAO,EACP,IAAA,WAAI,GAA2B,EAC/B,MAAM,CACP,CAAC;QACF,KAAK,CACH,UAAU,EACV,MAAM,EACN,MAAM,EACN,SAAS,EACT,CAAC,cAAc,CAAC,EAChB,UAAU,CAAC,SAAS,CACrB,CAAC;QAnBQ,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAExB,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa,CAAW;IAgBjC,CAAC;IAED,aAAa;QACX,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,WAAW,EAAE,CAAC;IAChF,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,IAAA,uBAAe,EACpB,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AA9CD,gDA8CC"}
@@ -1,131 +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.InceptionNative = exports.depositETHFunction = void 0;
30
- const abi_1 = require("@ethersproject/abi");
31
- const inception_ineth_json_1 = __importDefault(require("../../abi/inception/inception-ineth.json"));
32
- const inception_ineth_pool_json_1 = __importDefault(require("../../abi/inception/inception-ineth-pool.json"));
33
- const constants_1 = require("../../constants");
34
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
35
- const utils_1 = require("../../utils");
36
- const simple_exchange_1 = require("../simple-exchange");
37
- const config_1 = require("./config");
38
- const inception_pool_1 = require("./inception-pool");
39
- const ethers_1 = require("ethers");
40
- const bigint_constants_1 = require("../../bigint-constants");
41
- exports.depositETHFunction = 'stake()';
42
- class InceptionNative extends simple_exchange_1.SimpleExchange {
43
- constructor(network, dexKey, dexHelper, config = config_1.InceptionNativeConfig[dexKey][network], adapters = config_1.Adapters[network] || {}) {
44
- super(dexHelper, dexKey);
45
- this.network = network;
46
- this.dexKey = dexKey;
47
- this.dexHelper = dexHelper;
48
- this.config = config;
49
- this.adapters = adapters;
50
- this.hasConstantPriceLargeAmounts = false;
51
- this.needWrapNative = false;
52
- this.isFeeOnTransferSupported = false;
53
- this.logger = dexHelper.getLogger(dexKey);
54
- this.vaultInterface = new abi_1.Interface(inception_ineth_pool_json_1.default);
55
- this.tokenInterface = new abi_1.Interface(inception_ineth_json_1.default);
56
- this.inceptionPool = new inception_pool_1.InceptionPool(this.dexKey, network, dexHelper, this.logger, this.config.token, this.tokenInterface);
57
- }
58
- async initializePricing(blockNumber) {
59
- const data = await this.dexHelper.multiContract.methods
60
- .aggregate([
61
- {
62
- target: this.config.token,
63
- callData: this.tokenInterface.encodeFunctionData('ratio', []),
64
- },
65
- ])
66
- .call({}, blockNumber);
67
- const decodedData = data.returnData.map(d => ethers_1.ethers.utils.defaultAbiCoder.decode(['uint256'], d));
68
- const [ratio] = decodedData.map(d => BigInt(d[0].toString()));
69
- await Promise.all([
70
- this.inceptionPool.initialize(blockNumber, {
71
- state: { ratio },
72
- }),
73
- ]);
74
- }
75
- getAdapters(side) {
76
- return this.adapters[side] ? this.adapters[side] : null;
77
- }
78
- async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
79
- return [`ETH_${destToken.address}`.toLowerCase()];
80
- }
81
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
82
- const pool = this.inceptionPool;
83
- if (!pool.getState(blockNumber))
84
- return null;
85
- const unitIn = bigint_constants_1.BI_POWS[18];
86
- const unitOut = pool.getPrice(blockNumber, unitIn);
87
- const amountsOut = amounts.map(amountIn => pool.getPrice(blockNumber, amountIn));
88
- return [
89
- {
90
- prices: amountsOut,
91
- unit: unitOut,
92
- data: {
93
- ratio: unitOut,
94
- },
95
- exchange: this.dexKey,
96
- poolIdentifier: `ETH_${destToken.address}`.toLowerCase(),
97
- gasCost: 120000,
98
- poolAddresses: [this.config.vault],
99
- },
100
- ];
101
- }
102
- getCalldataGasCost(poolPrices) {
103
- return CALLDATA_GAS_COST.DEX_OVERHEAD + CALLDATA_GAS_COST.LENGTH_SMALL;
104
- }
105
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
106
- return {
107
- targetExchange: constants_1.NULL_ADDRESS,
108
- payload: '0x',
109
- networkFee: '0',
110
- };
111
- }
112
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
113
- const swapData = this.vaultInterface.encodeFunctionData(exports.depositETHFunction, []);
114
- return {
115
- needWrapNative: this.needWrapNative,
116
- dexFuncHasRecipient: false,
117
- exchangeData: swapData,
118
- targetExchange: this.config.vault,
119
- swappedAmountNotPresentInExchangeData: true,
120
- returnAmountPos: undefined,
121
- };
122
- }
123
- async updatePoolState() { }
124
- async getTopPoolsForToken(tokenAddress, limit) {
125
- return [];
126
- }
127
- releaseResources() { }
128
- }
129
- exports.InceptionNative = InceptionNative;
130
- InceptionNative.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.InceptionNativeConfig);
131
- //# sourceMappingURL=inception-native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inception-native.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAa7D,oGAAiE;AACjE,8GAA4E;AAC5E,+CAAwD;AACxD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2D;AAC3D,qDAAiD;AACjD,mCAAgC;AAChC,6DAAiD;AAEpC,QAAA,kBAAkB,GAAG,SAAS,CAAC;AAE5C,MAAa,eACX,SAAQ,gCAAc;IAetB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,SAAS,8BAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC/C,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAA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AAS,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE;gBACxD,OAAO,EAAE,MAAO;gBAChB,aAAa,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;aACnC;SACF,CAAC;IACJ,CAAC;IAED,kBAAkB,CAAC,UAAqC;QACtD,OAAO,iBAAiB,CAAC,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC;IACzE,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,wBAAY;YAC5B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,WAAW,CACT,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,SAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACrD,0BAAkB,EAClB,EAAE,CACH,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,mBAAmB,EAAE,KAAK;YAC1B,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;YACjC,qCAAqC,EAAE,IAAI;YAC3C,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,eAAe,KAAmB,CAAC;IAEzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gBAAgB,KAAuB,CAAC;;AA7J1C,0CA8JC;AAnJe,kCAAkB,GAC9B,IAAA,6BAAqB,EAAC,8BAAqB,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { DeepReadonly } from 'ts-essentials';
3
- import { Log, Logger } from '../../types';
4
- import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
5
- import { IDexHelper } from '../../dex-helper/idex-helper';
6
- import { PoolState } from './types';
7
- export declare class InceptionPool extends StatefulEventSubscriber<PoolState> {
8
- readonly parentName: string;
9
- protected network: number;
10
- protected dexHelper: IDexHelper;
11
- protected vault: string;
12
- protected inceptionIface: Interface;
13
- logDecoder: (log: Log) => any;
14
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, vault: string, inceptionIface: Interface);
15
- protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
16
- generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
17
- getPrice(blockNumber: number, ethAmount: bigint): bigint;
18
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InceptionPool = void 0;
4
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
5
- const utils_1 = require("./utils");
6
- const bigint_constants_1 = require("../../bigint-constants");
7
- class InceptionPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
8
- constructor(parentName, network, dexHelper, logger, vault, inceptionIface) {
9
- super(parentName, 'inception_pool', dexHelper, logger);
10
- this.parentName = parentName;
11
- this.network = network;
12
- this.dexHelper = dexHelper;
13
- this.vault = vault;
14
- this.inceptionIface = inceptionIface;
15
- this.logDecoder = (log) => this.inceptionIface.parseLog(log);
16
- }
17
- processLog(state, log) {
18
- return state;
19
- }
20
- async generateState(blockNumber) {
21
- const state = await (0, utils_1.getOnChainRatio)(this.dexHelper.multiContract, this.vault, this.inceptionIface, blockNumber);
22
- return state;
23
- }
24
- getPrice(blockNumber, ethAmount) {
25
- const state = this.getState(blockNumber);
26
- if (!state)
27
- throw new Error('Cannot compute price');
28
- return (ethAmount * state.ratio) / bigint_constants_1.BI_POWS[18];
29
- }
30
- }
31
- exports.InceptionPool = InceptionPool;
32
- //# sourceMappingURL=inception-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inception-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-pool.ts"],"names":[],"mappings":";;;AAGA,+EAA0E;AAG1E,mCAA0C;AAC1C,6DAAiD;AAEjD,MAAa,aAAc,SAAQ,mDAAkC;IAGnE,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,KAAa,EACb,cAAyB;QAEnC,KAAK,CAAC,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAP9C,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,UAAK,GAAL,KAAK,CAAQ;QACb,mBAAc,GAAd,cAAc,CAAW;QAInC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC;IAES,UAAU,CAClB,KAA8B,EAC9B,GAAkB;QAElB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,MAAM,KAAK,GAAG,MAAM,IAAA,uBAAe,EACjC,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,cAAc,EACnB,WAAW,CACZ,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,WAAmB,EAAE,SAAiB;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAEpD,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAxCD,sCAwCC"}
@@ -1,19 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { DeepReadonly } from 'ts-essentials';
3
- import { PartialEventSubscriber } from '../../composed-event-subscriber';
4
- import { Address, BlockHeader, Log, Logger, MultiCallInput, MultiCallOutput } from '../../types';
5
- import { Lens } from '../../lens';
6
- import { PoolState } from './types';
7
- import { Network } from '../../constants';
8
- export declare class InceptionPriceFeed<State> extends PartialEventSubscriber<State, PoolState> {
9
- private ratioFeedAddress;
10
- private network;
11
- protected ratioFeedInterface: Interface;
12
- constructor(ratioFeedAddress: Address, network: Network, lens: Lens<DeepReadonly<State>, DeepReadonly<PoolState>>, logger: Logger);
13
- getRatio(state: DeepReadonly<State>): {
14
- readonly ratio: bigint;
15
- };
16
- processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>, blockHeader: Readonly<BlockHeader>): DeepReadonly<PoolState> | null;
17
- getGenerateStateMultiCallInputs(): MultiCallInput[];
18
- generateState(multicallOutputs: MultiCallOutput[], blockNumber?: number | 'latest'): DeepReadonly<PoolState>;
19
- }
@@ -1,51 +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.InceptionPriceFeed = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const abi_1 = require("@ethersproject/abi");
9
- const composed_event_subscriber_1 = require("../../composed-event-subscriber");
10
- const inception_ratio_feed_json_1 = __importDefault(require("../../abi/inception/inception-ratio-feed.json"));
11
- const tokens_1 = require("./tokens");
12
- class InceptionPriceFeed extends composed_event_subscriber_1.PartialEventSubscriber {
13
- constructor(ratioFeedAddress, network, lens, logger) {
14
- super([ratioFeedAddress], lens, logger);
15
- this.ratioFeedAddress = ratioFeedAddress;
16
- this.network = network;
17
- this.ratioFeedInterface = new abi_1.Interface(inception_ratio_feed_json_1.default);
18
- }
19
- getRatio(state) {
20
- return this.lens.get()(state).ratio;
21
- }
22
- processLog(state, log, blockHeader) {
23
- try {
24
- const parsed = this.ratioFeedInterface.parseLog(log);
25
- const _state = lodash_1.default.cloneDeep(state);
26
- switch (parsed.name) {
27
- case 'RatioUpdated': {
28
- const tokenInfo = (0, tokens_1.getTokenFromAddress)(this.network, parsed.args[0]);
29
- _state[tokenInfo.symbol.toLowerCase()] = {
30
- ratio: BigInt(parsed.args[2].toString()),
31
- };
32
- return _state;
33
- }
34
- default:
35
- return null;
36
- }
37
- }
38
- catch (e) {
39
- this.logger.error('Failed to parse log', e);
40
- return null;
41
- }
42
- }
43
- getGenerateStateMultiCallInputs() {
44
- return [];
45
- }
46
- generateState(multicallOutputs, blockNumber) {
47
- return {};
48
- }
49
- }
50
- exports.InceptionPriceFeed = InceptionPriceFeed;
51
- //# sourceMappingURL=inception-price-feed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inception-price-feed.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-price-feed.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,4CAA+C;AAE/C,+EAAyE;AAWzE,8GAAiF;AACjF,qCAA+C;AAG/C,MAAa,kBAA0B,SAAQ,kDAG9C;IAEC,YACU,gBAAyB,EACzB,OAAgB,EACxB,IAAwD,EACxD,MAAc;QAEd,KAAK,CAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QALhC,qBAAgB,GAAhB,gBAAgB,CAAS;QACzB,YAAO,GAAP,OAAO,CAAS;QAHhB,uBAAkB,GAAc,IAAI,eAAS,CAAC,mCAAoB,CAAC,CAAC;IAQ9E,CAAC;IAED,QAAQ,CAAC,KAA0B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACtC,CAAC;IAEM,UAAU,CACf,KAA8B,EAC9B,GAAkB,EAClB,WAAkC;QAElC,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACrD,MAAM,MAAM,GAAc,gBAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC7C,QAAQ,MAAM,CAAC,IAAI,EAAE;gBACnB,KAAK,cAAc,CAAC,CAAC;oBACnB,MAAM,SAAS,GAAG,IAAA,4BAAmB,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBACpE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG;wBACvC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;qBACzC,CAAC;oBACF,OAAO,MAAM,CAAC;iBACf;gBACD;oBACE,OAAO,IAAI,CAAC;aACf;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAEM,+BAA+B;QACpC,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,aAAa,CAClB,gBAAmC,EACnC,WAA+B;QAE/B,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AArDD,gDAqDC"}
@@ -1,44 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { AsyncOrSync } from 'ts-essentials';
3
- import { NumberAsString, SwapSide } from '@paraswap/core';
4
- import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, Logger, PoolLiquidity, PoolPrices, Token } from '../../types';
5
- import { Network } from '../../constants';
6
- import { IDex } from '../../dex/idex';
7
- import { IDexHelper } from '../../dex-helper/idex-helper';
8
- import { DexParams, InceptionDexData, PoolState } from './types';
9
- import { SimpleExchange } from '../simple-exchange';
10
- import { InceptionEventPool } from './inception-event-pool';
11
- export declare class Inception extends SimpleExchange implements IDex<InceptionDexData> {
12
- readonly network: Network;
13
- readonly dexKey: string;
14
- readonly dexHelper: IDexHelper;
15
- protected config: DexParams[];
16
- protected adapters: import("../../types").AdapterMappings;
17
- protected vaultInterface: Interface;
18
- protected poolInterface: Interface;
19
- readonly hasConstantPriceLargeAmounts = false;
20
- readonly needWrapNative = false;
21
- readonly isFeeOnTransferSupported = false;
22
- static dexKeysWithNetwork: {
23
- key: string;
24
- networks: Network[];
25
- }[];
26
- logger: Logger;
27
- private eventPool;
28
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config?: DexParams[], adapters?: import("../../types").AdapterMappings);
29
- initializePricing(blockNumber: number): Promise<void>;
30
- initializeTokens(): Promise<void>;
31
- getAdapters(side: SwapSide): {
32
- name: string;
33
- index: number;
34
- }[] | null;
35
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
36
- getPoolState(pool: InceptionEventPool, blockNumber: number): Promise<PoolState>;
37
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<InceptionDexData>>;
38
- getCalldataGasCost(poolPrices: PoolPrices<InceptionDexData>): number | number[];
39
- getAdapterParam(): AdapterExchangeParam;
40
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: InceptionDexData, side: SwapSide): DexExchangeParam;
41
- updatePoolState(): Promise<void>;
42
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
43
- releaseResources(): AsyncOrSync<void>;
44
- }