@paraswap/dex-lib 4.7.13-unified-pair-restriction.2 → 4.7.14-pharaoh-v3.0

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 (235) hide show
  1. package/build/abi/PendleRouterStatic.json +19 -0
  2. package/build/abi/{MStableAsset.json → apex-defi/ApexDefiFactory.abi.json} +992 -788
  3. package/build/abi/{BProtocol.json → apex-defi/ApexDefiRouter.abi.json} +539 -574
  4. package/build/abi/apex-defi/ApexDefiToken.abi.json +229 -0
  5. package/build/abi/apex-defi/ApexDefiWrapper.abi.json +92 -0
  6. package/build/abi/{OneInchLp.json → apex-defi/ApexDefiWrapperFactory.abi.json} +577 -774
  7. package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +796 -0
  8. package/build/abi/pendle/pendle-deployer.abi.json +520 -0
  9. package/build/abi/pendle/pendle-oracle.abi.json +413 -0
  10. package/build/abi/pharaoh-v3/PharaohV3Factory.abi.json +349 -0
  11. package/build/abi/pharaoh-v3/PharaohV3Pool.abi.json +802 -0
  12. package/build/abi/pharaoh-v3/PharaohV3StateMulticall.abi.json +781 -0
  13. package/build/abi/ring-v2/few-wrapped-token.json +587 -0
  14. package/build/abi/ring-v2/ring-v2-factory.json +125 -0
  15. package/build/abi/ring-v2/ring-v2-pool.json +461 -0
  16. package/build/abi/ring-v2/ring-v2-router.json +332 -0
  17. package/build/abi/stabull/stabull-curve.json +738 -0
  18. package/build/abi/stabull/stabull-router.json +76 -0
  19. package/build/abi/uniswap-v4/hooks/SpotDynamicFeeManager.json +26 -0
  20. package/build/abi/uniswap-v4/hooks/SpotHook.json +54 -0
  21. package/build/abi/uniswap-v4/hooks/SpotPolicyManager.json +45 -0
  22. package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +682 -0
  23. package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +1335 -0
  24. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +29 -0
  25. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +153 -0
  26. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +1 -0
  27. package/build/dex/{usual-bond/usual-bond.d.ts → aave-pt-to-underlying/aave-pt-to-underlying.d.ts} +23 -18
  28. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +323 -0
  29. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +1 -0
  30. package/build/dex/aave-pt-to-underlying/config.d.ts +3 -0
  31. package/build/dex/aave-pt-to-underlying/config.js +24 -0
  32. package/build/dex/aave-pt-to-underlying/config.js.map +1 -0
  33. package/build/dex/aave-pt-to-underlying/constants.d.ts +2 -0
  34. package/build/dex/aave-pt-to-underlying/constants.js +6 -0
  35. package/build/dex/aave-pt-to-underlying/constants.js.map +1 -0
  36. package/build/dex/aave-pt-to-underlying/types.d.ts +24 -0
  37. package/build/dex/aave-pt-to-underlying/types.js.map +1 -0
  38. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +39 -0
  39. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +244 -0
  40. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +1 -0
  41. package/build/dex/aave-pt-to-usdc/config.d.ts +3 -0
  42. package/build/dex/aave-pt-to-usdc/config.js +47 -0
  43. package/build/dex/aave-pt-to-usdc/config.js.map +1 -0
  44. package/build/dex/aave-pt-to-usdc/constants.d.ts +2 -0
  45. package/build/dex/aave-pt-to-usdc/constants.js +6 -0
  46. package/build/dex/aave-pt-to-usdc/constants.js.map +1 -0
  47. package/build/dex/aave-pt-to-usdc/types.d.ts +22 -0
  48. package/build/dex/aave-pt-to-usdc/types.js.map +1 -0
  49. package/build/dex/apex-defi/apex-defi-factory.d.ts +26 -0
  50. package/build/dex/apex-defi/apex-defi-factory.js +53 -0
  51. package/build/dex/apex-defi/apex-defi-factory.js.map +1 -0
  52. package/build/dex/apex-defi/apex-defi-pool.d.ts +55 -0
  53. package/build/dex/apex-defi/apex-defi-pool.js +247 -0
  54. package/build/dex/apex-defi/apex-defi-pool.js.map +1 -0
  55. package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +57 -0
  56. package/build/dex/apex-defi/apex-defi-wrapper-factory.js +250 -0
  57. package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +1 -0
  58. package/build/dex/apex-defi/apex-defi.d.ts +97 -0
  59. package/build/dex/apex-defi/apex-defi.js +1021 -0
  60. package/build/dex/apex-defi/apex-defi.js.map +1 -0
  61. package/build/dex/apex-defi/config.d.ts +4 -0
  62. package/build/dex/apex-defi/config.js +138 -0
  63. package/build/dex/apex-defi/config.js.map +1 -0
  64. package/build/dex/apex-defi/types.d.ts +32 -0
  65. package/build/dex/apex-defi/types.js +3 -0
  66. package/build/dex/{usual-bond → apex-defi}/types.js.map +1 -1
  67. package/build/dex/apex-defi/utils.d.ts +46 -0
  68. package/build/dex/apex-defi/utils.js +133 -0
  69. package/build/dex/apex-defi/utils.js.map +1 -0
  70. package/build/dex/generic-rfq/generic-rfq.js +5 -0
  71. package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
  72. package/build/dex/maker-psm/maker-psm-event-pool.d.ts +43 -0
  73. package/build/dex/maker-psm/maker-psm-event-pool.js +132 -0
  74. package/build/dex/maker-psm/maker-psm-event-pool.js.map +1 -0
  75. package/build/dex/miro-migrator/miro-migrator-state.d.ts +27 -0
  76. package/build/dex/miro-migrator/miro-migrator-state.js +89 -0
  77. package/build/dex/miro-migrator/miro-migrator-state.js.map +1 -0
  78. package/build/dex/{usual-bond → stabull}/config.d.ts +1 -1
  79. package/build/dex/stabull/config.js +177 -0
  80. package/build/dex/stabull/config.js.map +1 -0
  81. package/build/dex/{se-vlr/se-vlr-pool.d.ts → stabull/stabull-pool.d.ts} +13 -6
  82. package/build/dex/stabull/stabull-pool.js +113 -0
  83. package/build/dex/stabull/stabull-pool.js.map +1 -0
  84. package/build/dex/stabull/stabull.d.ts +55 -0
  85. package/build/dex/stabull/stabull.js +286 -0
  86. package/build/dex/stabull/stabull.js.map +1 -0
  87. package/build/dex/stabull/types.d.ts +21 -0
  88. package/build/dex/stabull/types.js +3 -0
  89. package/build/dex/stabull/types.js.map +1 -0
  90. package/build/dex/uniswap-v3/config.js +32 -0
  91. package/build/dex/uniswap-v3/config.js.map +1 -1
  92. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +4 -0
  93. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +56 -0
  94. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +1 -0
  95. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.d.ts +12 -0
  96. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js +142 -0
  97. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js.map +1 -0
  98. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.d.ts +4 -0
  99. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js +56 -0
  100. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js.map +1 -0
  101. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.d.ts +2 -2
  102. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js.map +1 -1
  103. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js +1 -0
  104. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js.map +1 -1
  105. package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +2 -1
  106. package/build/dex/uniswap-v3/uniswap-v3-pool.js +3 -1
  107. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  108. package/build/dex/uniswap-v3/uniswap-v3.js +1 -1
  109. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  110. package/build/dex/uniswap-v4/contract-math/Position.d.ts +6 -0
  111. package/build/dex/uniswap-v4/contract-math/Position.js +29 -0
  112. package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
  113. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +7 -0
  114. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +28 -0
  115. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +1 -0
  116. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
  117. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +2 -0
  118. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +1 -0
  119. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +7 -0
  120. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +28 -0
  121. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +1 -0
  122. package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
  123. package/build/dex/uniswap-v4/hooks/fee-hook/types.js +2 -0
  124. package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +1 -0
  125. package/build/dex/uniswap-v4/hooks/index.d.ts +1 -0
  126. package/build/dex/uniswap-v4/hooks/index.js +9 -0
  127. package/build/dex/uniswap-v4/hooks/index.js.map +1 -0
  128. package/build/dex/uniswap-v4/hooks/spot.d.ts +15 -0
  129. package/build/dex/uniswap-v4/hooks/spot.js +109 -0
  130. package/build/dex/uniswap-v4/hooks/spot.js.map +1 -0
  131. package/build/dex/uniswap-v4/hooks/template.d.ts +150 -0
  132. package/build/dex/uniswap-v4/hooks/template.js +104 -0
  133. package/build/dex/uniswap-v4/hooks/template.js.map +1 -0
  134. package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +26 -0
  135. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +75 -0
  136. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +1 -0
  137. package/build/dex/usual/usual-usdc-usdc.d.ts +17 -0
  138. package/build/dex/usual/usual-usdc-usdc.js +59 -0
  139. package/build/dex/usual/usual-usdc-usdc.js.map +1 -0
  140. package/build/dex/{se-vlr → yo}/config.d.ts +1 -1
  141. package/build/dex/yo/config.js +21 -0
  142. package/build/dex/yo/config.js.map +1 -0
  143. package/build/dex/yo/types.d.ts +13 -0
  144. package/build/dex/yo/types.js +3 -0
  145. package/build/dex/{se-vlr → yo}/types.js.map +1 -1
  146. package/build/dex/yo/yo-pool.d.ts +13 -0
  147. package/build/dex/yo/yo-pool.js +26 -0
  148. package/build/dex/yo/yo-pool.js.map +1 -0
  149. package/build/dex/yo/yo.d.ts +39 -0
  150. package/build/dex/yo/yo.js +248 -0
  151. package/build/dex/yo/yo.js.map +1 -0
  152. package/build/implementations/api-paraswap-sdk.d.ts +25 -0
  153. package/build/implementations/api-paraswap-sdk.js +102 -0
  154. package/build/implementations/api-paraswap-sdk.js.map +1 -0
  155. package/package.json +1 -1
  156. package/build/abi/Jarvis.json +0 -1172
  157. package/build/abi/Onebit.json +0 -736
  158. package/build/abi/Shell.json +0 -1294
  159. package/build/abi/TraderJoeV2Router.json +0 -50
  160. package/build/abi/wUSDM.json +0 -757
  161. package/build/abi/zrx.v2.json +0 -1967
  162. package/build/abi/zrx.v3.json +0 -3454
  163. package/build/abi/zrx.v4.json +0 -2193
  164. package/build/dex/OneInchLp.d.ts +0 -24
  165. package/build/dex/OneInchLp.js +0 -43
  166. package/build/dex/OneInchLp.js.map +0 -1
  167. package/build/dex/bProtocol/bProtocol.d.ts +0 -15
  168. package/build/dex/bProtocol/bProtocol.js +0 -56
  169. package/build/dex/bProtocol/bProtocol.js.map +0 -1
  170. package/build/dex/bProtocol/types.d.ts +0 -11
  171. package/build/dex/bProtocol/types.js +0 -8
  172. package/build/dex/bProtocol/types.js.map +0 -1
  173. package/build/dex/jarvis.d.ts +0 -56
  174. package/build/dex/jarvis.js +0 -163
  175. package/build/dex/jarvis.js.map +0 -1
  176. package/build/dex/mStable.d.ts +0 -44
  177. package/build/dex/mStable.js +0 -75
  178. package/build/dex/mStable.js.map +0 -1
  179. package/build/dex/onebit/onebit.d.ts +0 -16
  180. package/build/dex/onebit/onebit.js +0 -61
  181. package/build/dex/onebit/onebit.js.map +0 -1
  182. package/build/dex/onebit/types.d.ts +0 -14
  183. package/build/dex/onebit/types.js +0 -8
  184. package/build/dex/onebit/types.js.map +0 -1
  185. package/build/dex/se-vlr/config.js +0 -24
  186. package/build/dex/se-vlr/config.js.map +0 -1
  187. package/build/dex/se-vlr/se-vlr-pool.js +0 -70
  188. package/build/dex/se-vlr/se-vlr-pool.js.map +0 -1
  189. package/build/dex/se-vlr/se-vlr.d.ts +0 -35
  190. package/build/dex/se-vlr/se-vlr.js +0 -131
  191. package/build/dex/se-vlr/se-vlr.js.map +0 -1
  192. package/build/dex/se-vlr/types.d.ts +0 -6
  193. package/build/dex/shell.d.ts +0 -25
  194. package/build/dex/shell.js +0 -41
  195. package/build/dex/shell.js.map +0 -1
  196. package/build/dex/trader-joe-v2.d.ts +0 -40
  197. package/build/dex/trader-joe-v2.js +0 -74
  198. package/build/dex/trader-joe-v2.js.map +0 -1
  199. package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
  200. package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
  201. package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
  202. package/build/dex/usual-bond/config.js +0 -13
  203. package/build/dex/usual-bond/config.js.map +0 -1
  204. package/build/dex/usual-bond/types.d.ts +0 -7
  205. package/build/dex/usual-bond/usual-bond.js +0 -176
  206. package/build/dex/usual-bond/usual-bond.js.map +0 -1
  207. package/build/dex/wusdm/config.d.ts +0 -3
  208. package/build/dex/wusdm/config.js +0 -43
  209. package/build/dex/wusdm/config.js.map +0 -1
  210. package/build/dex/wusdm/constants.d.ts +0 -2
  211. package/build/dex/wusdm/constants.js +0 -6
  212. package/build/dex/wusdm/constants.js.map +0 -1
  213. package/build/dex/wusdm/types.d.ts +0 -18
  214. package/build/dex/wusdm/types.js +0 -11
  215. package/build/dex/wusdm/types.js.map +0 -1
  216. package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
  217. package/build/dex/wusdm/wusdm-pool.js +0 -74
  218. package/build/dex/wusdm/wusdm-pool.js.map +0 -1
  219. package/build/dex/wusdm/wusdm.d.ts +0 -46
  220. package/build/dex/wusdm/wusdm.js +0 -243
  221. package/build/dex/wusdm/wusdm.js.map +0 -1
  222. package/build/dex/zerox/config.d.ts +0 -2
  223. package/build/dex/zerox/config.js +0 -33
  224. package/build/dex/zerox/config.js.map +0 -1
  225. package/build/dex/zerox/index.d.ts +0 -22
  226. package/build/dex/zerox/index.js +0 -225
  227. package/build/dex/zerox/index.js.map +0 -1
  228. package/build/dex/zerox/order.d.ts +0 -88
  229. package/build/dex/zerox/order.js +0 -53
  230. package/build/dex/zerox/order.js.map +0 -1
  231. package/build/dex/zerox/types.d.ts +0 -73
  232. package/build/dex/zerox/types.js +0 -21
  233. package/build/dex/zerox/types.js.map +0 -1
  234. /package/build/dex/{se-vlr → aave-pt-to-underlying}/types.js +0 -0
  235. /package/build/dex/{usual-bond → aave-pt-to-usdc}/types.js +0 -0
@@ -0,0 +1,132 @@
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.MakerPsmEventPool = void 0;
7
+ const abi_1 = require("@ethersproject/abi");
8
+ const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
9
+ const utils_1 = require("../../utils");
10
+ const psm_json_1 = __importDefault(require("../../abi/maker-psm/psm.json"));
11
+ const vat_json_1 = __importDefault(require("../../abi/maker-psm/vat.json"));
12
+ const vatInterface = new abi_1.Interface(vat_json_1.default);
13
+ const psmInterface = new abi_1.Interface(psm_json_1.default);
14
+ const bigIntify = (b) => BigInt(b.toString());
15
+ async function getOnChainState(multiContract, poolConfigs, vatAddress, blockNumber) {
16
+ const callData = poolConfigs
17
+ .map(c => [
18
+ {
19
+ target: c.psmAddress,
20
+ callData: psmInterface.encodeFunctionData('tin', []),
21
+ },
22
+ {
23
+ target: c.psmAddress,
24
+ callData: psmInterface.encodeFunctionData('tout', []),
25
+ },
26
+ {
27
+ target: vatAddress,
28
+ callData: vatInterface.encodeFunctionData('ilks', [c.identifier]),
29
+ },
30
+ ])
31
+ .flat();
32
+ const res = await multiContract.methods
33
+ .aggregate(callData)
34
+ .call({}, blockNumber);
35
+ let i = 0;
36
+ return poolConfigs.map(c => {
37
+ const tin = bigIntify(psmInterface.decodeFunctionResult('tin', res.returnData[i++])[0]);
38
+ const tout = bigIntify(psmInterface.decodeFunctionResult('tout', res.returnData[i++])[0]);
39
+ const ilks = vatInterface.decodeFunctionResult('ilks', res.returnData[i++]);
40
+ const Art = bigIntify(ilks.Art);
41
+ const line = bigIntify(ilks.line);
42
+ const rate = bigIntify(ilks.rate);
43
+ return {
44
+ tin,
45
+ tout,
46
+ Art,
47
+ line,
48
+ rate,
49
+ };
50
+ });
51
+ }
52
+ class MakerPsmEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
53
+ network;
54
+ dexHelper;
55
+ poolConfig;
56
+ vatAddress;
57
+ handlers = {};
58
+ logDecoder;
59
+ to18ConversionFactor;
60
+ bytes32Tout = '0x746f757400000000000000000000000000000000000000000000000000000000'; // bytes32('tout')
61
+ bytes32Tin = '0x74696e0000000000000000000000000000000000000000000000000000000000'; // bytes32('tin')
62
+ constructor(parentName, network, dexHelper, logger, poolConfig, vatAddress) {
63
+ super(parentName, poolConfig.identifier, dexHelper, logger);
64
+ this.network = network;
65
+ this.dexHelper = dexHelper;
66
+ this.poolConfig = poolConfig;
67
+ this.vatAddress = vatAddress;
68
+ this.logDecoder = (log) => psmInterface.parseLog(log);
69
+ this.addressesSubscribed = [poolConfig.psmAddress];
70
+ this.to18ConversionFactor = (0, utils_1.getBigIntPow)(18 - poolConfig.gem.decimals);
71
+ // Add handlers
72
+ this.handlers['File'] = this.handleFile.bind(this);
73
+ this.handlers['SellGem'] = this.handleSellGem.bind(this);
74
+ this.handlers['BuyGem'] = this.handleBuyGem.bind(this);
75
+ }
76
+ handleFile(event, pool, log) {
77
+ if (event.args.what === this.bytes32Tin) {
78
+ pool.tin = bigIntify(event.args.data);
79
+ }
80
+ else if (event.args.what === this.bytes32Tout) {
81
+ pool.tout = bigIntify(event.args.data);
82
+ }
83
+ return pool;
84
+ }
85
+ handleSellGem(event, pool, log) {
86
+ pool.Art += bigIntify(event.args.value) * this.to18ConversionFactor;
87
+ return pool;
88
+ }
89
+ handleBuyGem(event, pool, log) {
90
+ pool.Art -= bigIntify(event.args.value) * this.to18ConversionFactor;
91
+ return pool;
92
+ }
93
+ getIdentifier() {
94
+ return `${this.parentName}_${this.poolConfig.psmAddress}`.toLowerCase();
95
+ }
96
+ /**
97
+ * The function is called every time any of the subscribed
98
+ * addresses release log. The function accepts the current
99
+ * state, updates the state according to the log, and returns
100
+ * the updated state.
101
+ * @param state - Current state of event subscriber
102
+ * @param log - Log released by one of the subscribed addresses
103
+ * @returns Updates state of the event subscriber after the log
104
+ */
105
+ processLog(state, log) {
106
+ try {
107
+ const event = this.logDecoder(log);
108
+ if (event.name in this.handlers) {
109
+ return this.handlers[event.name](event, state, log);
110
+ }
111
+ return state;
112
+ }
113
+ catch (e) {
114
+ this.logger.error(`Error_${this.parentName}_processLog could not parse the log with topic ${log.topics}:`, e);
115
+ return null;
116
+ }
117
+ }
118
+ /**
119
+ * The function generates state using on-chain calls. This
120
+ * function is called to regenerate state if the event based
121
+ * system fails to fetch events and the local state is no
122
+ * more correct.
123
+ * @param blockNumber - Blocknumber for which the state should
124
+ * should be generated
125
+ * @returns state of the event subscriber at blocknumber
126
+ */
127
+ async generateState(blockNumber) {
128
+ return (await getOnChainState(this.dexHelper.multiContract, [this.poolConfig], this.vatAddress, blockNumber))[0];
129
+ }
130
+ }
131
+ exports.MakerPsmEventPool = MakerPsmEventPool;
132
+ //# sourceMappingURL=maker-psm-event-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maker-psm-event-pool.js","sourceRoot":"","sources":["../../../src/dex/maker-psm/maker-psm-event-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAI/C,+EAA0E;AAC1E,uCAA2C;AAG3C,4EAAkD;AAClD,4EAAkD;AAElD,MAAM,YAAY,GAAG,IAAI,eAAS,CAAC,kBAAM,CAAC,CAAC;AAC3C,MAAM,YAAY,GAAG,IAAI,eAAS,CAAC,kBAAM,CAAC,CAAC;AAE3C,MAAM,SAAS,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEnD,KAAK,UAAU,eAAe,CAC5B,aAAuB,EACvB,WAAyB,EACzB,UAAmB,EACnB,WAA8B;IAE9B,MAAM,QAAQ,GAAG,WAAW;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACR;YACE,MAAM,EAAE,CAAC,CAAC,UAAU;YACpB,QAAQ,EAAE,YAAY,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;SACrD;QACD;YACE,MAAM,EAAE,CAAC,CAAC,UAAU;YACpB,QAAQ,EAAE,YAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC;SACtD;QACD;YACE,MAAM,EAAE,UAAU;YAClB,QAAQ,EAAE,YAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;SAClE;KACF,CAAC;SACD,IAAI,EAAE,CAAC;IAEV,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,OAAO;SACpC,SAAS,CAAC,QAAQ,CAAC;SACnB,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAEzB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC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{ 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 { MiroMigratorState } from './types';
7
+ export declare class MiroMigratorEventState extends StatefulEventSubscriber<MiroMigratorState> {
8
+ readonly parentName: string;
9
+ protected network: number;
10
+ protected dexHelper: IDexHelper;
11
+ protected migratorAddress: string;
12
+ protected xyzAddress: string;
13
+ protected transferTopic: string;
14
+ protected migratorInterface: Interface;
15
+ protected xyzInterface: Interface;
16
+ handlers: {
17
+ [event: string]: (event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>) => DeepReadonly<MiroMigratorState> | null;
18
+ };
19
+ logDecoder: (log: Log) => any;
20
+ addressesSubscribed: string[];
21
+ constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, migratorAddress: string, xyzAddress: string, transferTopic: string, migratorInterface?: Interface, xyzInterface?: Interface);
22
+ protected processLog(state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState> | null>;
23
+ generateState(blockNumber?: number | 'latest'): Promise<DeepReadonly<MiroMigratorState>>;
24
+ getOrGenerateState(blockNumber: number): Promise<MiroMigratorState>;
25
+ handleTransferTo(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
26
+ handleTransferFrom(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
27
+ }
@@ -0,0 +1,89 @@
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.MiroMigratorEventState = void 0;
7
+ const abi_1 = require("@ethersproject/abi");
8
+ const utils_1 = require("../../utils");
9
+ const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
10
+ const decoders_1 = require("../../lib/decoders");
11
+ const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
12
+ const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
13
+ class MiroMigratorEventState extends stateful_event_subscriber_1.StatefulEventSubscriber {
14
+ parentName;
15
+ network;
16
+ dexHelper;
17
+ migratorAddress;
18
+ xyzAddress;
19
+ transferTopic;
20
+ migratorInterface;
21
+ xyzInterface;
22
+ handlers = {};
23
+ logDecoder;
24
+ addressesSubscribed;
25
+ constructor(parentName, network, dexHelper, logger, migratorAddress, xyzAddress, transferTopic, migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default), xyzInterface = new abi_1.Interface(erc20_json_1.default)) {
26
+ super(parentName, 'state', dexHelper, logger);
27
+ this.parentName = parentName;
28
+ this.network = network;
29
+ this.dexHelper = dexHelper;
30
+ this.migratorAddress = migratorAddress;
31
+ this.xyzAddress = xyzAddress;
32
+ this.transferTopic = transferTopic;
33
+ this.migratorInterface = migratorInterface;
34
+ this.xyzInterface = xyzInterface;
35
+ this.logDecoder = (log) => this.migratorInterface.parseLog(log);
36
+ this.addressesSubscribed = [xyzAddress];
37
+ }
38
+ async processLog(state, log) {
39
+ try {
40
+ const event = this.logDecoder(log);
41
+ if (log.topics[0] === this.transferTopic &&
42
+ event.args.to.toLowerCase() === this.migratorAddress.toLowerCase()) {
43
+ return this.handleTransferTo(event, state, log);
44
+ }
45
+ if (log.topics[0] === this.transferTopic &&
46
+ event.args.from.toLowerCase() === this.migratorAddress.toLowerCase()) {
47
+ return this.handleTransferFrom(event, state, log);
48
+ }
49
+ return null;
50
+ }
51
+ catch (e) {
52
+ (0, utils_1.catchParseLogError)(e, this.logger);
53
+ return null;
54
+ }
55
+ }
56
+ async generateState(blockNumber = 'latest') {
57
+ const calls = [
58
+ {
59
+ target: this.xyzAddress,
60
+ callData: this.xyzInterface.encodeFunctionData('balanceOf', [
61
+ this.migratorAddress,
62
+ ]),
63
+ decodeFunction: decoders_1.uint256ToBigInt,
64
+ },
65
+ ];
66
+ const [balance] = await this.dexHelper.multiWrapper.tryAggregate(true, calls, blockNumber);
67
+ return { balance: balance.returnData };
68
+ }
69
+ async getOrGenerateState(blockNumber) {
70
+ let state = this.getState(blockNumber);
71
+ if (!state) {
72
+ state = await this.generateState(blockNumber);
73
+ this.setState(state, blockNumber);
74
+ }
75
+ return state;
76
+ }
77
+ async handleTransferTo(event, state, log) {
78
+ return {
79
+ balance: state.balance + BigInt(event.args.value),
80
+ };
81
+ }
82
+ async handleTransferFrom(event, state, log) {
83
+ return {
84
+ balance: state.balance - BigInt(event.args.value),
85
+ };
86
+ }
87
+ }
88
+ exports.MiroMigratorEventState = MiroMigratorEventState;
89
+ //# sourceMappingURL=miro-migrator-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miro-migrator-state.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator-state.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAG1E,iDAAqD;AACrD,0GAA4E;AAC5E,sEAA4C;AAE5C,MAAa,sBAAuB,SAAQ,mDAA0C;IAczE;IACC;IACA;IAEA;IACA;IACA;IACA;IACA;IArBZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,mBAAmB,CAAW;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,eAAuB,EACvB,UAAkB,EAClB,aAAqB,EACrB,oBAA+B,IAAI,eAAS,CAAC,+BAAe,CAAC,EAC7D,eAA0B,IAAI,eAAS,CAAC,oBAAQ,CAAC;QAE3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAVrC,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,oBAAe,GAAf,eA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Q;QAEzC,MAAM,KAAK,GAAG;YACZ;gBACE,MAAM,EAAE,IAAI,CAAC,UAAU;gBACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,WAAW,EAAE;oBAC1D,IAAI,CAAC,eAAe;iBACrB,CAAC;gBACF,cAAc,EAAE,0BAAe;aAChC;SACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAC9D,IAAI,EACJ,KAAK,EACL,WAAW,CACZ,CAAC;QAEF,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,WAAmB;QAC1C,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,KAAU,EACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,KAAU,EACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;CACF;AA3GD,wDA2GC"}
@@ -1,3 +1,3 @@
1
1
  import { DexParams } from './types';
2
2
  import { DexConfigMap } from '../../types';
3
- export declare const UsualBondConfig: DexConfigMap<DexParams>;
3
+ export declare const StabullConfig: DexConfigMap<DexParams>;
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StabullConfig = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.StabullConfig = {
6
+ Stabull: {
7
+ [constants_1.Network.MAINNET]: {
8
+ router: '0x871af97122d08890193e8d6465015f6d9e2889b2',
9
+ quoteCurrency: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
10
+ pools: {
11
+ '0xe37d763c7c4cdd9a8f085f7db70139a0843529f3': {
12
+ tokens: [
13
+ {
14
+ address: '0xda446fad08277b4d2591536f204e018f32b6831c',
15
+ decimals: 18,
16
+ }, // NZDS
17
+ {
18
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
19
+ decimals: 6,
20
+ }, // USDC
21
+ ],
22
+ },
23
+ '0x865040f92ac6cca1b9683c03d843799d8e6d1282': {
24
+ tokens: [
25
+ {
26
+ address: '0xdb25f211ab05b1c97d595516f45794528a807ad8',
27
+ decimals: 2,
28
+ }, // EURS
29
+ {
30
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
31
+ decimals: 6,
32
+ }, // USDC
33
+ ],
34
+ },
35
+ '0xc1a195fdb17da5771d470a232545550a7d264809': {
36
+ tokens: [
37
+ {
38
+ address: '0x2c537e5624e4af88a7ae4060c022609376c8d0eb',
39
+ decimals: 6,
40
+ }, // TRYB
41
+ {
42
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
43
+ decimals: 6,
44
+ }, // USDC
45
+ ],
46
+ },
47
+ '0x402878106b88b41fad1200b47e998c8effd0d887': {
48
+ tokens: [
49
+ {
50
+ address: '0x86b4dbe5d203e634a12364c0e428fa242a3fba98',
51
+ decimals: 18,
52
+ }, // 1GBP
53
+ {
54
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
55
+ decimals: 6,
56
+ }, // USDC
57
+ ],
58
+ },
59
+ '0x01e4013c478d7f02112c3cf178f2771c842edbd0': {
60
+ tokens: [
61
+ {
62
+ address: '0xc08512927d12348f6620a698105e1baac6ecd911',
63
+ decimals: 6,
64
+ }, // GYEN
65
+ {
66
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
67
+ decimals: 6,
68
+ }, // USDC
69
+ ],
70
+ },
71
+ },
72
+ },
73
+ [constants_1.Network.POLYGON]: {
74
+ router: '0x0c1f53e7b5a770f4c0d4bef139f752eeb08de88d',
75
+ quoteCurrency: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
76
+ pools: {
77
+ '0xdcb7efaca996fe2985138bf31b647efcd1d0901a': {
78
+ tokens: [
79
+ {
80
+ address: '0xfbbe4b730e1e77d02dc40fedf9438e2802eab3b5',
81
+ decimals: 18,
82
+ }, // NZDS
83
+ {
84
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
85
+ decimals: 6,
86
+ }, // USDC
87
+ ],
88
+ },
89
+ '0xf80b3a8977d34a443a836a380b2fce69a1a4e819': {
90
+ tokens: [
91
+ {
92
+ address: '0xe111178a87a3bff0c8d18decba5798827539ae99',
93
+ decimals: 2,
94
+ }, // EURS
95
+ {
96
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
97
+ decimals: 6,
98
+ }, // USDC
99
+ ],
100
+ },
101
+ '0x55bdf7f0223e8b1d509141a8d852dd86b3553d59': {
102
+ tokens: [
103
+ {
104
+ address: '0x4fb71290ac171e1d144f7221d882becac7196eb5',
105
+ decimals: 6,
106
+ }, // TRYB
107
+ {
108
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
109
+ decimals: 6,
110
+ }, // USDC
111
+ ],
112
+ },
113
+ '0x509aacb7746166252ecb0d62bfba097cc9731e20': {
114
+ tokens: [
115
+ {
116
+ address: '0xdc3326e71d45186f113a2f448984ca0e8d201995',
117
+ decimals: 6,
118
+ }, // XSGD
119
+ {
120
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
121
+ decimals: 6,
122
+ }, // USDC
123
+ ],
124
+ },
125
+ '0xce0abd182d2cf5844f2a0cb52cfcc55d4ff4fcba': {
126
+ tokens: [
127
+ {
128
+ address: '0x4ed141110f6eeeaba9a1df36d8c26f684d2475dc',
129
+ decimals: 4,
130
+ }, // BRZ
131
+ {
132
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
133
+ decimals: 6,
134
+ }, // USDC
135
+ ],
136
+ },
137
+ '0x3d4436ba3ae7e0e6361c83ab940ea779cd598206': {
138
+ tokens: [
139
+ {
140
+ address: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
141
+ decimals: 6,
142
+ }, // USDT
143
+ {
144
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
145
+ decimals: 6,
146
+ }, // USDC
147
+ ],
148
+ },
149
+ '0xa52508b1822ca9261b33213b233694f846abd0ed': {
150
+ tokens: [
151
+ {
152
+ address: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
153
+ decimals: 18,
154
+ }, // DAI
155
+ {
156
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
157
+ decimals: 6,
158
+ }, // USDC
159
+ ],
160
+ },
161
+ '0x1233003461f654cf1c0d7db19e753badef05a87f': {
162
+ tokens: [
163
+ {
164
+ address: '0x87a25dc121db52369f4a9971f664ae5e372cf69a',
165
+ decimals: 6,
166
+ }, // PHPC
167
+ {
168
+ address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
169
+ decimals: 6,
170
+ }, // USDC
171
+ ],
172
+ },
173
+ },
174
+ },
175
+ },
176
+ };
177
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/stabull/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,aAAa,GAA4B;IACpD,OAAO,EAAE;QACP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AE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,EAAE;yBACb,EAAE,MAAM;wBACT;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;wBACV;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -1,20 +1,19 @@
1
- import { Interface } from '@ethersproject/abi';
2
1
  import { DeepReadonly } from 'ts-essentials';
3
2
  import { Log, Logger } from '../../types';
4
3
  import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
5
4
  import { IDexHelper } from '../../dex-helper/idex-helper';
6
5
  import { PoolState } from './types';
7
- export declare class SeVlrEventPool extends StatefulEventSubscriber<PoolState> {
6
+ export declare class StabullEventPool extends StatefulEventSubscriber<PoolState> {
8
7
  readonly parentName: string;
9
8
  protected network: number;
10
9
  protected dexHelper: IDexHelper;
11
- protected seVlrIface: Interface;
10
+ readonly poolAddress: string;
11
+ protected addressesSubscribed_: string[];
12
12
  handlers: {
13
13
  [event: string]: (event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>) => DeepReadonly<PoolState> | null;
14
14
  };
15
15
  logDecoder: (log: Log) => any;
16
- addressesSubscribed: string[];
17
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, seVlrIface?: Interface);
16
+ constructor(parentName: string, network: number, dexHelper: IDexHelper, poolAddress: string, addressesSubscribed_: string[], logger: Logger);
18
17
  /**
19
18
  * The function is called every time any of the subscribed
20
19
  * addresses release log. The function accepts the current
@@ -35,5 +34,13 @@ export declare class SeVlrEventPool extends StatefulEventSubscriber<PoolState> {
35
34
  * @returns state of the event subscriber at blocknumber
36
35
  */
37
36
  generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
38
- handleMyEvent(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
37
+ /**
38
+ * Handles a transfer event and updates the pool state accordingly.
39
+ *
40
+ * @param event - The transfer event object containing details about the transfer.
41
+ * @param state - The current state of the pool.
42
+ * @param log - The log object containing additional information about the event.
43
+ * @returns The updated pool state if the transfer involves the pool, otherwise null.
44
+ */
45
+ handleTransfer(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
39
46
  }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StabullEventPool = void 0;
4
+ const utils_1 = require("../../utils");
5
+ const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
6
+ const utils_2 = require("../../lib/tokens/utils");
7
+ const decoders_1 = require("../../lib/decoders");
8
+ class StabullEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
9
+ parentName;
10
+ network;
11
+ dexHelper;
12
+ poolAddress;
13
+ addressesSubscribed_;
14
+ handlers = {};
15
+ logDecoder;
16
+ constructor(parentName, network, dexHelper, poolAddress, addressesSubscribed_, logger) {
17
+ super(parentName, poolAddress.toLowerCase(), dexHelper, logger);
18
+ this.parentName = parentName;
19
+ this.network = network;
20
+ this.dexHelper = dexHelper;
21
+ this.poolAddress = poolAddress;
22
+ this.addressesSubscribed_ = addressesSubscribed_;
23
+ this.logDecoder = (log) => utils_2.erc20Iface.parseLog(log);
24
+ this.addressesSubscribed = addressesSubscribed_;
25
+ this.poolAddress = poolAddress.toLowerCase();
26
+ }
27
+ /**
28
+ * The function is called every time any of the subscribed
29
+ * addresses release log. The function accepts the current
30
+ * state, updates the state according to the log, and returns
31
+ * the updated state.
32
+ * @param state - Current state of event subscriber
33
+ * @param log - Log released by one of the subscribed addresses
34
+ * @returns Updates state of the event subscriber after the log
35
+ */
36
+ processLog(state, log) {
37
+ try {
38
+ const event = this.logDecoder(log);
39
+ if (event.name in this.handlers) {
40
+ return this.handlers[event.name](event, state, log);
41
+ }
42
+ }
43
+ catch (e) {
44
+ (0, utils_1.catchParseLogError)(e, this.logger);
45
+ }
46
+ return null;
47
+ }
48
+ /**
49
+ * The function generates state using on-chain calls. This
50
+ * function is called to regenerate state if the event based
51
+ * system fails to fetch events and the local state is no
52
+ * more correct.
53
+ * @param blockNumber - Blocknumber for which the state should
54
+ * should be generated
55
+ * @returns state of the event subscriber at blocknumber
56
+ */
57
+ async generateState(blockNumber) {
58
+ let calldata = [
59
+ {
60
+ target: this.addressesSubscribed[0],
61
+ callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
62
+ this.poolAddress,
63
+ ]),
64
+ decodeFunction: decoders_1.uint256ToBigInt,
65
+ },
66
+ {
67
+ target: this.addressesSubscribed[1],
68
+ callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
69
+ this.poolAddress,
70
+ ]),
71
+ decodeFunction: decoders_1.uint256ToBigInt,
72
+ },
73
+ ];
74
+ const data = await this.dexHelper.multiWrapper.tryAggregate(true, calldata, blockNumber);
75
+ return {
76
+ reserves0: data[0].success ? data[0].returnData : 0n,
77
+ reserves1: data[1].success ? data[1].returnData : 0n,
78
+ };
79
+ }
80
+ /**
81
+ * Handles a transfer event and updates the pool state accordingly.
82
+ *
83
+ * @param event - The transfer event object containing details about the transfer.
84
+ * @param state - The current state of the pool.
85
+ * @param log - The log object containing additional information about the event.
86
+ * @returns The updated pool state if the transfer involves the pool, otherwise null.
87
+ */
88
+ handleTransfer(event, state, log) {
89
+ const from = event.args.from.toLowerCase();
90
+ const to = event.args.to.toLowerCase();
91
+ // Check if pool is involved in the transfer
92
+ if (from !== this.poolAddress && to !== this.poolAddress) {
93
+ return null;
94
+ }
95
+ // Determine which token this is
96
+ const eventTokenAddress = log.address.toLowerCase();
97
+ const isToken0 = eventTokenAddress === this.addressesSubscribed[0].toLowerCase();
98
+ const value = event.args.value.toBigInt();
99
+ const reserveKey = isToken0 ? 'reserves0' : 'reserves1';
100
+ const currentReserve = state[reserveKey];
101
+ // Pool is sending tokens (decrease) or receiving tokens (increase)
102
+ const isFromPool = from === this.poolAddress;
103
+ const newReserve = isFromPool
104
+ ? currentReserve - value
105
+ : currentReserve + value;
106
+ return {
107
+ ...state,
108
+ [reserveKey]: newReserve,
109
+ };
110
+ }
111
+ }
112
+ exports.StabullEventPool = StabullEventPool;
113
+ //# sourceMappingURL=stabull-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stabull-pool.js","sourceRoot":"","sources":["../../../src/dex/stabull/stabull-pool.ts"],"names":[],"mappings":";;;AAEA,uCAAiD;AACjD,+EAA0E;AAG1E,kDAAoD;AACpD,iDAAqD;AAErD,MAAa,gBAAiB,SAAQ,mDAAkC;IAY3D;IACC;IACA;IACD;IACC;IAfZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EACtB,WAAmB,EAClB,oBAA8B,EACxC,MAAc;QAEd,KAAK,CAAC,UAAU,EAAE,WAAW,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAPvD,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QACtB,gBAAW,GAAX,WAAW,CAAQ;QAClB,yBAAoB,GAApB,oBAAoB,CAAU;QAKxC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,kBAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,mBAAmB,GAAG,oBAAoB,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,WAAW,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