@sonarwatch/portfolio-plugins 0.5.42 → 0.5.44

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 (77) hide show
  1. package/CHANGELOG.md +77 -69
  2. package/package.json +5 -2
  3. package/src/index.js +6 -0
  4. package/src/index.js.map +1 -1
  5. package/src/platforms.d.ts +4 -0
  6. package/src/platforms.js +21 -1
  7. package/src/platforms.js.map +1 -1
  8. package/src/plugins/morpho/aaveV3CollateralFetcher.d.ts +3 -0
  9. package/src/plugins/morpho/aaveV3CollateralFetcher.js +101 -0
  10. package/src/plugins/morpho/aaveV3CollateralFetcher.js.map +1 -0
  11. package/src/plugins/morpho/aaveV3Job.d.ts +3 -0
  12. package/src/plugins/morpho/aaveV3Job.js +36 -0
  13. package/src/plugins/morpho/aaveV3Job.js.map +1 -0
  14. package/src/plugins/morpho/aaveV3SupplyOnlyFetcher.d.ts +3 -0
  15. package/src/plugins/morpho/aaveV3SupplyOnlyFetcher.js +58 -0
  16. package/src/plugins/morpho/aaveV3SupplyOnlyFetcher.js.map +1 -0
  17. package/src/plugins/morpho/constants.d.ts +18 -0
  18. package/src/plugins/morpho/constants.js +22 -0
  19. package/src/plugins/morpho/constants.js.map +1 -0
  20. package/src/plugins/morpho/helpers.d.ts +5 -0
  21. package/src/plugins/morpho/helpers.js +112 -0
  22. package/src/plugins/morpho/helpers.js.map +1 -0
  23. package/src/plugins/morpho/index.d.ts +4 -0
  24. package/src/plugins/morpho/index.js +15 -0
  25. package/src/plugins/morpho/index.js.map +1 -0
  26. package/src/plugins/morpho/types.d.ts +20 -0
  27. package/src/plugins/morpho/types.js +3 -0
  28. package/src/plugins/morpho/types.js.map +1 -0
  29. package/src/plugins/morpho/utils/WadRayMath.d.ts +20 -0
  30. package/src/plugins/morpho/utils/WadRayMath.js +59 -0
  31. package/src/plugins/morpho/utils/WadRayMath.js.map +1 -0
  32. package/src/plugins/morpho/utils/abis.d.ts +2330 -0
  33. package/src/plugins/morpho/utils/abis.js +2994 -0
  34. package/src/plugins/morpho/utils/abis.js.map +1 -0
  35. package/src/plugins/native-stake/constants.d.ts +3 -0
  36. package/src/plugins/native-stake/constants.js +4 -1
  37. package/src/plugins/native-stake/constants.js.map +1 -1
  38. package/src/plugins/native-stake/solanaFetcher.js +28 -6
  39. package/src/plugins/native-stake/solanaFetcher.js.map +1 -1
  40. package/src/plugins/orders/clobs-solana/MarketJobExecutorGenerator.d.ts +3 -0
  41. package/src/plugins/orders/clobs-solana/MarketJobExecutorGenerator.js +52 -0
  42. package/src/plugins/orders/clobs-solana/MarketJobExecutorGenerator.js.map +1 -0
  43. package/src/plugins/orders/clobs-solana/constants.d.ts +7 -0
  44. package/src/plugins/orders/clobs-solana/constants.js +43 -0
  45. package/src/plugins/orders/clobs-solana/constants.js.map +1 -0
  46. package/src/plugins/orders/clobs-solana/filters.d.ts +5 -0
  47. package/src/plugins/orders/clobs-solana/filters.js +22 -0
  48. package/src/plugins/orders/clobs-solana/filters.js.map +1 -0
  49. package/src/plugins/orders/clobs-solana/openbookFetcher.d.ts +3 -0
  50. package/src/plugins/orders/clobs-solana/openbookFetcher.js +102 -0
  51. package/src/plugins/orders/clobs-solana/openbookFetcher.js.map +1 -0
  52. package/src/plugins/orders/clobs-solana/serumFetcherExecutorGenerator.d.ts +3 -0
  53. package/src/plugins/orders/clobs-solana/serumFetcherExecutorGenerator.js +156 -0
  54. package/src/plugins/orders/clobs-solana/serumFetcherExecutorGenerator.js.map +1 -0
  55. package/src/plugins/orders/clobs-solana/structs.d.ts +208 -0
  56. package/src/plugins/orders/clobs-solana/structs.js +199 -0
  57. package/src/plugins/orders/clobs-solana/structs.js.map +1 -0
  58. package/src/plugins/orders/clobs-solana/types.d.ts +18 -0
  59. package/src/plugins/orders/clobs-solana/types.js +3 -0
  60. package/src/plugins/orders/clobs-solana/types.js.map +1 -0
  61. package/src/plugins/orders/constants.d.ts +3 -0
  62. package/src/plugins/orders/constants.js +7 -0
  63. package/src/plugins/orders/constants.js.map +1 -0
  64. package/src/plugins/orders/index.d.ts +4 -0
  65. package/src/plugins/orders/index.js +52 -0
  66. package/src/plugins/orders/index.js.map +1 -0
  67. package/src/plugins/orders/jupiter/filters.d.ts +2 -0
  68. package/src/plugins/orders/jupiter/filters.js +25 -0
  69. package/src/plugins/orders/jupiter/filters.js.map +1 -0
  70. package/src/plugins/orders/jupiter/limitFetcher.d.ts +3 -0
  71. package/src/plugins/orders/jupiter/limitFetcher.js +80 -0
  72. package/src/plugins/orders/jupiter/limitFetcher.js.map +1 -0
  73. package/src/plugins/orders/jupiter/struct.d.ts +22 -0
  74. package/src/plugins/orders/jupiter/struct.js +24 -0
  75. package/src/plugins/orders/jupiter/struct.js.map +1 -0
  76. package/src/plugins/top-tokens/forcedAddresses.js +14 -1
  77. package/src/plugins/top-tokens/forcedAddresses.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,78 +2,86 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.5.42](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.41...plugins-0.5.42) (2023-08-14)
6
-
7
-
8
-
9
- ## [0.5.41](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.40...plugins-0.5.41) (2023-08-14)
10
-
11
-
12
-
13
- ## [0.5.40](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.39...plugins-0.5.40) (2023-08-14)
14
-
15
-
16
-
17
- ## [0.5.39](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.38...plugins-0.5.39) (2023-08-14)
18
-
19
-
20
-
21
- ## [0.5.38](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.37...plugins-0.5.38) (2023-08-14)
22
-
23
-
24
-
25
- ## [0.5.37](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.36...plugins-0.5.37) (2023-08-14)
26
-
27
-
28
-
29
- ## [0.5.36](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.35...plugins-0.5.36) (2023-08-14)
30
-
31
-
32
-
33
- ## [0.5.35](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.34...plugins-0.5.35) (2023-08-14)
34
-
35
-
36
-
37
- ## [0.5.34](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.33...plugins-0.5.34) (2023-08-14)
38
-
39
-
40
-
41
- ## [0.5.33](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.32...plugins-0.5.33) (2023-08-14)
42
-
43
-
44
-
45
- ## [0.5.32](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.31...plugins-0.5.32) (2023-08-14)
46
-
47
-
48
-
49
- ## [0.5.31](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.30...plugins-0.5.31) (2023-08-14)
50
-
51
-
52
-
53
- ## [0.5.30](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.29...plugins-0.5.30) (2023-08-12)
54
-
55
-
56
-
57
- ## [0.5.29](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.28...plugins-0.5.29) (2023-08-11)
58
-
59
-
60
-
61
- ## [0.5.28](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.27...plugins-0.5.28) (2023-08-11)
62
-
63
-
64
-
65
- ## [0.5.27](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.26...plugins-0.5.27) (2023-08-11)
66
-
67
-
68
-
69
- ## [0.5.26](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.25...plugins-0.5.26) (2023-08-10)
70
-
71
-
72
-
73
- ## [0.5.25](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.24...plugins-0.5.25) (2023-08-10)
5
+ ## [0.5.44](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.43...plugins-0.5.44) (2023-08-16)
74
6
 
75
7
 
76
8
 
9
+ ## [0.5.43](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.42...plugins-0.5.43) (2023-08-16)
10
+
11
+
12
+
13
+ ## [0.5.42](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.41...plugins-0.5.42) (2023-08-14)
14
+
15
+
16
+
17
+ ## [0.5.41](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.40...plugins-0.5.41) (2023-08-14)
18
+
19
+
20
+
21
+ ## [0.5.40](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.39...plugins-0.5.40) (2023-08-14)
22
+
23
+
24
+
25
+ ## [0.5.39](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.38...plugins-0.5.39) (2023-08-14)
26
+
27
+
28
+
29
+ ## [0.5.38](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.37...plugins-0.5.38) (2023-08-14)
30
+
31
+
32
+
33
+ ## [0.5.37](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.36...plugins-0.5.37) (2023-08-14)
34
+
35
+
36
+
37
+ ## [0.5.36](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.35...plugins-0.5.36) (2023-08-14)
38
+
39
+
40
+
41
+ ## [0.5.35](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.34...plugins-0.5.35) (2023-08-14)
42
+
43
+
44
+
45
+ ## [0.5.34](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.33...plugins-0.5.34) (2023-08-14)
46
+
47
+
48
+
49
+ ## [0.5.33](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.32...plugins-0.5.33) (2023-08-14)
50
+
51
+
52
+
53
+ ## [0.5.32](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.31...plugins-0.5.32) (2023-08-14)
54
+
55
+
56
+
57
+ ## [0.5.31](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.30...plugins-0.5.31) (2023-08-14)
58
+
59
+
60
+
61
+ ## [0.5.30](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.29...plugins-0.5.30) (2023-08-12)
62
+
63
+
64
+
65
+ ## [0.5.29](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.28...plugins-0.5.29) (2023-08-11)
66
+
67
+
68
+
69
+ ## [0.5.28](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.27...plugins-0.5.28) (2023-08-11)
70
+
71
+
72
+
73
+ ## [0.5.27](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.26...plugins-0.5.27) (2023-08-11)
74
+
75
+
76
+
77
+ ## [0.5.26](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.25...plugins-0.5.26) (2023-08-10)
78
+
79
+
80
+
81
+ ## [0.5.25](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.24...plugins-0.5.25) (2023-08-10)
82
+
83
+
84
+
77
85
  ## [0.5.24](https://github.com/sonarwatch/portfolio/compare/plugins-0.5.23...plugins-0.5.24) (2023-08-10)
78
86
 
79
87
 
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.5.42",
3
+ "version": "0.5.44",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
7
7
  "@aave/contract-helpers": "^1.18.2",
8
8
  "@aave/math-utils": "^1.18.2",
9
9
  "@ethersproject/address": "^5.7.0",
10
+ "@ethersproject/bignumber": "^5.7.0",
10
11
  "@ethersproject/bytes": "^5.7.0",
12
+ "@ethersproject/constants": "^5.7.0",
11
13
  "@ethersproject/providers": "^5.7.2",
14
+ "@ethersproject/units": "^5.7.0",
12
15
  "@metaplex-foundation/beet": "^0.7.1",
13
16
  "@metaplex-foundation/beet-solana": "^0.4.0",
14
17
  "@metaplex-foundation/js": "^0.19.4",
@@ -27,7 +30,7 @@
27
30
  "web3-v1": "npm:web3@^1.5.0"
28
31
  },
29
32
  "peerDependencies": {
30
- "@sonarwatch/portfolio-core": "0.5.42"
33
+ "@sonarwatch/portfolio-core": "0.5.44"
31
34
  },
32
35
  "main": "./src/index.js",
33
36
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -41,8 +41,10 @@ const cetus_1 = require("./plugins/cetus");
41
41
  const turbos_1 = require("./plugins/turbos");
42
42
  const thala_1 = require("./plugins/thala");
43
43
  const tensor_1 = require("./plugins/tensor");
44
+ const orders_1 = require("./plugins/orders");
44
45
  const aave_1 = require("./plugins/aave");
45
46
  const staking_aptos_1 = require("./plugins/staking-aptos");
47
+ const morpho_1 = require("./plugins/morpho");
46
48
  const drift_1 = require("./plugins/drift");
47
49
  const mango_1 = require("./plugins/mango");
48
50
  const top_tokens_1 = require("./plugins/top-tokens");
@@ -74,6 +76,8 @@ exports.jobs = [
74
76
  ...auxexchange_1.jobs,
75
77
  ...saber_1.jobs,
76
78
  ...aave_1.jobs,
79
+ ...orders_1.jobs,
80
+ ...morpho_1.jobs,
77
81
  ];
78
82
  exports.fetchers = [
79
83
  ...tokens_1.fetchers,
@@ -91,6 +95,8 @@ exports.fetchers = [
91
95
  ...turbos_1.fetchers,
92
96
  ...staking_aptos_1.fetchers,
93
97
  ...aave_1.fetchers,
98
+ ...orders_1.fetchers,
99
+ ...morpho_1.fetchers,
94
100
  ];
95
101
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
96
102
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,0DAA4C;AAC5C,6CAG0B;AAC1B,yDAGgC;AAChC,iDAAkE;AAClE,iDAG4B;AAC5B,2CAAoD;AACpD,6CAG0B;AAC1B,+CAG2B;AAC3B,yCAA4E;AAC5E,+CAAwD;AACxD,2CAA+E;AAC/E,6CAG0B;AAC1B,2CAA+E;AAC/E,6CAA8D;AAC9D,yCAA4E;AAC5E,2DAA2E;AAC3E,2CAA+E;AAC/E,2CAA+E;AAC/E,qDAA6D;AAC7D,uDAAgE;AAChE,qDAA8D;AAC9D,uDAAgE;AAChE,wFAAqF;AAErF,0CAAwB;AACxB,4CAA0B;AAC1B,wC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1B,2CAA+E;AAC/E,2CAA+E;AAC/E,qDAA6D;AAC7D,uDAAgE;AAChE,qDAA8D;AAC9D,uDAAgE;AAChE,wFAAqF;AAErF,0CAAwB;AACxB,4CAA0B;AAC1B,wCAAsB;AAEtB,8CAA4B;AACf,QAAA,SAAS,GAAe,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAEpD,QAAA,IAAI,GAAU;IACzB,GAAG,aAAU;IACb,GAAG,mBAAe;IAClB,GAAG,YAAS;IACZ,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,aAAU;IACb,GAAG,cAAW;IACd,GAAG,WAAQ;IACX,GAAG,YAAS;IACZ,GAAG,YAAS;IACZ,GAAG,YAAS;IACZ,GAAG,aAAU;IACb,GAAG,iBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,YAAS;IACZ,GAAG,WAAQ;IACX,GAAG,aAAU;IACb,GAAG,aAAU;CACd,CAAC;AAEW,QAAA,QAAQ,GAAc;IACjC,GAAG,iBAAc;IACjB,GAAG,uBAAmB;IACtB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,wBAAoB;IACvB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,iBAAc;CAClB,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
@@ -23,3 +23,7 @@ export declare const turbosPlatform: Platform;
23
23
  export declare const meeiroPlatform: Platform;
24
24
  export declare const nativeStakePlatform: Platform;
25
25
  export declare const saberPlatform: Platform;
26
+ export declare const jupiterPlatform: Platform;
27
+ export declare const serumPlatform: Platform;
28
+ export declare const openbookPlatform: Platform;
29
+ export declare const morphoPlatform: Platform;
package/src/platforms.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saberPlatform = exports.nativeStakePlatform = exports.meeiroPlatform = exports.turbosPlatform = exports.cetusPlatform = exports.mangoPlatform = exports.driftPlatform = exports.meteoraPlatform = exports.orcaPlatform = exports.solendPlatform = exports.raydiumPlatform = exports.animeswapPlatform = exports.dittoPlatform = exports.liquidswapPlatform = exports.pancakeswapPlatform = exports.auxExchangePlatform = exports.tortugaPlatform = exports.thalaPlatform = exports.tensorPlatform = exports.marginfiPlatform = exports.aavePlatform = exports.marinadePlatform = exports.walletNftsPlatform = exports.walletTokensPlatform = void 0;
3
+ exports.morphoPlatform = exports.openbookPlatform = exports.serumPlatform = exports.jupiterPlatform = exports.saberPlatform = exports.nativeStakePlatform = exports.meeiroPlatform = exports.turbosPlatform = exports.cetusPlatform = exports.mangoPlatform = exports.driftPlatform = exports.meteoraPlatform = exports.orcaPlatform = exports.solendPlatform = exports.raydiumPlatform = exports.animeswapPlatform = exports.dittoPlatform = exports.liquidswapPlatform = exports.pancakeswapPlatform = exports.auxExchangePlatform = exports.tortugaPlatform = exports.thalaPlatform = exports.tensorPlatform = exports.marginfiPlatform = exports.aavePlatform = exports.marinadePlatform = exports.walletNftsPlatform = exports.walletTokensPlatform = void 0;
4
4
  exports.walletTokensPlatform = {
5
5
  id: 'wallet-tokens',
6
6
  name: 'Tokens',
@@ -121,4 +121,24 @@ exports.saberPlatform = {
121
121
  name: 'Saber',
122
122
  image: 'https://alpha.sonar.watch/img/platforms/saber.png',
123
123
  };
124
+ exports.jupiterPlatform = {
125
+ id: 'jupiter',
126
+ name: 'Jupiter',
127
+ image: 'https://alpha.sonar.watch/img/platforms/jupiter.png',
128
+ };
129
+ exports.serumPlatform = {
130
+ id: 'serum',
131
+ name: 'Serum',
132
+ image: 'https://alpha.sonar.watch/img/platforms/serum.png',
133
+ };
134
+ exports.openbookPlatform = {
135
+ id: 'openbook',
136
+ name: 'OpenBook',
137
+ image: 'https://alpha.sonar.watch/img/platforms/openbook.png',
138
+ };
139
+ exports.morphoPlatform = {
140
+ id: 'morpho',
141
+ name: 'Morpho',
142
+ image: 'https://alpha.sonar.watch/img/platforms/morpho.png',
143
+ };
124
144
  //# sourceMappingURL=platforms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../../../packages/plugins/src/platforms.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAa;IAC5C,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,2DAA2D;CACnE,CAAC;AACW,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,yDAAyD;CACjE,CAAC;AACW,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,sDAAsD;CAC9D,CAAC;AACW,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,kDAAkD;CAC1D,CAAC;AACW,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,sDAAsD;CAC9D,CAAC;AACW,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,oDAAoD;CAC5D,CAAC;AACW,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,mDAAmD;CAC3D,CAAC;AACW,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,qDAAqD;CAC7D,CAAC;A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AAa;IACrC,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,mDAAmD;CAC3D,CAAC;AACW,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,oDAAoD;CAC5D,CAAC;AACW,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,oDAAoD;CAC5D,CAAC;AACW,QAAA,mBAAmB,GAAa;IAC3C,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,0DAA0D;CAClE,CAAC;AACW,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,mDAAmD;CAC3D,CAAC"}
1
+ {"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../../../packages/plugins/src/platforms.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAa;IAC5C,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,2DAA2D;CACnE,CAAC;AACW,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,yDAAyD;CACjE,CAAC;AACW,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,sDAAsD;CAC9D,CAAC;AACW,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,kDAAkD;CAC1D,CAAC;AACW,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,sDAAsD;CAC9D,CAAC;AACW,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,QAAQ;IACZ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E,oDAAoD;CAC5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const helpers_1 = require("./helpers");
19
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
+ const collateralUnderlyings = [
21
+ constants_1.Underlying.wsteth,
22
+ constants_1.Underlying.dai,
23
+ constants_1.Underlying.usdc,
24
+ constants_1.Underlying.wbtc,
25
+ constants_1.Underlying.reth,
26
+ constants_1.Underlying.cbeth,
27
+ constants_1.Underlying.weth,
28
+ ];
29
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
30
+ const collateralPromises = collateralUnderlyings.map((u) => (0, helpers_1.getCurrentCollateralBalanceInOf)(u, owner));
31
+ const borrowPromises = collateralUnderlyings.map((u) => (0, helpers_1.getCurrentBorrowBalanceInOf)(u, owner));
32
+ const tokenPricesPromise = cache.getTokenPrices(collateralUnderlyings, portfolio_core_1.NetworkId.ethereum);
33
+ const promises = [
34
+ tokenPricesPromise,
35
+ ...collateralPromises,
36
+ ...borrowPromises,
37
+ ];
38
+ yield Promise.all(promises);
39
+ const tokenPrices = yield tokenPricesPromise;
40
+ const suppliedAssets = [];
41
+ const suppliedYields = [];
42
+ const borrowedAssets = [];
43
+ const borrowedYields = [];
44
+ const rewardAssets = [];
45
+ const collateralBalances = yield Promise.all(collateralPromises);
46
+ collateralBalances.forEach((collateralBalance, i) => {
47
+ const tokenPrice = tokenPrices[i];
48
+ if (!tokenPrice)
49
+ return;
50
+ const amount = new bignumber_js_1.default(collateralBalance.toString())
51
+ .div(Math.pow(10, tokenPrice.decimals))
52
+ .toNumber();
53
+ if (amount === 0)
54
+ return;
55
+ suppliedYields.push([]);
56
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, portfolio_core_1.NetworkId.ethereum, tokenPrice));
57
+ });
58
+ const borrowBalances = yield Promise.all(borrowPromises);
59
+ borrowBalances.forEach((borrowBalance, i) => {
60
+ const tokenPrice = tokenPrices[i];
61
+ if (!tokenPrice)
62
+ return;
63
+ const amount = new bignumber_js_1.default(borrowBalance.toString())
64
+ .div(Math.pow(10, tokenPrice.decimals))
65
+ .toNumber();
66
+ if (amount === 0)
67
+ return;
68
+ borrowedYields.push([]);
69
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, portfolio_core_1.NetworkId.ethereum, tokenPrice));
70
+ });
71
+ const { borrowedValue, collateralRatio, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
72
+ if (borrowedValue === 0 && suppliedValue === 0)
73
+ return [];
74
+ const element = {
75
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
76
+ networkId: portfolio_core_1.NetworkId.solana,
77
+ platformId: constants_1.platformId,
78
+ label: 'Lending',
79
+ value,
80
+ name: 'AaveV3',
81
+ data: {
82
+ borrowedAssets,
83
+ borrowedValue,
84
+ borrowedYields,
85
+ suppliedAssets,
86
+ suppliedValue,
87
+ suppliedYields,
88
+ collateralRatio,
89
+ rewardAssets,
90
+ value,
91
+ },
92
+ };
93
+ return [element];
94
+ });
95
+ const fetcher = {
96
+ id: `${constants_1.platformId}-aave-v3-collateral`,
97
+ networkId: portfolio_core_1.NetworkId.ethereum,
98
+ executor,
99
+ };
100
+ exports.default = fetcher;
101
+ //# sourceMappingURL=aaveV3CollateralFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aaveV3CollateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/morpho/aaveV3CollateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AACrC,2CAAqD;AAGrD,uCAGmB;AACnB,qGAA6E;AAE7E,MAAM,qBAAqB,GAAG;IAC5B,sBAAU,CAAC,MAAM;IACjB,sBAAU,CAAC,GAAG;IACd,sBAAU,CAAC,IAAI;IACf,sBAAU,CAAC,IAAI;IACf,sBAAU,CAAC,IAAI;IACf,sBAAU,CAAC,KAAK;IAChB,sBAAU,CAAC,IAAI;CAChB,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACzD,IAAA,yCAA+B,EAAC,CAAC,EAAE,KAAK,CAAC,CAC1C,CAAC;IACF,MAAM,cAAc,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACrD,IAAA,qCAA2B,EAAC,CAAC,EAAE,KAAK,CAAC,CACtC,CAAC;IAEF,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAC7C,qBAAqB,EACrB,0BAAS,CAAC,QAAQ,CACnB,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,kBAAkB;QAClB,GAAG,kBAAkB;QACrB,GAAG,cAAc;KAClB,CAAC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AAQ,EAAE,CAAC;aACnD,GAAG,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC;aAC9B,QAAQ,EAAE,CAAC;QACd,IAAI,MAAM,KAAK,CAAC;YAAE,OAAO;QACzB,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,0BAAS,CAAC,QAAQ,EAClB,UAAU,CACX,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,GAC5D,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IACxE,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1D,MAAM,OAAO,GAA+B;QAC1C,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe;YACf,YAAY;YACZ,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,qBAAqB;IACtC,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const viem_1 = require("viem");
14
+ const constants_1 = require("./constants");
15
+ const clients_1 = require("../../utils/clients");
16
+ const abis_1 = require("./utils/abis");
17
+ const helpers_1 = require("./helpers");
18
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
+ const client = (0, clients_1.getEvmClient)(portfolio_core_1.NetworkId.ethereum);
20
+ const wEthUpdatedIndexes = yield client.readContract({
21
+ abi: abis_1.MorphoAaveV3Abi,
22
+ functionName: 'updatedIndexes',
23
+ args: [(0, viem_1.getAddress)(constants_1.wethAddress)],
24
+ address: (0, viem_1.getAddress)(constants_1.morphoAaveV3Address),
25
+ });
26
+ yield cache.setItem(constants_1.wethAddress, (0, helpers_1.parseUpdatedIndexes)(wEthUpdatedIndexes), {
27
+ networkId: portfolio_core_1.NetworkId.ethereum,
28
+ prefix: constants_1.updatedIndexesPrefix,
29
+ });
30
+ });
31
+ const job = {
32
+ id: `${constants_1.platformId}-aave-v3`,
33
+ executor,
34
+ };
35
+ exports.default = job;
36
+ //# sourceMappingURL=aaveV3Job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aaveV3Job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/morpho/aaveV3Job.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,+BAAkC;AAClC,2CAKqB;AAGrB,iDAAmD;AACnD,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,0BAAS,CAAC,QAAQ,CAAC,CAAC;IAEhD,MAAM,kBAAkB,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;QACnD,GAAG,EAAE,sBAAe;QACpB,YAAY,EAAE,gBAAgB;QAC9B,IAAI,EAAE,CAAC,IAAA,iBAAU,EAAC,uBAAW,CAAC,CAAC;QAC/B,OAAO,EAAE,IAAA,iBAAU,EAAC,+BAAmB,CAAC;KACzC,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,OAAO,CAAC,uBAAW,EAAE,IAAA,6BAAmB,EAAC,kBAAkB,CAAC,EAAE;QACxE,SAAS,EAAE,0BAAS,CAAC,QAAQ;QAC7B,MAAM,EAAE,gCAAoB;KAC7B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;CACT,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const helpers_1 = require("./helpers");
19
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const tokenPricePrice = cache.getTokenPrice(constants_1.wethAddress, portfolio_core_1.NetworkId.ethereum);
22
+ const balance = yield (0, helpers_1.getCurrentSupplyBalanceInOf)(constants_1.wethAddress, owner);
23
+ const amount = new bignumber_js_1.default(balance.toString())
24
+ .div(Math.pow(10, constants_1.wethDecimals))
25
+ .toNumber();
26
+ if (amount === 0)
27
+ return [];
28
+ const tokenPrice = yield tokenPricePrice;
29
+ const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.wethAddress, amount, portfolio_core_1.NetworkId.ethereum, tokenPrice);
30
+ const element = {
31
+ type: portfolio_core_1.PortfolioElementType.liquidity,
32
+ networkId: portfolio_core_1.NetworkId.ethereum,
33
+ platformId: constants_1.platformId,
34
+ label: 'Lending',
35
+ value: asset.value,
36
+ name: 'AaveV3',
37
+ data: {
38
+ liquidities: [
39
+ {
40
+ assets: [asset],
41
+ assetsValue: asset.value,
42
+ rewardAssets: [],
43
+ rewardAssetsValue: null,
44
+ value: asset.value,
45
+ yields: [],
46
+ },
47
+ ],
48
+ },
49
+ };
50
+ return [element];
51
+ });
52
+ const fetcher = {
53
+ id: `${constants_1.platformId}-aave-v3-supply-only`,
54
+ networkId: portfolio_core_1.NetworkId.ethereum,
55
+ executor,
56
+ };
57
+ exports.default = fetcher;
58
+ //# sourceMappingURL=aaveV3SupplyOnlyFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aaveV3SupplyOnlyFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/morpho/aaveV3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ACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const platformId = "morpho";
2
+ export declare const updatedIndexesPrefix: string;
3
+ export declare const morphoAaveV3Address = "0x33333aea097c193e66081E930c33020272b33333";
4
+ export declare const morphoTokenAddress = "0x9994E35Db50125E0DF82e4c2dde62496CE330999";
5
+ export declare const Underlying: {
6
+ usdc: string;
7
+ dai: string;
8
+ wbtc: string;
9
+ wsteth: string;
10
+ steth: string;
11
+ uni: string;
12
+ usdt: string;
13
+ weth: string;
14
+ reth: string;
15
+ cbeth: string;
16
+ };
17
+ export declare const wethAddress = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
18
+ export declare const wethDecimals = 18;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wethDecimals = exports.wethAddress = exports.Underlying = exports.morphoTokenAddress = exports.morphoAaveV3Address = exports.updatedIndexesPrefix = exports.platformId = void 0;
4
+ exports.platformId = 'morpho';
5
+ exports.updatedIndexesPrefix = `${exports.platformId}-updated-indexes`;
6
+ exports.morphoAaveV3Address = '0x33333aea097c193e66081E930c33020272b33333';
7
+ exports.morphoTokenAddress = '0x9994E35Db50125E0DF82e4c2dde62496CE330999';
8
+ exports.Underlying = {
9
+ usdc: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
10
+ dai: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
11
+ wbtc: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599',
12
+ wsteth: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
13
+ steth: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
14
+ uni: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
15
+ usdt: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
16
+ weth: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
17
+ reth: '0xae78736Cd615f374D3085123A210448E74Fc6393',
18
+ cbeth: '0xBe9895146f7AF43049ca1c1AE358B0541Ea49704',
19
+ };
20
+ exports.wethAddress = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
21
+ exports.wethDecimals = 18;
22
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/morpho/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,oBAAoB,GAAG,GAAG,kBAAU,kBAAkB,CAAC;AACvD,QAAA,mBAAmB,GAAG,4CAA4C,CAAC;AACnE,QAAA,kBAAkB,GAAG,4CAA4C,CAAC;AAElE,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,4CAA4C;IAClD,GAAG,EAAE,4CAA4C;IACjD,IAAI,EAAE,4CAA4C;IAClD,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,4CAA4C;IACnD,GAAG,EAAE,4CAA4C;IACjD,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,4CAA4C;IAClD,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAEW,QAAA,WAAW,GAAG,4CAA4C,CAAC;AAC3D,QAAA,YAAY,GAAG,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ParsedUpdatedIndexes, UpdatedIndexes } from './types';
2
+ export declare function parseUpdatedIndexes(updatedIndexes: UpdatedIndexes): ParsedUpdatedIndexes;
3
+ export declare const getCurrentSupplyBalanceInOf: (underlying: string, owner: string) => Promise<import("ethers").BigNumber>;
4
+ export declare const getCurrentCollateralBalanceInOf: (underlying: string, owner: string) => Promise<bigint>;
5
+ export declare const getCurrentBorrowBalanceInOf: (underlying: string, owner: string) => Promise<import("ethers").BigNumber>;