@sonarwatch/portfolio-plugins 0.11.176 → 0.11.178
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/bskt/index.js +1 -5
- package/src/plugins/bskt/index.js.map +1 -1
- package/src/plugins/flexlend/depositsFetcher.js +34 -10
- package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
- package/src/plugins/flexlend/helpers.d.ts +1 -0
- package/src/plugins/flexlend/helpers.js +6 -1
- package/src/plugins/flexlend/helpers.js.map +1 -1
- package/src/plugins/flexlend/index.js +2 -1
- package/src/plugins/flexlend/index.js.map +1 -1
- package/src/plugins/flexlend/liftFetcher.d.ts +3 -0
- package/src/plugins/flexlend/liftFetcher.js +67 -0
- package/src/plugins/flexlend/liftFetcher.js.map +1 -0
- package/src/plugins/flexlend/struct.d.ts +14 -2
- package/src/plugins/flexlend/struct.js +16 -3
- package/src/plugins/flexlend/struct.js.map +1 -1
- package/src/plugins/jito/airdropFetcher.d.ts +3 -0
- package/src/plugins/jito/airdropFetcher.js +67 -0
- package/src/plugins/jito/airdropFetcher.js.map +1 -0
- package/src/plugins/jito/constants.d.ts +8 -0
- package/src/plugins/jito/constants.js +18 -0
- package/src/plugins/jito/constants.js.map +1 -0
- package/src/plugins/jito/index.d.ts +6 -0
- package/src/plugins/jito/index.js +12 -0
- package/src/plugins/jito/index.js.map +1 -0
- package/src/plugins/jito/structs.d.ts +12 -0
- package/src/plugins/jito/structs.js +14 -0
- package/src/plugins/jito/structs.js.map +1 -0
- package/src/plugins/jito/types.d.ts +11 -0
- package/src/plugins/jito/types.js +3 -0
- package/src/plugins/jito/types.js.map +1 -0
- package/src/plugins/kamino/poolsJob.js +0 -2
- package/src/plugins/kamino/poolsJob.js.map +1 -1
- package/src/plugins/marginfi/depositsFetcher.js +3 -63
- package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
- package/src/plugins/marginfi/helpers.d.ts +4 -0
- package/src/plugins/marginfi/helpers.js +65 -1
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/native-stake/solana/solanaFetcher.js +23 -1
- package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.178](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.177...plugins-0.11.178) (2024-04-15)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.177](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.176...plugins-0.11.177) (2024-04-12)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.176](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.175...plugins-0.11.176) (2024-04-11)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.178",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.175"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -103,6 +103,7 @@ const uxd_1 = require("./plugins/uxd");
|
|
103
103
|
const wormhole_1 = require("./plugins/wormhole");
|
104
104
|
const banx_1 = require("./plugins/banx");
|
105
105
|
const nosana_1 = require("./plugins/nosana");
|
106
|
+
const jito_1 = require("./plugins/jito");
|
106
107
|
var constants_1 = require("./plugins/tokens/constants");
|
107
108
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
108
109
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -199,6 +200,7 @@ exports.platforms = [
|
|
199
200
|
...wormhole_1.platforms,
|
200
201
|
...banx_1.platforms,
|
201
202
|
...nosana_1.platforms,
|
203
|
+
...jito_1.platforms,
|
202
204
|
];
|
203
205
|
// JOBS //
|
204
206
|
exports.jobs = [
|
@@ -278,6 +280,7 @@ exports.jobs = [
|
|
278
280
|
...wormhole_1.jobs,
|
279
281
|
...banx_1.jobs,
|
280
282
|
...nosana_1.jobs,
|
283
|
+
...jito_1.jobs,
|
281
284
|
];
|
282
285
|
// FETCHERS //
|
283
286
|
exports.fetchers = [
|
@@ -359,6 +362,7 @@ exports.fetchers = [
|
|
359
362
|
...wormhole_1.fetchers,
|
360
363
|
...banx_1.fetchers,
|
361
364
|
...nosana_1.fetchers,
|
365
|
+
...jito_1.fetchers,
|
362
366
|
];
|
363
367
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
364
368
|
//# 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,+CAI2B;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,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAI2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAIyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,2CAIyB;AACzB,uDAI+B;AAC/B,6DAIkC;AAClC,2CAIyB;AACzB,yCAIwB;AACxB,mDAI6B;AAC7B,6CAI0B;AAC1B,iEAIoC;AACpC,6DAIkC;AAClC,yCAIwB;AACxB,uCAIuB;AACvB,+CAI2B;AAC3B,iDAI4B;AAC5B,mDAI6B;AAC7B,2CAIyB;AACzB,+CAI2B;AAC3B,uCAIuB;AACvB,iDAI4B;AAC5B,yCAIwB;AACxB,6CAI0B;
|
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,+CAI2B;AAC3B,2CA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efault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
4
|
const constants_1 = require("./constants");
|
8
|
-
const vestingFetcher_1 = __importDefault(require("./vestingFetcher"));
|
9
5
|
exports.platforms = [constants_1.platform];
|
10
6
|
exports.jobs = [];
|
11
|
-
exports.fetchers = [
|
7
|
+
exports.fetchers = [];
|
12
8
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bskt/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bskt/index.ts"],"names":[],"mappings":";;;AAGA,2CAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -19,7 +19,6 @@ const helpers_1 = require("./helpers");
|
|
19
19
|
const deposits_1 = __importDefault(require("../drift/deposits"));
|
20
20
|
const lendsFetcher_1 = __importDefault(require("../kamino/lendsFetcher"));
|
21
21
|
const collateralFetcher_1 = __importDefault(require("../mango/collateralFetcher"));
|
22
|
-
const index_1 = require("../marginfi/index");
|
23
22
|
const constants_2 = require("../tokens/constants");
|
24
23
|
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
25
24
|
const clients_1 = require("../../utils/clients");
|
@@ -28,26 +27,31 @@ const structs_1 = require("../solend/structs");
|
|
28
27
|
const constants_3 = require("../solend/constants");
|
29
28
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
30
29
|
const helpers_2 = require("../solend/helpers");
|
30
|
+
const MarginfiAccount_1 = require("../marginfi/structs/MarginfiAccount");
|
31
|
+
const constants_4 = require("../marginfi/constants");
|
32
|
+
const helpers_3 = require("../marginfi/helpers");
|
31
33
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
32
34
|
const client = (0, clients_1.getClientSolana)();
|
33
35
|
const pda = (0, helpers_1.getDerivedAccount)(owner);
|
34
36
|
const userAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.userAccountStruct, new web3_js_1.PublicKey(pda));
|
35
37
|
if (!userAccount)
|
36
38
|
return [];
|
39
|
+
const isSolendActivated = userAccount.solend_obligation.toString() !==
|
40
|
+
'11111111111111111111111111111111';
|
41
|
+
const isMarginFiActivated = userAccount.mfi_account.toString() !== '11111111111111111111111111111111';
|
37
42
|
const portfolioElements = [];
|
38
|
-
const [
|
39
|
-
|
43
|
+
const [marginfiAccount, driftElements, kaminoElements, mangoElements, solendObligation,] = yield Promise.all([
|
44
|
+
isMarginFiActivated
|
45
|
+
? (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, MarginfiAccount_1.marginfiAccountStruct, userAccount.mfi_account)
|
46
|
+
: undefined,
|
40
47
|
deposits_1.default.executor(pda, cache),
|
41
48
|
lendsFetcher_1.default.executor(pda, cache),
|
42
49
|
collateralFetcher_1.default.executor(pda, cache),
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
...marginElements,
|
47
|
-
...driftElements,
|
48
|
-
...kaminoElements,
|
49
|
-
...mangoElements,
|
50
|
+
isSolendActivated
|
51
|
+
? (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.obligationStruct, userAccount.solend_obligation)
|
52
|
+
: undefined,
|
50
53
|
]);
|
54
|
+
portfolioElements.push(...[...driftElements, ...kaminoElements, ...mangoElements]);
|
51
55
|
if (solendObligation) {
|
52
56
|
const mainMarketInfo = yield cache.getItem(constants_3.mainMarket, {
|
53
57
|
prefix: constants_3.marketsPrefix,
|
@@ -89,6 +93,26 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
89
93
|
}
|
90
94
|
}
|
91
95
|
}
|
96
|
+
if (marginfiAccount) {
|
97
|
+
const banksInfo = yield cache.getItem(constants_4.banksKey, {
|
98
|
+
prefix: constants_4.marginfiPlatform.id,
|
99
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
100
|
+
});
|
101
|
+
if (banksInfo) {
|
102
|
+
const banksInfoByAddress = new Map();
|
103
|
+
const tokensAddresses = new Set();
|
104
|
+
banksInfo.forEach((bankInfo) => {
|
105
|
+
if (!bankInfo)
|
106
|
+
return;
|
107
|
+
banksInfoByAddress.set(bankInfo.pubkey.toString(), bankInfo);
|
108
|
+
tokensAddresses.add(bankInfo.mint.toString());
|
109
|
+
});
|
110
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(tokensAddresses), portfolio_core_1.NetworkId.solana);
|
111
|
+
const element = (0, helpers_3.getElementFromAccount)(marginfiAccount, banksInfoByAddress, tokenPriceById);
|
112
|
+
if (element)
|
113
|
+
portfolioElements.push(element);
|
114
|
+
}
|
115
|
+
}
|
92
116
|
if (portfolioElements.length === 0)
|
93
117
|
return [];
|
94
118
|
const elements = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAAyC;AACzC,uCAA8C;AAC9C,iEAAqD;AACrD,0EAA8D;AAC9D,mFAA6D;AAC7D,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAAyC;AACzC,uCAA8C;AAC9C,iEAAqD;AACrD,0EAA8D;AAC9D,mFAA6D;AAC7D,mDA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ACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,10 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getDerivedAccount = void 0;
|
3
|
+
exports.isLiftEmpty = exports.getDerivedAccount = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const constants_1 = require("./constants");
|
6
6
|
function getDerivedAccount(owner) {
|
7
7
|
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('flexlend', 'utf8'), new web3_js_1.PublicKey(owner).toBuffer()], constants_1.flexProgramId)[0].toString();
|
8
8
|
}
|
9
9
|
exports.getDerivedAccount = getDerivedAccount;
|
10
|
+
function isLiftEmpty(authoritySeed) {
|
11
|
+
return (authoritySeed.toString() ===
|
12
|
+
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].toString());
|
13
|
+
}
|
14
|
+
exports.isLiftEmpty = isLiftEmpty;
|
10
15
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4C;AAE5C,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EAClE,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC;AALD,8CAKC"}
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4C;AAE5C,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EAClE,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC;AALD,8CAKC;AAED,SAAgB,WAAW,CAAC,aAAuB;IACjD,OAAO,CACL,aAAa,CAAC,QAAQ,EAAE;QACxB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CACrE,CAAC;AACJ,CAAC;AALD,kCAKC"}
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
8
|
+
const liftFetcher_1 = __importDefault(require("./liftFetcher"));
|
8
9
|
const constants_1 = require("./constants");
|
9
10
|
exports.platforms = [constants_1.flexlendPlatform];
|
10
11
|
exports.jobs = [];
|
11
|
-
exports.fetchers = [depositsFetcher_1.default];
|
12
|
+
exports.fetchers = [depositsFetcher_1.default, liftFetcher_1.default];
|
12
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/index.ts"],"names":[],"mappings":";;;;;;AAGA,wEAAgD;AAChD,2CAA+C;AAElC,QAAA,SAAS,GAAe,CAAC,4BAAgB,CAAC,CAAC;AAC3C,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/index.ts"],"names":[],"mappings":";;;;;;AAGA,wEAAgD;AAChD,gEAAwC;AACxC,2CAA+C;AAElC,QAAA,SAAS,GAAe,CAAC,4BAAgB,CAAC,CAAC;AAC3C,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,yBAAe,EAAE,qBAAW,CAAC,CAAC"}
|
@@ -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
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const helpers_1 = require("./helpers");
|
19
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
20
|
+
const clients_1 = require("../../utils/clients");
|
21
|
+
const struct_1 = require("./struct");
|
22
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
|
+
const solana_1 = require("../../utils/solana");
|
24
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
+
const client = (0, clients_1.getClientSolana)();
|
26
|
+
const flexUserPda = (0, helpers_1.getDerivedAccount)(owner);
|
27
|
+
const flexUser = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.userAccountStruct, new web3_js_1.PublicKey(flexUserPda));
|
28
|
+
if (!flexUser)
|
29
|
+
return [];
|
30
|
+
const validAuthoritySeed = flexUser.promotionSeeds.find((s) => !(0, helpers_1.isLiftEmpty)(s.authoritySeed));
|
31
|
+
if (!validAuthoritySeed)
|
32
|
+
return [];
|
33
|
+
const seedValue = Buffer.from(validAuthoritySeed.authoritySeed).toString('utf8');
|
34
|
+
const authorityAddress = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('promotion_authority'), Buffer.from(seedValue.toString())], constants_1.flexProgramId)[0];
|
35
|
+
const promotionAuthority = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.promotionAuthorityStruct, authorityAddress);
|
36
|
+
if (!promotionAuthority)
|
37
|
+
return [];
|
38
|
+
if (promotionAuthority.totalDeposits.isZero())
|
39
|
+
return [];
|
40
|
+
const tokenPrices = yield cache.getTokenPricesAsMap([solana_1.usdcSolanaMint], portfolio_core_1.NetworkId.solana);
|
41
|
+
const tokenPrice = tokenPrices.get(promotionAuthority.mintAddress.toString());
|
42
|
+
if (!tokenPrice)
|
43
|
+
return [];
|
44
|
+
const amount = promotionAuthority.totalDeposits
|
45
|
+
.div(Math.pow(10, tokenPrice.decimals))
|
46
|
+
.toNumber();
|
47
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, portfolio_core_1.NetworkId.solana, tokenPrice);
|
48
|
+
const element = {
|
49
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
50
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
51
|
+
label: 'Deposit',
|
52
|
+
platformId: constants_1.platformId,
|
53
|
+
value: asset.value,
|
54
|
+
data: {
|
55
|
+
assets: [asset],
|
56
|
+
},
|
57
|
+
name: 'Points Lift',
|
58
|
+
};
|
59
|
+
return [element];
|
60
|
+
});
|
61
|
+
const fetcher = {
|
62
|
+
id: `${constants_1.platformId}-lift`,
|
63
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
64
|
+
executor,
|
65
|
+
};
|
66
|
+
exports.default = fetcher;
|
67
|
+
//# sourceMappingURL=liftFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"liftFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/liftFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,2CAAwD;AACxD,uCAA2D;AAC3D,kFAA+E;AAC/E,iDAAsD;AACtD,qCAAuE;AACvE,qGAA6E;AAC7E,+CAAoD;AAEpD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,IAAA,2CAAoB,EACzC,MAAM,EACN,0BAAiB,EACjB,IAAI,mBAAS,CAAC,WAAW,CAAC,CAC3B,CAAC;IACF,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,kBAAkB,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CACrD,CAAC,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SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,IAAI,EAAE,qCAAoB,CAAC,QAAQ;QACnC,KAAK,EAAE,SAAS;QAChB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,KAAK,CAAC;SAChB;QACD,IAAI,EAAE,aAAa;KACpB,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -3,7 +3,8 @@ import { BeetStruct } from '@metaplex-foundation/beet';
|
|
3
3
|
import { PublicKey } from '@metaplex-foundation/js';
|
4
4
|
import BigNumber from 'bignumber.js';
|
5
5
|
export type PromotionSeed = {
|
6
|
-
|
6
|
+
authoritySeed: number[];
|
7
|
+
padding: number[];
|
7
8
|
};
|
8
9
|
export type UserAccount = {
|
9
10
|
buffer: Buffer;
|
@@ -12,7 +13,18 @@ export type UserAccount = {
|
|
12
13
|
owner: PublicKey;
|
13
14
|
mfi_account: PublicKey;
|
14
15
|
solend_obligation: PublicKey;
|
15
|
-
|
16
|
+
promotionSeeds: PromotionSeed[];
|
16
17
|
_padding2: BigNumber[];
|
17
18
|
};
|
18
19
|
export declare const userAccountStruct: BeetStruct<UserAccount, Partial<UserAccount>>;
|
20
|
+
export type PromotionAuthority = {
|
21
|
+
buffer: Buffer;
|
22
|
+
bump: number;
|
23
|
+
authoritySeed: number[];
|
24
|
+
padding1: PublicKey;
|
25
|
+
mintAddress: PublicKey;
|
26
|
+
userAccount: PublicKey;
|
27
|
+
totalDeposits: BigNumber;
|
28
|
+
padding2: BigNumber[];
|
29
|
+
};
|
30
|
+
export declare const promotionAuthorityStruct: BeetStruct<PromotionAuthority, Partial<PromotionAuthority>>;
|
@@ -1,10 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.userAccountStruct = void 0;
|
3
|
+
exports.promotionAuthorityStruct = exports.userAccountStruct = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../utils/solana");
|
7
|
-
const promotionSeedStruct = new beet_1.BeetStruct([
|
7
|
+
const promotionSeedStruct = new beet_1.BeetStruct([
|
8
|
+
['authoritySeed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 19)],
|
9
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 13)],
|
10
|
+
], (args) => args);
|
8
11
|
exports.userAccountStruct = new beet_1.BeetStruct([
|
9
12
|
['buffer', (0, solana_1.blob)(8)],
|
10
13
|
['bump', beet_1.u8],
|
@@ -12,7 +15,17 @@ exports.userAccountStruct = new beet_1.BeetStruct([
|
|
12
15
|
['owner', beet_solana_1.publicKey],
|
13
16
|
['mfi_account', beet_solana_1.publicKey],
|
14
17
|
['solend_obligation', beet_solana_1.publicKey],
|
15
|
-
['
|
18
|
+
['promotionSeeds', (0, beet_1.uniformFixedSizeArray)(promotionSeedStruct, 4)],
|
16
19
|
['_padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 12)],
|
17
20
|
], (args) => args);
|
21
|
+
exports.promotionAuthorityStruct = new beet_1.BeetStruct([
|
22
|
+
['buffer', (0, solana_1.blob)(8)],
|
23
|
+
['bump', beet_1.u8],
|
24
|
+
['authoritySeed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 19)],
|
25
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 12)],
|
26
|
+
['mintAddress', beet_solana_1.publicKey],
|
27
|
+
['userAccount', beet_solana_1.publicKey],
|
28
|
+
['totalDeposits', solana_1.u64],
|
29
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 8)],
|
30
|
+
], (args) => args);
|
18
31
|
//# sourceMappingURL=struct.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/struct.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/struct.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAO/C,MAAM,mBAAmB,GAAG,IAAI,iBAAU,CACxC;IACE,CAAC,eAAe,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAaW,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,gBAAgB,EAAE,IAAA,4BAAqB,EAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC,WAAW,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC9C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC;AAaW,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,eAAe,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC"}
|
@@ -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
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const axios_1 = __importDefault(require("axios"));
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
|
+
const jtoFactor = new bignumber_js_1.default(Math.pow(10, constants_1.jtoDecimals));
|
21
|
+
const endOfVesting = 1733529600000; // December 07 2024
|
22
|
+
const endOfClaim = 1749254400000; // June 07 2025
|
23
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
+
if (Date.now() > endOfClaim)
|
25
|
+
return [];
|
26
|
+
const [res, tokenPrice] = yield Promise.all([
|
27
|
+
axios_1.default.get(constants_1.airdropUrl + owner, { timeout: 1000 }).catch(() => null),
|
28
|
+
cache.getTokenPrice(constants_1.jtoMint, portfolio_core_1.NetworkId.solana),
|
29
|
+
]);
|
30
|
+
if (!res)
|
31
|
+
return [];
|
32
|
+
const claimStatus = res.data;
|
33
|
+
const avaibleToClaim = new bignumber_js_1.default(claimStatus.amount_locked_withdrawable).dividedBy(jtoFactor);
|
34
|
+
const vestedAmountLeft = new bignumber_js_1.default(claimStatus.total_locked_searcher)
|
35
|
+
.plus(claimStatus.total_locked_staker)
|
36
|
+
.plus(claimStatus.total_locked_validator)
|
37
|
+
.minus(claimStatus.amount_locked_withdrawn)
|
38
|
+
.dividedBy(jtoFactor)
|
39
|
+
.minus(avaibleToClaim);
|
40
|
+
const assets = [];
|
41
|
+
if (!vestedAmountLeft.isZero())
|
42
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.jtoMint, vestedAmountLeft.toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { lockedUntil: endOfVesting }));
|
43
|
+
if (!avaibleToClaim.isZero())
|
44
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.jtoMint, avaibleToClaim.toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { isClaimable: true }));
|
45
|
+
if (assets.length === 0)
|
46
|
+
return [];
|
47
|
+
return [
|
48
|
+
{
|
49
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
50
|
+
label: 'Rewards',
|
51
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
52
|
+
platformId: constants_1.platformId,
|
53
|
+
name: 'Airdrop',
|
54
|
+
data: {
|
55
|
+
assets,
|
56
|
+
},
|
57
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
58
|
+
},
|
59
|
+
];
|
60
|
+
});
|
61
|
+
const fetcher = {
|
62
|
+
id: `${constants_1.platformId}-airdrop`,
|
63
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
64
|
+
executor,
|
65
|
+
};
|
66
|
+
exports.default = fetcher;
|
67
|
+
//# sourceMappingURL=airdropFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,kDAA0B;AAG1B,2CAA2E;AAC3E,qGAA6E;AAG7E,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;AACnD,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,mBAAmB;AACvD,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,eAAe;AACjD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,eAAK,CAAC,GAAG,CAAC,sBAAU,GAAG,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QAClE,KAAK,CAAC,aAAa,CAAC,mBAAO,EAAE,0BAAS,CAAC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V,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "jito";
|
3
|
+
export declare const jitoPlatform: Platform;
|
4
|
+
export declare const merkleTree = "HS8EQ8QkQSBJggY8r255AKdWbtYRtyNMoRt4LjNkkWm1";
|
5
|
+
export declare const merkleDistributor = "mERKcfxMC5SqJn4Ld4BUris3WKZZ1ojjWJ3A3J5CKxv";
|
6
|
+
export declare const jtoMint = "jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL";
|
7
|
+
export declare const jtoDecimals = 9;
|
8
|
+
export declare const airdropUrl = "https://airdrop.jito.network/status/";
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.airdropUrl = exports.jtoDecimals = exports.jtoMint = exports.merkleDistributor = exports.merkleTree = exports.jitoPlatform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'jito';
|
5
|
+
exports.jitoPlatform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'Jito',
|
8
|
+
image: 'https://sonar.watch/img/platforms/jito.png',
|
9
|
+
defiLlamaId: 'jito',
|
10
|
+
website: 'https://jito.network/',
|
11
|
+
twitter: 'https://twitter.com/jito_sol',
|
12
|
+
};
|
13
|
+
exports.merkleTree = 'HS8EQ8QkQSBJggY8r255AKdWbtYRtyNMoRt4LjNkkWm1';
|
14
|
+
exports.merkleDistributor = 'mERKcfxMC5SqJn4Ld4BUris3WKZZ1ojjWJ3A3J5CKxv';
|
15
|
+
exports.jtoMint = 'jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL';
|
16
|
+
exports.jtoDecimals = 9;
|
17
|
+
exports.airdropUrl = 'https://airdrop.jito.network/status/';
|
18
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAC5D,QAAA,iBAAiB,GAAG,6CAA6C,CAAC;AAClE,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,UAAU,GAAG,sCAAsC,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
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 constants_1 = require("./constants");
|
8
|
+
const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
|
9
|
+
exports.platforms = [constants_1.jitoPlatform];
|
10
|
+
exports.jobs = [];
|
11
|
+
exports.fetchers = [airdropFetcher_1.default];
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA2C;AAC3C,sEAA6C;AAEhC,QAAA,SAAS,GAAe,CAAC,wBAAY,CAAC,CAAC;AACvC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAa,CAAC,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@metaplex-foundation/js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type ClaimStatus = {
|
6
|
+
buffer: Buffer;
|
7
|
+
claimant: PublicKey;
|
8
|
+
lockedAmount: BigNumber;
|
9
|
+
lockedAmountWithdrawn: BigNumber;
|
10
|
+
unlockedAmount: BigNumber;
|
11
|
+
};
|
12
|
+
export declare const claimStatusStruct: BeetStruct<ClaimStatus, Partial<ClaimStatus>>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.claimStatusStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
exports.claimStatusStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['claimant', beet_solana_1.publicKey],
|
10
|
+
['lockedAmount', solana_1.u64],
|
11
|
+
['lockedAmountWithdrawn', solana_1.u64],
|
12
|
+
['unlockedAmount', solana_1.u64],
|
13
|
+
], (args) => args);
|
14
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAGvD,kEAA6D;AAC7D,+CAA+C;AAUlC,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,uBAAuB,EAAE,YAAG,CAAC;IAC9B,CAAC,gBAAgB,EAAE,YAAG,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export type ClaimStatus = {
|
2
|
+
status: string;
|
3
|
+
total_unlocked_staker: number;
|
4
|
+
total_locked_staker: number;
|
5
|
+
total_unlocked_searcher: number;
|
6
|
+
total_locked_searcher: number;
|
7
|
+
total_unlocked_validator: number;
|
8
|
+
total_locked_validator: number;
|
9
|
+
amount_locked_withdrawable: number;
|
10
|
+
amount_locked_withdrawn: number;
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jito/types.ts"],"names":[],"mappings":""}
|
@@ -74,8 +74,6 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
74
|
.flat()
|
75
75
|
: undefined;
|
76
76
|
const { tokenAmountA, tokenAmountB } = (0, vaults_1.getTokenAmountsFromInfos)(strategy, pool, position, binArrays);
|
77
|
-
if (tokenAmountA.isZero() && tokenAmountB.isZero())
|
78
|
-
continue;
|
79
77
|
const tokenAAmount = tokenAmountA
|
80
78
|
.plus(strategy.tokenAAmounts)
|
81
79
|
.div(Math.pow(10, strategy.tokenAMintDecimals.toNumber()));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins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CAAC;QAClE,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;YAAE,SAAS;QAEhC,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QAE/C,MAAM,WAAW,GAAG,IAAA,0DAAyC,EAC3D,CAAC,WAAW,EAAE,WAAW,CAAC,EAC1B;YACE,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;YACzC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;SAC1C,CACF,CAAC;QAEF,MAAM,KAAK,CAAC,mBAAmB,CAAC;YAC9B,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;YAC3B,QAAQ;YACR,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK;YACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,OAAO;YACpB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
13
|
const constants_1 = require("./constants");
|
@@ -19,7 +16,6 @@ const helpers_1 = require("./helpers");
|
|
19
16
|
const filters_1 = require("./filters");
|
20
17
|
const solana_1 = require("../../utils/solana");
|
21
18
|
const clients_1 = require("../../utils/clients");
|
22
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
19
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
20
|
const client = (0, clients_1.getClientSolana)();
|
25
21
|
const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, MarginfiAccount_1.marginfiAccountStruct, constants_1.MarginfiProgram, (0, filters_1.accountsFilter)(owner));
|
@@ -42,65 +38,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
38
|
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(tokensAddresses), portfolio_core_1.NetworkId.solana);
|
43
39
|
const elements = [];
|
44
40
|
for (const account of accounts) {
|
45
|
-
const
|
46
|
-
if (
|
47
|
-
|
48
|
-
const borrowedAssets = [];
|
49
|
-
const borrowedYields = [];
|
50
|
-
const suppliedAssets = [];
|
51
|
-
const suppliedYields = [];
|
52
|
-
const rewardAssets = [];
|
53
|
-
const suppliedLtvs = [];
|
54
|
-
const borrowedWeights = [];
|
55
|
-
for (let index = 0; index < balances.length; index += 1) {
|
56
|
-
const balance = balances[index];
|
57
|
-
if (balance.bankPk.toString() === '11111111111111111111111111111111')
|
58
|
-
continue;
|
59
|
-
const bankInfo = banksInfoByAddress.get(balance.bankPk.toString());
|
60
|
-
if (!bankInfo)
|
61
|
-
continue;
|
62
|
-
const tokenPrice = tokenPriceById.get(bankInfo.mint.toString());
|
63
|
-
if (!balance.assetShares.value.isZero()) {
|
64
|
-
suppliedLtvs.push(bankInfo.suppliedLtv);
|
65
|
-
const suppliedAmount = (0, helpers_1.wrappedI80F48toBigNumber)(balance.assetShares)
|
66
|
-
.times(bankInfo.dividedAssetShareValue)
|
67
|
-
.toNumber();
|
68
|
-
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(bankInfo.mint.toString(), suppliedAmount, portfolio_core_1.NetworkId.solana, tokenPrice));
|
69
|
-
suppliedYields.push(bankInfo.suppliedYields);
|
70
|
-
}
|
71
|
-
if (!balance.liabilityShares.value.isZero()) {
|
72
|
-
borrowedWeights.push(bankInfo.borrowedWeight);
|
73
|
-
const borrowedAmount = (0, helpers_1.wrappedI80F48toBigNumber)(balance.liabilityShares)
|
74
|
-
.times(bankInfo.dividedLiabilityShareValue)
|
75
|
-
.toNumber();
|
76
|
-
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(bankInfo.mint.toString(), borrowedAmount, portfolio_core_1.NetworkId.solana, tokenPrice));
|
77
|
-
borrowedYields.push(bankInfo.borrowedYields);
|
78
|
-
}
|
79
|
-
}
|
80
|
-
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
81
|
-
continue;
|
82
|
-
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
|
83
|
-
const element = {
|
84
|
-
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
85
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
86
|
-
platformId: constants_1.platformId,
|
87
|
-
label: 'Lending',
|
88
|
-
value,
|
89
|
-
data: {
|
90
|
-
borrowedAssets,
|
91
|
-
borrowedValue,
|
92
|
-
borrowedYields,
|
93
|
-
suppliedAssets,
|
94
|
-
suppliedValue,
|
95
|
-
suppliedYields,
|
96
|
-
collateralRatio: null,
|
97
|
-
healthRatio,
|
98
|
-
rewardAssets,
|
99
|
-
rewardValue,
|
100
|
-
value,
|
101
|
-
},
|
102
|
-
};
|
103
|
-
elements.push(element);
|
41
|
+
const element = (0, helpers_1.getElementFromAccount)(account, banksInfoByAddress, tokenPriceById);
|
42
|
+
if (element)
|
43
|
+
elements.push(element);
|
104
44
|
}
|
105
45
|
return elements;
|
106
46
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/depositsFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,2CAAoE;AACpE,+DAAkE;AAClE,uCAAkD;AAClD,uCAA2C;AAE3C,+CAA6E;AAC7E,iDAAsD;AAItD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,uCAAqB,EACrB,2BAAe,EACf,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAA4B,oBAAQ,EAAE;QACzE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,MAAM,eAAe,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC/C,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAoB,CAAC,CAAC;QACzE,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAC3B,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAA,+BAAqB,EACnC,OAAO,EACP,kBAAkB,EAClB,cAAc,CACf,CAAC;QACF,IAAI,OAAO;YAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
2
|
+
import { PortfolioElement, TokenPrice } from '@sonarwatch/portfolio-core';
|
2
3
|
import { Bank } from './structs/Bank';
|
4
|
+
import { MarginfiAccount } from './structs/MarginfiAccount';
|
5
|
+
import { BankInfo } from './types';
|
3
6
|
export declare function wrappedI80F48toBigNumber({ value }: {
|
4
7
|
value: BigNumber;
|
5
8
|
}, scaleDecimal?: number): BigNumber;
|
@@ -7,3 +10,4 @@ export declare function computeInterestRates(bank: Bank): {
|
|
7
10
|
lendingApr: number;
|
8
11
|
borrowingApr: number;
|
9
12
|
};
|
13
|
+
export declare function getElementFromAccount(marginfiAccount: MarginfiAccount, banksInfoByAddress: Map<string, BankInfo>, tokenPriceById: Map<string, TokenPrice>): PortfolioElement | null;
|
@@ -3,9 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.computeInterestRates = exports.wrappedI80F48toBigNumber = void 0;
|
6
|
+
exports.getElementFromAccount = exports.computeInterestRates = exports.wrappedI80F48toBigNumber = void 0;
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
8
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
9
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
10
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
11
|
+
const constants_1 = require("./constants");
|
9
12
|
function wrappedI80F48toBigNumber({ value }, scaleDecimal = 0) {
|
10
13
|
if (!value)
|
11
14
|
return new bignumber_js_1.default(0);
|
@@ -58,4 +61,65 @@ function computeInterestRates(bank) {
|
|
58
61
|
return { lendingApr, borrowingApr };
|
59
62
|
}
|
60
63
|
exports.computeInterestRates = computeInterestRates;
|
64
|
+
function getElementFromAccount(marginfiAccount, banksInfoByAddress, tokenPriceById) {
|
65
|
+
const { balances } = marginfiAccount.lendingAccount;
|
66
|
+
if (!balances || balances.length === 0)
|
67
|
+
return null;
|
68
|
+
const borrowedAssets = [];
|
69
|
+
const borrowedYields = [];
|
70
|
+
const suppliedAssets = [];
|
71
|
+
const suppliedYields = [];
|
72
|
+
const rewardAssets = [];
|
73
|
+
const suppliedLtvs = [];
|
74
|
+
const borrowedWeights = [];
|
75
|
+
for (let index = 0; index < balances.length; index += 1) {
|
76
|
+
const balance = balances[index];
|
77
|
+
if (balance.bankPk.toString() === '11111111111111111111111111111111')
|
78
|
+
continue;
|
79
|
+
const bankInfo = banksInfoByAddress.get(balance.bankPk.toString());
|
80
|
+
if (!bankInfo)
|
81
|
+
continue;
|
82
|
+
const tokenPrice = tokenPriceById.get(bankInfo.mint.toString());
|
83
|
+
if (!balance.assetShares.value.isZero()) {
|
84
|
+
suppliedLtvs.push(bankInfo.suppliedLtv);
|
85
|
+
const suppliedAmount = wrappedI80F48toBigNumber(balance.assetShares)
|
86
|
+
.times(bankInfo.dividedAssetShareValue)
|
87
|
+
.toNumber();
|
88
|
+
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(bankInfo.mint.toString(), suppliedAmount, portfolio_core_1.NetworkId.solana, tokenPrice));
|
89
|
+
suppliedYields.push(bankInfo.suppliedYields);
|
90
|
+
}
|
91
|
+
if (!balance.liabilityShares.value.isZero()) {
|
92
|
+
borrowedWeights.push(bankInfo.borrowedWeight);
|
93
|
+
const borrowedAmount = wrappedI80F48toBigNumber(balance.liabilityShares)
|
94
|
+
.times(bankInfo.dividedLiabilityShareValue)
|
95
|
+
.toNumber();
|
96
|
+
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(bankInfo.mint.toString(), borrowedAmount, portfolio_core_1.NetworkId.solana, tokenPrice));
|
97
|
+
borrowedYields.push(bankInfo.borrowedYields);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
101
|
+
return null;
|
102
|
+
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
|
103
|
+
return {
|
104
|
+
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
105
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
106
|
+
platformId: constants_1.platformId,
|
107
|
+
label: 'Lending',
|
108
|
+
value,
|
109
|
+
data: {
|
110
|
+
borrowedAssets,
|
111
|
+
borrowedValue,
|
112
|
+
borrowedYields,
|
113
|
+
suppliedAssets,
|
114
|
+
suppliedValue,
|
115
|
+
suppliedYields,
|
116
|
+
collateralRatio: null,
|
117
|
+
healthRatio,
|
118
|
+
rewardAssets,
|
119
|
+
rewardValue,
|
120
|
+
value,
|
121
|
+
},
|
122
|
+
};
|
123
|
+
}
|
124
|
+
exports.getElementFromAccount = getElementFromAccount;
|
61
125
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,4DAAiC;
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,4DAAiC;AACjC,+DAQoC;AAIpC,qGAA6E;AAC7E,2CAAyC;AAEzC,SAAgB,wBAAwB,CACtC,EAAE,KAAK,EAAwB,EAC/B,YAAY,GAAG,CAAC;IAEhB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,oBAAO,CACzB,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CACnE,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,YAAY,CAAA,CAAC,CAAC;IAChC,OAAO,IAAI,sBAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC3C,CAAC;AAVD,4DAUC;AAED,SAAS,yBAAyB,CAAC,IAAU;IAC3C,OAAO,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAC9D,wBAAwB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CACnD,CAAC;AACJ,CAAC;AACD,SAAS,qBAAqB,CAAC,IAAU;IACvC,OAAO,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAC1D,wBAAwB,CAAC,IAAI,CAAC,eAAe,CAAC,CAC/C,CAAC;AAC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C;iBAC1C,QAAQ,EAAE,CAAC;YAEd,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EACxB,cAAc,EACd,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;YACF,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5E,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,CAChB,CAAC;IAEJ,OAAO;QACL,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe,EAAE,IAAI;YACrB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;AACJ,CAAC;AA1FD,sDA0FC"}
|
@@ -22,6 +22,7 @@ const structs_1 = require("./structs");
|
|
22
22
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
|
23
23
|
const constants_2 = require("../../marinade/constants");
|
24
24
|
const constants_3 = require("./constants");
|
25
|
+
const constants_4 = require("../../jito/constants");
|
25
26
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
27
|
const client = (0, clients_1.getClientSolana)();
|
27
28
|
const filters = (0, filters_1.stakeAccountsFilter)(owner.toString());
|
@@ -37,10 +38,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
37
38
|
let marinadeSolAmount = 0;
|
38
39
|
let solAmount = 0;
|
39
40
|
let nMarinadeAccounts = 0;
|
41
|
+
let mevRewards = 0;
|
40
42
|
let nativeAssets = [];
|
41
43
|
for (let i = 0; i < stakeAccounts.length; i += 1) {
|
42
44
|
const stakeAccount = stakeAccounts[i];
|
43
|
-
|
45
|
+
mevRewards += new bignumber_js_1.default(stakeAccount.lamports)
|
46
|
+
.minus(stakeAccount.rentExemptReserve)
|
47
|
+
.minus(stakeAccount.stake)
|
48
|
+
.dividedBy(Math.pow(10, 9))
|
49
|
+
.toNumber();
|
50
|
+
const amount = new bignumber_js_1.default(stakeAccount.stake)
|
44
51
|
.minus(stakeAccount.rentExemptReserve)
|
45
52
|
.dividedBy(new bignumber_js_1.default(Math.pow(10, 9)))
|
46
53
|
.toNumber();
|
@@ -111,6 +118,21 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
111
118
|
},
|
112
119
|
});
|
113
120
|
}
|
121
|
+
if (mevRewards > 0) {
|
122
|
+
elements.push({
|
123
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
124
|
+
platformId: constants_4.jitoPlatform.id,
|
125
|
+
type: 'multiple',
|
126
|
+
label: 'Rewards',
|
127
|
+
name: `MEV Rewards`,
|
128
|
+
value: solTokenPrice ? mevRewards * solTokenPrice.price : null,
|
129
|
+
data: {
|
130
|
+
assets: [
|
131
|
+
Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNetwork.native.address, mevRewards, portfolio_core_1.NetworkId.solana, solTokenPrice)), { attributes: { isClaimable: true } }),
|
132
|
+
],
|
133
|
+
},
|
134
|
+
});
|
135
|
+
}
|
114
136
|
return elements;
|
115
137
|
});
|
116
138
|
const fetcher = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solanaFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/native-stake/solana/solanaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAIrC,4CAA+D;AAC/D,oDAAyD;AACzD,kDAAiE;AACjE,uCAAgD;AAChD,uCAA+C;AAC/C,wGAAgF;AAChF,wDAA4D;AAC5D,2CAIqB;
|
1
|
+
{"version":3,"file":"solanaFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/native-stake/solana/solanaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAIrC,4CAA+D;AAC/D,oDAAyD;AACzD,kDAAiE;AACjE,uCAAgD;AAChD,uCAA+C;AAC/C,wGAAgF;AAChF,wDAA4D;AAC5D,2CAIqB;AACrB,oDAAoD;AAEpD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,IAAA,6BAAmB,EAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEtD,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,4BAAkB,EAClB,0BAAc,EACd,OAAO,CACR,CAAC;IACF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAC7C,8BAAa,CAAC,MAAM,CAAC,OAAO,EAC5B,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAAY,6BAAiB,EAAE;QAClE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC;IAE/B,IAAI,i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