@sonarwatch/portfolio-plugins 0.8.89 → 0.8.90

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 (34) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/package.json +2 -2
  3. package/src/index.js +4 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/yearn/abis.d.ts +185 -0
  6. package/src/plugins/yearn/abis.js +144 -0
  7. package/src/plugins/yearn/abis.js.map +1 -0
  8. package/src/plugins/yearn/constants.d.ts +9 -0
  9. package/src/plugins/yearn/constants.js +33 -0
  10. package/src/plugins/yearn/constants.js.map +1 -0
  11. package/src/plugins/yearn/getLockersBalancesFetcher.d.ts +4 -0
  12. package/src/plugins/yearn/getLockersBalancesFetcher.js +56 -0
  13. package/src/plugins/yearn/getLockersBalancesFetcher.js.map +1 -0
  14. package/src/plugins/yearn/getStakesBalancesFetcher.d.ts +4 -0
  15. package/src/plugins/yearn/getStakesBalancesFetcher.js +70 -0
  16. package/src/plugins/yearn/getStakesBalancesFetcher.js.map +1 -0
  17. package/src/plugins/yearn/getVaultsBalancesFetcher.d.ts +3 -0
  18. package/src/plugins/yearn/getVaultsBalancesFetcher.js +95 -0
  19. package/src/plugins/yearn/getVaultsBalancesFetcher.js.map +1 -0
  20. package/src/plugins/yearn/getVaultsJob.d.ts +3 -0
  21. package/src/plugins/yearn/getVaultsJob.js +29 -0
  22. package/src/plugins/yearn/getVaultsJob.js.map +1 -0
  23. package/src/plugins/yearn/getYearnStakeBalancesFetcher.d.ts +4 -0
  24. package/src/plugins/yearn/getYearnStakeBalancesFetcher.js +85 -0
  25. package/src/plugins/yearn/getYearnStakeBalancesFetcher.js.map +1 -0
  26. package/src/plugins/yearn/helpers.d.ts +5 -0
  27. package/src/plugins/yearn/helpers.js +67 -0
  28. package/src/plugins/yearn/helpers.js.map +1 -0
  29. package/src/plugins/yearn/index.d.ts +6 -0
  30. package/src/plugins/yearn/index.js +22 -0
  31. package/src/plugins/yearn/index.js.map +1 -0
  32. package/src/plugins/yearn/types.d.ts +75 -0
  33. package/src/plugins/yearn/types.js +3 -0
  34. package/src/plugins/yearn/types.js.map +1 -0
package/CHANGELOG.md CHANGED
@@ -2,10 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.8.89](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.88...plugins-0.8.89) (2023-11-21)
5
+ ## [0.8.90](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.89...plugins-0.8.90) (2023-11-21)
6
6
 
7
7
 
8
8
 
9
+ ## [0.8.89](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.88...plugins-0.8.89) (2023-11-21)
10
+
11
+
12
+
9
13
  ## [0.8.88](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.87...plugins-0.8.88) (2023-11-21)
10
14
 
11
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.8.89",
3
+ "version": "0.8.90",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -40,7 +40,7 @@
40
40
  "web3-v1": "npm:web3@^1.5.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@sonarwatch/portfolio-core": "0.8.89"
43
+ "@sonarwatch/portfolio-core": "0.8.90"
44
44
  },
45
45
  "main": "./src/index.js",
46
46
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -69,6 +69,7 @@ const jupiter_1 = require("./plugins/jupiter");
69
69
  const zeta_1 = require("./plugins/zeta");
70
70
  const venus_1 = require("./plugins/venus");
71
71
  const sushiswap_1 = require("./plugins/sushiswap");
72
+ const yearn_1 = require("./plugins/yearn");
72
73
  var constants_1 = require("./plugins/tokens/constants");
73
74
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
74
75
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -127,6 +128,7 @@ exports.platforms = [
127
128
  ...zeta_1.platforms,
128
129
  ...venus_1.platforms,
129
130
  ...sushiswap_1.platforms,
131
+ ...yearn_1.platforms,
130
132
  ];
131
133
  // JOBS //
132
134
  exports.jobs = [
@@ -172,6 +174,7 @@ exports.jobs = [
172
174
  ...zeta_1.jobs,
173
175
  ...venus_1.jobs,
174
176
  ...sushiswap_1.jobs,
177
+ ...yearn_1.jobs,
175
178
  ];
176
179
  // FETCHERS //
177
180
  exports.fetchers = [
@@ -218,6 +221,7 @@ exports.fetchers = [
218
221
  ...zeta_1.fetchers,
219
222
  ...venus_1.fetchers,
220
223
  ...sushiswap_1.fetchers,
224
+ ...yearn_1.fetchers,
221
225
  ];
222
226
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
223
227
  //# 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,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAG2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAG6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uD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a;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,wBAAoB;IACvB,GAAG,sBAAmB;IACtB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,6BAAyB;IAC5B,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,sBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;CACrB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAG2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAG6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,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AgB;IACnB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,wBAAoB;IACvB,GAAG,sBAAmB;IACtB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,6BAAyB;IAC5B,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,sBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;CACjB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
@@ -0,0 +1,185 @@
1
+ export declare const lockersAbi: {
2
+ readonly locks: {
3
+ readonly stateMutability: "view";
4
+ readonly type: "function";
5
+ readonly name: "locked";
6
+ readonly inputs: readonly [{
7
+ readonly name: "arg0";
8
+ readonly type: "address";
9
+ }];
10
+ readonly outputs: readonly [{
11
+ readonly name: "amount";
12
+ readonly type: "int128";
13
+ }, {
14
+ readonly name: "end";
15
+ readonly type: "uint256";
16
+ }];
17
+ readonly gas: 5653;
18
+ };
19
+ readonly claimableRewards: {
20
+ readonly inputs: readonly [{
21
+ readonly internalType: "address";
22
+ readonly name: "_account";
23
+ readonly type: "address";
24
+ }];
25
+ readonly name: "claimableRewards";
26
+ readonly outputs: readonly [{
27
+ readonly components: readonly [{
28
+ readonly internalType: "address";
29
+ readonly name: "token";
30
+ readonly type: "address";
31
+ }, {
32
+ readonly internalType: "uint256";
33
+ readonly name: "amount";
34
+ readonly type: "uint256";
35
+ }];
36
+ readonly internalType: "struct AuraLocker.EarnedData[]";
37
+ readonly name: "userRewards";
38
+ readonly type: "tuple[]";
39
+ }];
40
+ readonly stateMutability: "view";
41
+ readonly type: "function";
42
+ };
43
+ readonly lockedBalances: {
44
+ readonly noBoost: {
45
+ readonly inputs: readonly [{
46
+ readonly internalType: "address";
47
+ readonly name: "_user";
48
+ readonly type: "address";
49
+ }];
50
+ readonly name: "lockedBalances";
51
+ readonly outputs: readonly [{
52
+ readonly internalType: "uint256";
53
+ readonly name: "total";
54
+ readonly type: "uint256";
55
+ }, {
56
+ readonly internalType: "uint256";
57
+ readonly name: "unlockable";
58
+ readonly type: "uint256";
59
+ }, {
60
+ readonly internalType: "uint256";
61
+ readonly name: "locked";
62
+ readonly type: "uint256";
63
+ }, {
64
+ readonly components: readonly [{
65
+ readonly internalType: "uint112";
66
+ readonly name: "amount";
67
+ readonly type: "uint112";
68
+ }, {
69
+ readonly internalType: "uint32";
70
+ readonly name: "unlockTime";
71
+ readonly type: "uint32";
72
+ }];
73
+ readonly internalType: "struct AuraLocker.LockedBalance[]";
74
+ readonly name: "lockData";
75
+ readonly type: "tuple[]";
76
+ }];
77
+ readonly stateMutability: "view";
78
+ readonly type: "function";
79
+ };
80
+ readonly boost: {
81
+ readonly inputs: readonly [{
82
+ readonly internalType: "address";
83
+ readonly name: "_user";
84
+ readonly type: "address";
85
+ }];
86
+ readonly name: "lockedBalances";
87
+ readonly outputs: readonly [{
88
+ readonly internalType: "uint256";
89
+ readonly name: "total";
90
+ readonly type: "uint256";
91
+ }, {
92
+ readonly internalType: "uint256";
93
+ readonly name: "unlockable";
94
+ readonly type: "uint256";
95
+ }, {
96
+ readonly internalType: "uint256";
97
+ readonly name: "locked";
98
+ readonly type: "uint256";
99
+ }, {
100
+ readonly components: readonly [{
101
+ readonly internalType: "uint112";
102
+ readonly name: "amount";
103
+ readonly type: "uint112";
104
+ }, {
105
+ readonly internalType: "uint112";
106
+ readonly name: "boosted";
107
+ readonly type: "uint112";
108
+ }, {
109
+ readonly internalType: "uint32";
110
+ readonly name: "unlockTime";
111
+ readonly type: "uint32";
112
+ }];
113
+ readonly internalType: "struct CvxLockerV2.LockedBalance[]";
114
+ readonly name: "lockData";
115
+ readonly type: "tuple[]";
116
+ }];
117
+ readonly stateMutability: "view";
118
+ readonly type: "function";
119
+ };
120
+ };
121
+ readonly tokenOfOwnerByIndex: {
122
+ readonly inputs: readonly [{
123
+ readonly internalType: "address";
124
+ readonly name: "owner";
125
+ readonly type: "address";
126
+ }, {
127
+ readonly internalType: "uint256";
128
+ readonly name: "index";
129
+ readonly type: "uint256";
130
+ }];
131
+ readonly name: "tokenOfOwnerByIndex";
132
+ readonly outputs: readonly [{
133
+ readonly internalType: "uint256";
134
+ readonly name: "";
135
+ readonly type: "uint256";
136
+ }];
137
+ readonly stateMutability: "view";
138
+ readonly type: "function";
139
+ };
140
+ readonly nftLocked: {
141
+ readonly inputs: readonly [{
142
+ readonly internalType: "uint256";
143
+ readonly name: "";
144
+ readonly type: "uint256";
145
+ }];
146
+ readonly name: "nftLocked";
147
+ readonly outputs: readonly [{
148
+ readonly internalType: "int256";
149
+ readonly name: "amount";
150
+ readonly type: "int256";
151
+ }, {
152
+ readonly internalType: "uint256";
153
+ readonly name: "end";
154
+ readonly type: "uint256";
155
+ }];
156
+ readonly stateMutability: "view";
157
+ readonly type: "function";
158
+ };
159
+ };
160
+ export declare const yearnStakeAbi: {
161
+ readonly pricePerShare: {
162
+ readonly stateMutability: "view";
163
+ readonly type: "function";
164
+ readonly name: "pricePerShare";
165
+ readonly inputs: readonly [];
166
+ readonly outputs: readonly [{
167
+ readonly name: "";
168
+ readonly type: "uint256";
169
+ }];
170
+ readonly gas: 43519;
171
+ };
172
+ readonly convertToAssets: {
173
+ readonly stateMutability: "view";
174
+ readonly type: "function";
175
+ readonly name: "convertToAssets";
176
+ readonly inputs: readonly [{
177
+ readonly name: "_shares";
178
+ readonly type: "uint256";
179
+ }];
180
+ readonly outputs: readonly [{
181
+ readonly name: "";
182
+ readonly type: "uint256";
183
+ }];
184
+ };
185
+ };
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.yearnStakeAbi = exports.lockersAbi = void 0;
4
+ exports.lockersAbi = {
5
+ locks: {
6
+ stateMutability: 'view',
7
+ type: 'function',
8
+ name: 'locked',
9
+ inputs: [{ name: 'arg0', type: 'address' }],
10
+ outputs: [
11
+ { name: 'amount', type: 'int128' },
12
+ { name: 'end', type: 'uint256' },
13
+ ],
14
+ gas: 5653,
15
+ },
16
+ claimableRewards: {
17
+ inputs: [{ internalType: 'address', name: '_account', type: 'address' }],
18
+ name: 'claimableRewards',
19
+ outputs: [
20
+ {
21
+ components: [
22
+ { internalType: 'address', name: 'token', type: 'address' },
23
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
24
+ ],
25
+ internalType: 'struct AuraLocker.EarnedData[]',
26
+ name: 'userRewards',
27
+ type: 'tuple[]',
28
+ },
29
+ ],
30
+ stateMutability: 'view',
31
+ type: 'function',
32
+ },
33
+ lockedBalances: {
34
+ noBoost: {
35
+ inputs: [{ internalType: 'address', name: '_user', type: 'address' }],
36
+ name: 'lockedBalances',
37
+ outputs: [
38
+ { internalType: 'uint256', name: 'total', type: 'uint256' },
39
+ { internalType: 'uint256', name: 'unlockable', type: 'uint256' },
40
+ { internalType: 'uint256', name: 'locked', type: 'uint256' },
41
+ {
42
+ components: [
43
+ { internalType: 'uint112', name: 'amount', type: 'uint112' },
44
+ { internalType: 'uint32', name: 'unlockTime', type: 'uint32' },
45
+ ],
46
+ internalType: 'struct AuraLocker.LockedBalance[]',
47
+ name: 'lockData',
48
+ type: 'tuple[]',
49
+ },
50
+ ],
51
+ stateMutability: 'view',
52
+ type: 'function',
53
+ },
54
+ boost: {
55
+ inputs: [
56
+ {
57
+ internalType: 'address',
58
+ name: '_user',
59
+ type: 'address',
60
+ },
61
+ ],
62
+ name: 'lockedBalances',
63
+ outputs: [
64
+ {
65
+ internalType: 'uint256',
66
+ name: 'total',
67
+ type: 'uint256',
68
+ },
69
+ {
70
+ internalType: 'uint256',
71
+ name: 'unlockable',
72
+ type: 'uint256',
73
+ },
74
+ {
75
+ internalType: 'uint256',
76
+ name: 'locked',
77
+ type: 'uint256',
78
+ },
79
+ {
80
+ components: [
81
+ {
82
+ internalType: 'uint112',
83
+ name: 'amount',
84
+ type: 'uint112',
85
+ },
86
+ {
87
+ internalType: 'uint112',
88
+ name: 'boosted',
89
+ type: 'uint112',
90
+ },
91
+ {
92
+ internalType: 'uint32',
93
+ name: 'unlockTime',
94
+ type: 'uint32',
95
+ },
96
+ ],
97
+ internalType: 'struct CvxLockerV2.LockedBalance[]',
98
+ name: 'lockData',
99
+ type: 'tuple[]',
100
+ },
101
+ ],
102
+ stateMutability: 'view',
103
+ type: 'function',
104
+ },
105
+ },
106
+ tokenOfOwnerByIndex: {
107
+ inputs: [
108
+ { internalType: 'address', name: 'owner', type: 'address' },
109
+ { internalType: 'uint256', name: 'index', type: 'uint256' },
110
+ ],
111
+ name: 'tokenOfOwnerByIndex',
112
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
113
+ stateMutability: 'view',
114
+ type: 'function',
115
+ },
116
+ nftLocked: {
117
+ inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
118
+ name: 'nftLocked',
119
+ outputs: [
120
+ { internalType: 'int256', name: 'amount', type: 'int256' },
121
+ { internalType: 'uint256', name: 'end', type: 'uint256' },
122
+ ],
123
+ stateMutability: 'view',
124
+ type: 'function',
125
+ },
126
+ };
127
+ exports.yearnStakeAbi = {
128
+ pricePerShare: {
129
+ stateMutability: 'view',
130
+ type: 'function',
131
+ name: 'pricePerShare',
132
+ inputs: [],
133
+ outputs: [{ name: '', type: 'uint256' }],
134
+ gas: 43519,
135
+ },
136
+ convertToAssets: {
137
+ stateMutability: 'view',
138
+ type: 'function',
139
+ name: 'convertToAssets',
140
+ inputs: [{ name: '_shares', type: 'uint256' }],
141
+ outputs: [{ name: '', type: 'uint256' }],
142
+ },
143
+ };
144
+ //# sourceMappingURL=abis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/abis.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE;QACL,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC3C,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;SACjC;QACD,GAAG,EAAE,IAAI;KACV;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxE,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE;YACP;gBACE,UAAU,EAAE;oBACV,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;iBAC7D;gBACD,YAAY,EAAE,gCAAgC;gBAC9C,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,MAAM;QACv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vB,IAAI,EAAE,UAAU;KACjB;CACO,CAAC;AAEE,QAAA,aAAa,GAAG;IAC3B,aAAa,EAAE;QACb,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,GAAG,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QACf,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;CACO,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Contract } from './types';
3
+ export declare const platformId = "yearn";
4
+ export declare const platform: Platform;
5
+ export declare const vaultsKey = "vaults";
6
+ export declare const yearnApiUrl = "https://api.yexporter.io/v1/chains";
7
+ export declare const lockersEth: Contract[];
8
+ export declare const yETHStake: Contract[];
9
+ export declare const styETHStake: Contract[];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.styETHStake = exports.yETHStake = exports.lockersEth = exports.yearnApiUrl = exports.vaultsKey = exports.platform = exports.platformId = void 0;
4
+ exports.platformId = 'yearn';
5
+ exports.platform = {
6
+ id: exports.platformId,
7
+ name: 'Yearn',
8
+ image: 'https://sonar.watch/img/platforms/yearn.png',
9
+ website: 'https://yearn.fi/',
10
+ defiLlamaId: 'yearn-finance', // from https://defillama.com/docs/api
11
+ // twitter: 'https://twitter.com/myplatform',
12
+ };
13
+ exports.vaultsKey = 'vaults';
14
+ exports.yearnApiUrl = 'https://api.yexporter.io/v1/chains';
15
+ exports.lockersEth = [
16
+ {
17
+ address: '0x90c1f9220d90d3966fbee24045edd73e1d588ad5',
18
+ underlying: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
19
+ },
20
+ ];
21
+ exports.yETHStake = [
22
+ {
23
+ address: '0x1bed97cbc3c24a4fb5c069c6e311a967386131f7',
24
+ underlying: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
25
+ },
26
+ ];
27
+ exports.styETHStake = [
28
+ {
29
+ address: '0x583019ff0f430721ada9cfb4fac8f06ca104d0b4',
30
+ underlying: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
31
+ },
32
+ ];
33
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,mBAAmB;IAC5B,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,6CAA6C;CAC9C,CAAC;AACW,QAAA,SAAS,GAAG,QAAQ,CAAC;AACrB,QAAA,WAAW,GAAG,oCAAoC,CAAC;AACnD,QAAA,UAAU,GAAe;IACpC;QACE,OAAO,EAAE,4CAA4C;QACrD,UAAU,EAAE,4CAA4C;KACzD;CACF,CAAC;AAEW,QAAA,SAAS,GAAe;IACnC;QACE,OAAO,EAAE,4CAA4C;QACrD,UAAU,EAAE,4CAA4C;KACzD;CACF,CAAC;AAEW,QAAA,WAAW,GAAe;IACrC;QACE,OAAO,EAAE,4CAA4C;QACrD,UAAU,EAAE,4CAA4C;KACzD;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Contract } from './types';
4
+ export default function getLockersBalancesFetcher(networkId: EvmNetworkIdType, platformId: string, lockers: Contract[]): Fetcher;
@@ -0,0 +1,56 @@
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 helpers_1 = require("./helpers");
18
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
19
+ function getLockersBalancesFetcher(networkId, platformId, lockers) {
20
+ const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
21
+ const lockedBalances = yield (0, helpers_1.getLockersBalances)(networkId, lockers.map((l) => l.address), owner);
22
+ const elements = [];
23
+ for (let index = 0; index < lockedBalances.length; index++) {
24
+ const balance = lockedBalances[index];
25
+ if (balance.amount > BigInt(0)) {
26
+ const { underlying } = lockers[index];
27
+ const tokenPrice = yield cache.getTokenPrice(underlying, networkId);
28
+ if (!tokenPrice)
29
+ continue;
30
+ const amount = new bignumber_js_1.default(balance.amount.toString())
31
+ .dividedBy(Math.pow(10, tokenPrice.decimals))
32
+ .toNumber();
33
+ const asset = (0, tokenPriceToAssetToken_1.default)(underlying, amount, networkId, tokenPrice);
34
+ elements.push({
35
+ networkId,
36
+ label: 'Staked',
37
+ platformId,
38
+ name: `Locked`,
39
+ type: portfolio_core_1.PortfolioElementType.multiple,
40
+ value: asset.value,
41
+ data: {
42
+ assets: [asset],
43
+ },
44
+ });
45
+ }
46
+ }
47
+ return elements;
48
+ });
49
+ return {
50
+ networkId,
51
+ executor,
52
+ id: `${platformId}-${networkId}-lockers`,
53
+ };
54
+ }
55
+ exports.default = getLockersBalancesFetcher;
56
+ //# sourceMappingURL=getLockersBalancesFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLockersBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getLockersBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AACrC,uCAA+C;AAE/C,qGAA6E;AAI7E,SAAwB,yBAAyB,CAC/C,SAA2B,EAC3B,UAAkB,EAClB,OAAmB;IAEnB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,cAAc,GAAG,MAAM,IAAA,4BAAkB,EAC7C,SAAS,EACT,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC7B,KAAK,CACN,CAAC;QAEF,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAC1D,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YACtC,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE;gBAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;gBACtC,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACpE,IAAI,CAAC,UAAU;oBAAE,SAAS;gBAE1B,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;qBACpD,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC;qBACpC,QAAQ,EAAE,CAAC;gBACd,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,CACX,CAAC;gBACF,QAAQ,CAAC,IAAI,CAAC;oBACZ,SAAS;oBACT,KAAK,EAAE,QAAQ;oBACf,UAAU;oBACV,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,qCAAoB,CAAC,QAAQ;oBACnC,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,IAAI,EAAE;wBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;qBAChB;iBACF,CAAC,CAAC;aACJ;SACF;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,UAAU;KACzC,CAAC;AACJ,CAAC;AAlDD,4CAkDC"}
@@ -0,0 +1,4 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { Contract } from './types';
3
+ import { Fetcher } from '../../Fetcher';
4
+ export default function getStakesBalancesFetcher(networkId: EvmNetworkIdType, platformId: string, contracts: Contract[]): Fetcher;
@@ -0,0 +1,70 @@
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 helpers_1 = require("./helpers");
18
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
19
+ function getStakesBalancesFetcher(networkId, platformId, contracts) {
20
+ const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
21
+ const balances = yield (0, helpers_1.getBalances)(networkId, contracts.map((c) => c.address), owner);
22
+ const tokenAddresses = contracts.map((v) => v.underlying);
23
+ const tokensPrices = yield cache.getTokenPrices(tokenAddresses, networkId);
24
+ const tokenPriceById = new Map();
25
+ tokensPrices.forEach((tP) => tP ? tokenPriceById.set(tP.address, tP) : []);
26
+ const liquidities = [];
27
+ for (let index = 0; index < balances.length; index++) {
28
+ const balance = balances[index];
29
+ if (balance > BigInt(0)) {
30
+ const { underlying } = contracts[index];
31
+ const tokenPrice = tokenPriceById.get(underlying);
32
+ if (!tokenPrice)
33
+ continue;
34
+ const amount = new bignumber_js_1.default(balance.toString())
35
+ .dividedBy(new bignumber_js_1.default(10).pow(tokenPrice.decimals))
36
+ .toNumber();
37
+ const asset = (0, tokenPriceToAssetToken_1.default)(underlying, amount, networkId, tokenPrice);
38
+ liquidities.push({
39
+ assets: [asset],
40
+ assetsValue: asset.value,
41
+ rewardAssets: [],
42
+ rewardAssetsValue: null,
43
+ value: asset.value,
44
+ yields: [],
45
+ });
46
+ }
47
+ }
48
+ if (liquidities.length === 0)
49
+ return [];
50
+ return [
51
+ {
52
+ type: portfolio_core_1.PortfolioElementType.liquidity,
53
+ label: 'Staked',
54
+ networkId,
55
+ platformId,
56
+ value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((l) => l.value)),
57
+ data: {
58
+ liquidities,
59
+ },
60
+ },
61
+ ];
62
+ });
63
+ return {
64
+ networkId,
65
+ executor,
66
+ id: `${platformId}-${networkId}-stake`,
67
+ };
68
+ }
69
+ exports.default = getStakesBalancesFetcher;
70
+ //# sourceMappingURL=getStakesBalancesFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStakesBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getStakesBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,uCAAwC;AAGxC,qGAA6E;AAE7E,SAAwB,wBAAwB,CAC9C,SAA2B,EAC3B,UAAkB,EAClB,SAAqB;IAErB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAW,EAChC,SAAS,EACT,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC/B,KAAK,CACN,CAAC;QAEF,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QAC3E,MAAM,cAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;QAC1D,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAC1B,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAC7C,CAAC;QAEF,MAAM,WAAW,GAAyB,EAAE,CAAC;QAC7C,KAAK,IAAI,KA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BACZ;aACF;SACF,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,QAAQ;KACvC,CAAC;AACJ,CAAC;AArED,2CAqEC"}
@@ -0,0 +1,3 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ export default function getVaultsBalancesFetcher(networkId: EvmNetworkIdType, platformId: string): Fetcher;
@@ -0,0 +1,95 @@
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
+ function getVaultsBalancesFetcher(networkId, platformId) {
21
+ const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
22
+ const vaults = yield cache.getItem(constants_1.vaultsKey, {
23
+ prefix: platformId,
24
+ networkId,
25
+ });
26
+ if (!vaults)
27
+ return [];
28
+ const balances = yield (0, helpers_1.getBalances)(networkId, vaults.map((v) => v.address), owner);
29
+ if (balances.length === 0)
30
+ return [];
31
+ const tokenAddresses = vaults
32
+ .map((v) => (v.endorsed ? v.token.address : []))
33
+ .flat();
34
+ const tokensPrices = yield cache.getTokenPrices(tokenAddresses, networkId);
35
+ const tokenPriceById = new Map();
36
+ tokensPrices.forEach((tP) => tP ? tokenPriceById.set(tP.address, tP) : []);
37
+ const liquiditiesByVersion = {};
38
+ for (let index = 0; index < balances.length; index++) {
39
+ const balance = balances[index];
40
+ if (balance > BigInt(0)) {
41
+ const vaultData = vaults[index];
42
+ const amount = new bignumber_js_1.default(balance.toString())
43
+ .dividedBy(new bignumber_js_1.default(10).pow(vaultData.decimals))
44
+ .toNumber();
45
+ const tokenPrice = tokenPriceById.get(vaultData.token.address);
46
+ if (!tokenPrice)
47
+ continue;
48
+ const asset = (0, tokenPriceToAssetToken_1.default)(vaultData.token.address, amount, networkId, tokenPrice);
49
+ const yields = [
50
+ {
51
+ apr: (0, portfolio_core_1.apyToApr)(Number(vaultData.apy.net_apy)),
52
+ apy: Number(vaultData.apy.net_apy),
53
+ },
54
+ ];
55
+ const liquidity = {
56
+ assets: [asset],
57
+ assetsValue: asset.value,
58
+ rewardAssets: [],
59
+ rewardAssetsValue: null,
60
+ value: asset.value,
61
+ yields,
62
+ };
63
+ if (liquiditiesByVersion[vaultData.type]) {
64
+ liquiditiesByVersion[vaultData.type].push(liquidity);
65
+ }
66
+ else {
67
+ liquiditiesByVersion[vaultData.type] = [liquidity];
68
+ }
69
+ }
70
+ }
71
+ const elements = [];
72
+ for (const [name, liquidities] of Object.entries(liquiditiesByVersion)) {
73
+ if (liquidities.length > 0)
74
+ elements.push({
75
+ type: portfolio_core_1.PortfolioElementType.liquidity,
76
+ label: 'Farming',
77
+ networkId,
78
+ platformId,
79
+ value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((l) => l.value)),
80
+ name: name.toUpperCase(),
81
+ data: {
82
+ liquidities,
83
+ },
84
+ });
85
+ }
86
+ return elements;
87
+ });
88
+ return {
89
+ networkId,
90
+ executor,
91
+ id: `${platformId}-${networkId}-vaults`,
92
+ };
93
+ }
94
+ exports.default = getVaultsBalancesFetcher;
95
+ //# sourceMappingURL=getVaultsBalancesFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVaultsBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getVaultsBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAErC,2CAAwC;AACxC,uCAAwC;AAGxC,qGAA6E;AAE7E,SAAwB,wBAAwB,CAC9C,SAA2B,EAC3B,UAAkB;IAElB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAc,qBAAS,EAAE;YACzD,MAAM,EAAE,UAAU;YAClB,SAAS;SACV,CAAC,CAAC;QACH,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAEvB,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAW,EAChC,SAAS,EACT,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC5B,KAAK,CACN,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAErC,MAAM,cAAc,GAAG,MAAM;aAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAC/C,IAAI,EAAE,CAAC;QACV,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QAC3E,MAAM,cAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;QAC1D,YAAY,CAAC,OAAO,CAAC,CAA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E,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM;iBACP,CAAC;gBACF,IAAI,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;oBACxC,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACtD;qBAAM;oBACL,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;iBACpD;aACF;SACF;QACD,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE;YACtE,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;oBACpC,KAAK,EAAE,SAAS;oBAChB,SAAS;oBACT,UAAU;oBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACtD,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE;oBACxB,IAAI,EAAE;wBACJ,WAAW;qBACZ;iBACF,CAAC,CAAC;SACN;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,SAAS;KACxC,CAAC;AACJ,CAAC;AAzFD,2CAyFC"}
@@ -0,0 +1,3 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { Job } from '../../Job';
3
+ export default function getVaultsJob(networkId: EvmNetworkIdType, platformId: string): Job;
@@ -0,0 +1,29 @@
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 constants_1 = require("./constants");
14
+ const helpers_1 = require("./helpers");
15
+ function getVaultsJob(networkId, platformId) {
16
+ const executor = (cache) => __awaiter(this, void 0, void 0, function* () {
17
+ const vaults = (yield (0, helpers_1.getVaults)({
18
+ chainId: portfolio_core_1.networks[networkId].chainId,
19
+ network: portfolio_core_1.networks[networkId],
20
+ })).filter((vault) => vault.endorsed);
21
+ yield cache.setItem(constants_1.vaultsKey, vaults, { prefix: platformId, networkId });
22
+ });
23
+ return {
24
+ executor,
25
+ id: `${platformId}-${networkId}-vaults`,
26
+ };
27
+ }
28
+ exports.default = getVaultsJob;
29
+ //# sourceMappingURL=getVaultsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getVaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAwE;AAGxE,2CAAwC;AACxC,uCAAsC;AAEtC,SAAwB,YAAY,CAClC,SAA2B,EAC3B,UAAkB;IAElB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;QACnD,MAAM,MAAM,GAAG,CACb,MAAM,IAAA,mBAAS,EAAC;YACd,OAAO,EAAE,yBAAQ,CAAC,SAAS,CAAC,CAAC,OAAO;YACpC,OAAO,EAAE,yBAAQ,CAAC,SAAS,CAAC;SAC7B,CAAC,CACH,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEpC,MAAM,KAAK,CAAC,OAAO,CAAC,qBAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,SAAS;KACxC,CAAC;AACJ,CAAC;AAnBD,+BAmBC"}
@@ -0,0 +1,4 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { Contract } from './types';
3
+ import { Fetcher } from '../../Fetcher';
4
+ export default function getYearnStakeBalancesFetcher(networkId: EvmNetworkIdType, platformId: string, contracts: Contract[]): Fetcher;
@@ -0,0 +1,85 @@
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 helpers_1 = require("./helpers");
18
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
19
+ const abis_1 = require("./abis");
20
+ const clients_1 = require("../../utils/clients");
21
+ function getYearnStakeBalancesFetcher(networkId, platformId, contracts) {
22
+ const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
23
+ const client = (0, clients_1.getEvmClient)(networkId);
24
+ const balances = yield (0, helpers_1.getBalances)(networkId, contracts.map((c) => c.address), owner);
25
+ const toAssetContracts = balances.map((balance, index) => ({
26
+ abi: [abis_1.yearnStakeAbi.convertToAssets],
27
+ address: contracts[index].address,
28
+ functionName: abis_1.yearnStakeAbi.convertToAssets.name,
29
+ args: [balance],
30
+ }));
31
+ const convertedBalancesRes = yield client.multicall({
32
+ contracts: toAssetContracts,
33
+ });
34
+ const tokenAddresses = contracts.map((v) => v.underlying);
35
+ const tokensPrices = yield cache.getTokenPrices(tokenAddresses, networkId);
36
+ const tokenPriceById = new Map();
37
+ tokensPrices.forEach((tP) => tP ? tokenPriceById.set(tP.address, tP) : []);
38
+ const liquidities = [];
39
+ for (let index = 0; index < convertedBalancesRes.length; index++) {
40
+ const balanceRes = convertedBalancesRes[index];
41
+ if (balanceRes.status === 'failure')
42
+ continue;
43
+ const balance = balanceRes.result;
44
+ if (balance > BigInt(0)) {
45
+ const { underlying } = contracts[index];
46
+ const tokenPrice = tokenPriceById.get(underlying);
47
+ if (!tokenPrice)
48
+ continue;
49
+ const amount = new bignumber_js_1.default(balance.toString())
50
+ .dividedBy(new bignumber_js_1.default(10).pow(tokenPrice.decimals))
51
+ .toNumber();
52
+ const asset = (0, tokenPriceToAssetToken_1.default)(underlying, amount, networkId, tokenPrice);
53
+ liquidities.push({
54
+ assets: [asset],
55
+ assetsValue: asset.value,
56
+ rewardAssets: [],
57
+ rewardAssetsValue: null,
58
+ value: asset.value,
59
+ yields: [],
60
+ });
61
+ }
62
+ }
63
+ if (liquidities.length === 0)
64
+ return [];
65
+ return [
66
+ {
67
+ type: portfolio_core_1.PortfolioElementType.liquidity,
68
+ label: 'Staked',
69
+ networkId,
70
+ platformId,
71
+ value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((l) => l.value)),
72
+ data: {
73
+ liquidities,
74
+ },
75
+ },
76
+ ];
77
+ });
78
+ return {
79
+ networkId,
80
+ executor,
81
+ id: `${platformId}-${networkId}-yearn-stake`,
82
+ };
83
+ }
84
+ exports.default = getYearnStakeBalancesFetcher;
85
+ //# sourceMappingURL=getYearnStakeBalancesFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getYearnStakeBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getYearnStakeBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,uCAAwC;AAGxC,qGAA6E;AAC7E,iCAAuC;AACvC,iDAAmD;AAEnD,SAAwB,4BAA4B,CAClD,SAA2B,EAC3B,UAAkB,EAClB,SAAqB;IAErB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,SAAS,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAW,EAChC,SAAS,EACT,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC/B,KAAK,CACN,CAAC;QAEF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CACnC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACjB,CAAC;YACC,GAAG,EAAE,CAAC,oBAAa,CAAC,eAAe,CAAC;YACpC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,OAAwB;YAClD,YAAY,EAAE,oBAAa,CAAC,eAAe,CAAC,IAAI;YAChD,IAAI,EAAE,CAAC,OAAO,CAAC;SACN,CAAA,CACd,CAAC;QAEF,MAAM,oBAAoB,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC;YAClD,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;QAEH,MAAM,cAAc,GAAG,SAA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,WAAW,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,CAAC,KAAK,CAAC;oBACf,WAAW,EAAE,KAAK,CAAC,KAAK;oBACxB,YAAY,EAAE,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;aACJ;SACF;QACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAExC,OAAO;YACL;gBACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,KAAK,EAAE,QAAQ;gBACf,SAAS;gBACT,UAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACtD,IAAI,EAAE;oBACJ,WAAW;iBACZ;aACF;SACF,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,cAAc;KAC7C,CAAC;AACJ,CAAC;AArFD,+CAqFC"}
@@ -0,0 +1,5 @@
1
+ import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
2
+ import { LockerInfo, VaultData, YearnConfig } from './types';
3
+ export declare function getVaults(config: YearnConfig): Promise<VaultData[]>;
4
+ export declare function getBalances(evmNetworkId: EvmNetworkIdType, contracts: string[], owner: string): Promise<bigint[]>;
5
+ export declare function getLockersBalances(evmNetworkId: EvmNetworkIdType, contracts: string[], owner: string): Promise<LockerInfo[]>;
@@ -0,0 +1,67 @@
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
+ exports.getLockersBalances = exports.getBalances = exports.getVaults = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const erc20Abi_1 = require("../../utils/evm/erc20Abi");
18
+ const clients_1 = require("../../utils/clients");
19
+ const abis_1 = require("./abis");
20
+ const constants_1 = require("./constants");
21
+ function getVaults(config) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ if (!config.network.id)
24
+ return [];
25
+ const allPoolsRes = yield axios_1.default
26
+ .get(`${constants_1.yearnApiUrl}/${config.network.chainId}/vaults/all`)
27
+ .catch(() => null);
28
+ const allPoolsData = allPoolsRes === null || allPoolsRes === void 0 ? void 0 : allPoolsRes.data;
29
+ if (!allPoolsData)
30
+ return [];
31
+ return allPoolsData;
32
+ });
33
+ }
34
+ exports.getVaults = getVaults;
35
+ function getBalances(evmNetworkId, contracts, owner) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const client = (0, clients_1.getEvmClient)(evmNetworkId);
38
+ const balanceOfBase = {
39
+ abi: erc20Abi_1.balanceOfErc20ABI,
40
+ args: [owner],
41
+ functionName: erc20Abi_1.balanceOfErc20ABI[0].name,
42
+ };
43
+ const balancesRes = yield client.multicall({
44
+ contracts: contracts.map((ctx) => (Object.assign(Object.assign({}, balanceOfBase), { address: ctx }))),
45
+ });
46
+ return balancesRes.map((balance) => balance.status === 'failure' ? BigInt(0) : balance.result);
47
+ });
48
+ }
49
+ exports.getBalances = getBalances;
50
+ function getLockersBalances(evmNetworkId, contracts, owner) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ const client = (0, clients_1.getEvmClient)(evmNetworkId);
53
+ const lockerBalanceBase = {
54
+ abi: [abis_1.lockersAbi.locks],
55
+ args: [owner],
56
+ functionName: abis_1.lockersAbi.locks.name,
57
+ };
58
+ const balancesRes = yield client.multicall({
59
+ contracts: contracts.map((ctx) => (Object.assign(Object.assign({}, lockerBalanceBase), { address: ctx }))),
60
+ });
61
+ return balancesRes.map((balance) => balance.status === 'failure'
62
+ ? { amount: BigInt(0), unlockTime: BigInt(0) }
63
+ : { amount: balance.result[0], unlockTime: balance.result[1] });
64
+ });
65
+ }
66
+ exports.getLockersBalances = getLockersBalances;
67
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA6C;AAE7C,uDAA6D;AAC7D,iDAAmD;AACnD,iCAAoC;AACpC,2CAA0C;AAE1C,SAAsB,SAAS,CAAC,MAAmB;;QACjD,IAAI,CAAE,MAAM,CAAC,OAAO,CAAC,EAAuB;YAAE,OAAO,EAAE,CAAC;QACxD,MAAM,WAAW,GAAsC,MAAM,eAAK;aAC/D,GAAG,CAAC,GAAG,uBAAW,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,aAAa,CAAC;aAC1D,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,YAAY,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAC;QAEvC,IAAI,CAAC,YAAY;YAAE,OAAO,EAAE,CAAC;QAE7B,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AAVD,8BAUC;AAED,SAAsB,WAAW,CAC/B,YAA8B,EAC9B,SAAmB,EACnB,KAAa;;QAEb,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,YAAY,CAAC,CAAC;QAC1C,MAAM,aAAa,GAAG;YACpB,GAAG,E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CAAC,CAAC,CAAC,EAAE;YAC9C,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACjE,CAAC;IACJ,CAAC;CAAA;AA3BD,gDA2BC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,22 @@
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.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
8
+ const constants_1 = require("./constants");
9
+ const getVaultsJob_1 = __importDefault(require("./getVaultsJob"));
10
+ const getVaultsBalancesFetcher_1 = __importDefault(require("./getVaultsBalancesFetcher"));
11
+ const getLockersBalancesFetcher_1 = __importDefault(require("./getLockersBalancesFetcher"));
12
+ const getStakesBalancesFetcher_1 = __importDefault(require("./getStakesBalancesFetcher"));
13
+ const getYearnStakeBalancesFetcher_1 = __importDefault(require("./getYearnStakeBalancesFetcher"));
14
+ exports.platforms = [constants_1.platform];
15
+ exports.jobs = [(0, getVaultsJob_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id)];
16
+ exports.fetchers = [
17
+ (0, getVaultsBalancesFetcher_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id),
18
+ (0, getLockersBalancesFetcher_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id, constants_1.lockersEth),
19
+ (0, getStakesBalancesFetcher_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id, constants_1.yETHStake),
20
+ (0, getYearnStakeBalancesFetcher_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id, constants_1.styETHStake),
21
+ ];
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAiE;AAGjE,2CAA2E;AAC3E,kEAA0C;AAC1C,0FAAkE;AAClE,4FAAoE;AACpE,0FAAkE;AAClE,kGAA0E;AAE7D,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,IAAA,sBAAY,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9D,QAAA,QAAQ,GAAc;IACjC,IAAA,kCAAwB,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,CAAC;IACzD,IAAA,mCAAyB,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,sBAAU,CAAC;IACtE,IAAA,kCAAwB,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,qBAAS,CAAC;IACpE,IAAA,sCAA4B,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,uBAAW,CAAC;CAC3E,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { Network } from '@sonarwatch/portfolio-core';
2
+ export type Contract = {
3
+ address: string;
4
+ underlying: string;
5
+ };
6
+ export type LockerInfo = {
7
+ amount: bigint;
8
+ unlockTime: bigint;
9
+ };
10
+ export type YearnConfig = {
11
+ network: Network;
12
+ chainId: number;
13
+ };
14
+ export type VaultData = {
15
+ address: string;
16
+ symbol: string;
17
+ display_name: string;
18
+ token: {
19
+ name: string;
20
+ symbol: string;
21
+ address: string;
22
+ decimals: string;
23
+ display_name: string;
24
+ icon: string;
25
+ };
26
+ tvl: {
27
+ total_assets: string;
28
+ price: string;
29
+ tvl: string;
30
+ };
31
+ apy: {
32
+ type: string;
33
+ gross_apr: string;
34
+ net_apy: string;
35
+ fees: {
36
+ performance: string;
37
+ withdrawal: string;
38
+ management: string;
39
+ keep_crv: string;
40
+ cvx_keep_crv: string;
41
+ keep_velo: string;
42
+ };
43
+ points: {
44
+ week_ago: string;
45
+ month_ago: string;
46
+ inception: string;
47
+ };
48
+ blocks: {
49
+ now: string;
50
+ week_ago: string;
51
+ month_ago: string;
52
+ inception: string;
53
+ };
54
+ composite: string;
55
+ error_reason: string;
56
+ staking_rewards_apr: string;
57
+ };
58
+ strategies: [
59
+ {
60
+ address: string;
61
+ name: string;
62
+ },
63
+ {
64
+ address: string;
65
+ name: string;
66
+ },
67
+ {
68
+ address: string;
69
+ name: string;
70
+ }
71
+ ];
72
+ endorsed: boolean;
73
+ decimals: string;
74
+ type: string;
75
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/types.ts"],"names":[],"mappings":""}