@sonarwatch/portfolio-plugins 0.11.116 → 0.11.118
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1199 -1191
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/raydium/lpTokensJob.js +1 -1
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/spl-staking/constants.js +4 -4
- package/src/plugins/spl-staking/constants.js.map +1 -1
- package/src/plugins/suilend/constants.d.ts +1 -0
- package/src/plugins/suilend/constants.js +2 -1
- package/src/plugins/suilend/constants.js.map +1 -1
- package/src/plugins/suilend/helpers.d.ts +2 -0
- package/src/plugins/suilend/helpers.js +19 -0
- package/src/plugins/suilend/helpers.js.map +1 -0
- package/src/plugins/suilend/marketsJob.js +23 -17
- package/src/plugins/suilend/marketsJob.js.map +1 -1
- package/src/plugins/suilend/obligationsFetcher.js +108 -44
- package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
- package/src/plugins/suilend/types.d.ts +4 -3
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/symmetry/filters.js +0 -6
- package/src/plugins/symmetry/filters.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.118",
|
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.118"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -157,7 +157,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
157
|
continue;
|
158
158
|
const lpDecimals = lpMintAccount.decimals;
|
159
159
|
const lpSupply = lpMint.toString() === 'CQurpF3WS3yEqFEt1Bu8s5zmZqznQG3EJkcYvsyg3sLc'
|
160
|
-
? new bignumber_js_1.default('3381427.37') // Temporary fix for SOL-WIF lp
|
160
|
+
? new bignumber_js_1.default('3381427.37').times(Math.pow(10, lpDecimals)) // Temporary fix for SOL-WIF lp
|
161
161
|
: lpMintAccount.supply;
|
162
162
|
if (lpSupply.isZero())
|
163
163
|
continue;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AAEvD,gEAAqC;AAGrC,iDAAsD;AACtD,2CAA+E;AAC/E,yCAAkE;AAClE,+CAK4B;AAC5B,uCAAqD;AACrD,mCAA8C;AAC9C,6EAAqD;AACrD,gGAA6F;AAE7F,6GAAqF;AACrF,+FAAuE;AACvE,gEAA0E;AAC1E,6FAAoE;AAEpE,MAAM,WAAW,GAAG;IAClB;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AAEF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAE7B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,WAAW,CAAC,EAAE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,CAAC,+BAA+B;
|
1
|
+
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AAEvD,gEAAqC;AAGrC,iDAAsD;AACtD,2CAA+E;AAC/E,yCAAkE;AAClE,+CAK4B;AAC5B,uCAAqD;AACrD,mCAA8C;AAC9C,6EAAqD;AACrD,gGAA6F;AAE7F,6GAAqF;AACrF,+FAAuE;AACvE,gEAA0E;AAC1E,6FAAoE;AAEpE,MAAM,WAAW,GAAG;IAClB;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AAEF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAE7B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;QAE5E,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE;YACjE,OAAO;YACP,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACpC,CAAC,CAAC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AAG,CAAC,OAAO,EACX;oBACE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;oBAC1B,QAAQ,EAAE,UAAU;oBACpB,SAAS,EAAE,QAAQ;iBACpB,EACD;oBACE;wBACE,OAAO,EAAE,WAAW,CAAC,OAAO;wBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;wBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,gBAAgB,EAAE,YAAY;qBAC/B;oBACD;wBACE,OAAO,EAAE,WAAW,CAAC,OAAO;wBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;wBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,gBAAgB,EAAE,YAAY;qBAC/B;iBACF,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAA,oBAAU,EACd,iBAAiB,CAAC,GAAG,CACnB,CAAC,gBAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CACxE,CACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -12,7 +12,7 @@ exports.stakePid = new web3_js_1.PublicKey('STAKEGztX7S1MUHxcQHieZhELCntb9Ys9BgU
|
|
12
12
|
exports.poolsKey = 'pools';
|
13
13
|
exports.flowmaticPlatformId = 'flowmatic';
|
14
14
|
exports.flowmaticPlatform = {
|
15
|
-
id: exports.
|
15
|
+
id: exports.flowmaticPlatformId,
|
16
16
|
name: 'Flowmatic',
|
17
17
|
image: 'https://sonar.watch/img/platforms/flowmatic.png',
|
18
18
|
website: 'https://www.flowmatic.xyz/',
|
@@ -20,7 +20,7 @@ exports.flowmaticPlatform = {
|
|
20
20
|
};
|
21
21
|
exports.kishuPlatformId = 'kishu';
|
22
22
|
exports.kishuPlatform = {
|
23
|
-
id: exports.
|
23
|
+
id: exports.kishuPlatformId,
|
24
24
|
name: 'Kishu',
|
25
25
|
image: 'https://sonar.watch/img/platforms/kishu.png',
|
26
26
|
website: 'https://staking.kishuthedog.com/',
|
@@ -28,7 +28,7 @@ exports.kishuPlatform = {
|
|
28
28
|
};
|
29
29
|
exports.yakuPlatformId = 'yaku';
|
30
30
|
exports.yakuPlatform = {
|
31
|
-
id: exports.
|
31
|
+
id: exports.yakuPlatformId,
|
32
32
|
name: 'Yaku',
|
33
33
|
image: 'https://sonar.watch/img/platforms/yaku.png',
|
34
34
|
website: 'https://staking.yaku.gg/',
|
@@ -36,7 +36,7 @@ exports.yakuPlatform = {
|
|
36
36
|
};
|
37
37
|
exports.madbearsPlatformId = 'madbears';
|
38
38
|
exports.madbearsPlatform = {
|
39
|
-
id: exports.
|
39
|
+
id: exports.madbearsPlatformId,
|
40
40
|
name: 'MadBears',
|
41
41
|
image: 'https://sonar.watch/img/platforms/madbears.png',
|
42
42
|
website: 'https://staking.madbears.club/',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spl-staking/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,aAAa,CAAC;AAC3B,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,kDAAkD;CAC1D,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEnB,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,iBAAiB,GAAa;IACzC,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spl-staking/constants.ts"],"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E,CAAC,8CAA8C,EAAE,2BAAmB,CAAC;IACrE,CAAC,8CAA8C,EAAE,0BAAkB,CAAC;CACrE,CAAC,CAAC"}
|
@@ -6,3 +6,4 @@ export declare const obligationType = "0xf95b06141ed4a174f239417323bde3f209b972f
|
|
6
6
|
export declare const mainMarket = "0x84030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece1";
|
7
7
|
export declare const obligationOwnerCapType = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::ObligationOwnerCap<0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
8
8
|
export declare const poolsKey = "poolsInfo";
|
9
|
+
export declare const marketsKey = "markets";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.poolsKey = exports.obligationOwnerCapType = exports.mainMarket = exports.obligationType = exports.packageId = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.marketsKey = exports.poolsKey = exports.obligationOwnerCapType = exports.mainMarket = exports.obligationType = exports.packageId = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'suilend';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -15,4 +15,5 @@ exports.obligationType = `${exports.packageId}::obligation::Obligation`;
|
|
15
15
|
exports.mainMarket = '0x84030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece1';
|
16
16
|
exports.obligationOwnerCapType = `${exports.packageId}::lending_market::ObligationOwnerCap<${exports.packageId}`;
|
17
17
|
exports.poolsKey = 'poolsInfo';
|
18
|
+
exports.marketsKey = 'markets';
|
18
19
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,cAAc,GAAG,GAAG,iBAAS,0BAA0B,CAAC;AACxD,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GAAG,GAAG,iBAAS,wCAAwC,iBAAS,EAAE,CAAC;AACzF,QAAA,QAAQ,GAAG,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,cAAc,GAAG,GAAG,iBAAS,0BAA0B,CAAC;AACxD,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GAAG,GAAG,iBAAS,wCAAwC,iBAAS,EAAE,CAAC;AACzF,QAAA,QAAQ,GAAG,WAAW,CAAC;AACvB,QAAA,UAAU,GAAG,SAAS,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getPoolsRewardsAsMap = void 0;
|
4
|
+
function getPoolsRewardsAsMap(lendingMarkets) {
|
5
|
+
if (!lendingMarkets)
|
6
|
+
return undefined;
|
7
|
+
const rewardMintByPoolId = new Map();
|
8
|
+
for (const lendingMarket of lendingMarkets) {
|
9
|
+
const { reserves } = lendingMarket;
|
10
|
+
for (const reserve of reserves) {
|
11
|
+
const poolsRewards = reserve.fields.deposits_pool_reward_manager.fields.pool_rewards;
|
12
|
+
for (const poolReward of poolsRewards)
|
13
|
+
rewardMintByPoolId.set(poolReward.fields.id.id, poolReward.fields);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
return rewardMintByPoolId;
|
17
|
+
}
|
18
|
+
exports.getPoolsRewardsAsMap = getPoolsRewardsAsMap;
|
19
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/helpers.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAClC,cAA2C;IAE3C,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,kBAAkB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC9D,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;QAEnC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,YAAY,GAChB,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,YAAY,CAAC;YAClE,KAAK,MAAM,UAAU,IAAI,YAAY;gBACnC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAhBD,oDAgBC"}
|
@@ -15,23 +15,29 @@ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
|
15
15
|
const constants_1 = require("./constants");
|
16
16
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
17
|
const client = (0, clients_1.getClientSui)();
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
18
|
+
const marketsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, [
|
19
|
+
constants_1.mainMarket,
|
20
|
+
]);
|
21
|
+
// const poolsRewardsInfo: RewardInfo[] = [];
|
22
|
+
// for (const object of markets) {
|
23
|
+
// if (!object.data || !object.data.content) continue;
|
24
|
+
// const { fields } = object.data.content;
|
25
|
+
// const { reserves } = fields;
|
26
|
+
// for (const reserve of reserves) {
|
27
|
+
// const poolsRewards =
|
28
|
+
// reserve.fields.deposits_pool_reward_manager.fields.pool_rewards;
|
29
|
+
// for (const poolReward of poolsRewards)
|
30
|
+
// poolsRewardsInfo.push({
|
31
|
+
// poolId: poolReward.fields.id.id,
|
32
|
+
// rewardMint: poolReward.fields.coin_type.fields.name,
|
33
|
+
// });
|
34
|
+
// }
|
35
|
+
// }
|
36
|
+
// await cache.setItem(poolsKey, poolsRewardsInfo, {
|
37
|
+
// prefix: platformId,
|
38
|
+
// networkId: NetworkId.sui,
|
39
|
+
// });
|
40
|
+
yield cache.setItem(constants_1.marketsKey, marketsObjects.map((object) => { var _a, _b; return (_b = (_a = object.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields; }), {
|
35
41
|
prefix: constants_1.platformId,
|
36
42
|
networkId: portfolio_core_1.NetworkId.sui,
|
37
43
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAmD;AACnD,qEAAkE;AAClE,
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAmD;AACnD,qEAAkE;AAClE,2CAAiE;AAGjE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAe,EAAgB,MAAM,EAAE;QAClE,sBAAU;KACX,CAAC,CAAC;IAEH,6CAA6C;IAC7C,kCAAkC;IAClC,wDAAwD;IACxD,4CAA4C;IAC5C,iCAAiC;IAEjC,sCAAsC;IACtC,2BAA2B;IAC3B,yEAAyE;IACzE,6CAA6C;IAC7C,gCAAgC;IAChC,2CAA2C;IAC3C,+DAA+D;IAC/D,YAAY;IACZ,MAAM;IACN,IAAI;IAEJ,oDAAoD;IACpD,wBAAwB;IACxB,8BAA8B;IAC9B,MAAM;IAEN,MAAM,KAAK,CAAC,OAAO,CACjB,sBAAU,EACV,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAA,EAAA,CAAC,EAC5D;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -18,108 +18,172 @@ const constants_1 = require("./constants");
|
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
20
20
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
21
|
-
const
|
21
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
+
const helpers_1 = require("./helpers");
|
23
|
+
const constants_2 = require("../solend/constants");
|
22
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
25
|
var _a, _b, _c, _d;
|
24
26
|
const client = (0, clients_1.getClientSui)();
|
25
|
-
const
|
27
|
+
const obligationsCapFields = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
26
28
|
filter: { Package: constants_1.packageId },
|
27
29
|
});
|
28
|
-
if (
|
30
|
+
if (obligationsCapFields.length === 0)
|
29
31
|
return [];
|
30
|
-
const mints = new Set();
|
31
|
-
const rewardsInfo = yield cache.getItem(constants_1.poolsKey, {
|
32
|
-
prefix: constants_1.platformId,
|
33
|
-
networkId: portfolio_core_1.NetworkId.sui,
|
34
|
-
});
|
35
|
-
const rewardInfoById = new Map();
|
36
|
-
if (rewardsInfo)
|
37
|
-
rewardsInfo.forEach((rI) => {
|
38
|
-
rewardInfoById.set(rI.poolId, rI.rewardMint);
|
39
|
-
mints.add(rI.rewardMint);
|
40
|
-
});
|
41
32
|
const obligationsId = [];
|
42
|
-
for (const
|
43
|
-
const type = (_b = (_a =
|
44
|
-
if (!type ||
|
33
|
+
for (const obligationCapField of obligationsCapFields) {
|
34
|
+
const type = (_b = (_a = obligationCapField.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type;
|
35
|
+
if (!(type === null || type === void 0 ? void 0 : type.startsWith(constants_1.obligationOwnerCapType)))
|
45
36
|
continue;
|
46
|
-
const obligationId = (_d = (_c =
|
37
|
+
const obligationId = (_d = (_c = obligationCapField.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.obligation_id;
|
47
38
|
if (obligationId)
|
48
39
|
obligationsId.push(obligationId);
|
49
40
|
}
|
50
|
-
const
|
41
|
+
const obligations = yield (0, multiGetObjects_1.multiGetObjects)(client, obligationsId);
|
42
|
+
if (obligations.length === 0)
|
43
|
+
return [];
|
44
|
+
const mints = new Set();
|
45
|
+
// const rewardsInfos = await cache.getItem<RewardInfo[]>(poolsKey, {
|
46
|
+
// prefix: platformId,
|
47
|
+
// networkId: NetworkId.sui,
|
48
|
+
// });
|
49
|
+
// const rewardInfoById: Map<string, string> = new Map();
|
50
|
+
// if (rewardsInfos)
|
51
|
+
// rewardsInfos.forEach((rI) => {
|
52
|
+
// rewardInfoById.set(rI.poolId, rI.rewardMint);
|
53
|
+
// mints.add(rI.rewardMint);
|
54
|
+
// });
|
55
|
+
const markets = yield cache.getItem(constants_1.marketsKey, {
|
56
|
+
prefix: constants_1.platformId,
|
57
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
58
|
+
});
|
59
|
+
const marketsByIndex = new Map();
|
60
|
+
if (markets)
|
61
|
+
markets.forEach((market) => {
|
62
|
+
marketsByIndex.set(market.id.id, market);
|
63
|
+
});
|
64
|
+
const poolRewardById = (0, helpers_1.getPoolsRewardsAsMap)(markets);
|
65
|
+
if (poolRewardById)
|
66
|
+
poolRewardById.forEach((pool) => mints.add(pool.coin_type.fields.name));
|
51
67
|
const borrowedAssets = [];
|
52
68
|
const borrowedYields = [];
|
53
69
|
const suppliedAssets = [];
|
54
70
|
const suppliedYields = [];
|
55
71
|
const rewardAssets = [];
|
56
|
-
|
72
|
+
const suppliedLtvs = [];
|
73
|
+
const borrowedWeights = [];
|
74
|
+
obligations.forEach((obj) => {
|
57
75
|
if (obj.data && obj.data.content) {
|
58
76
|
obj.data.content.fields.deposits.forEach((dep) => mints.add(dep.fields.coin_type.fields.name));
|
59
77
|
obj.data.content.fields.borrows.forEach((bor) => mints.add(bor.fields.coin_type.fields.name));
|
60
78
|
}
|
61
79
|
});
|
62
80
|
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.sui);
|
63
|
-
for (const obligation of
|
81
|
+
for (const obligation of obligations) {
|
64
82
|
const { data } = obligation;
|
65
83
|
if (!data || !data.content)
|
66
84
|
continue;
|
67
|
-
const
|
85
|
+
const market = marketsByIndex.get(data.content.fields.lending_market_id);
|
86
|
+
if (!market)
|
87
|
+
continue;
|
88
|
+
const { reserves } = market;
|
89
|
+
const { deposits, borrows, user_reward_managers: userRewardManagers, } = data.content.fields;
|
90
|
+
// Deposits
|
68
91
|
for (const deposit of deposits) {
|
69
92
|
const { fields } = deposit;
|
93
|
+
const index = Number(fields.reserve_array_index);
|
94
|
+
if (index > reserves.length)
|
95
|
+
continue;
|
96
|
+
const reserve = reserves[index];
|
97
|
+
const reserveBorrowAmount = new bignumber_js_1.default(reserve.fields.borrowed_amount.fields.value).dividedBy(Math.pow(10, constants_2.wadsDecimal));
|
98
|
+
const reserveAvailableAmount = new bignumber_js_1.default(reserve.fields.available_amount);
|
99
|
+
const cSupply = new bignumber_js_1.default(reserve.fields.ctoken_supply);
|
100
|
+
const cRatio = reserveAvailableAmount
|
101
|
+
.plus(reserveBorrowAmount)
|
102
|
+
.dividedBy(cSupply);
|
70
103
|
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(fields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
|
71
104
|
if (!tokenPrice)
|
72
105
|
continue;
|
73
|
-
const amount = new bignumber_js_1.default(fields.deposited_ctoken_amount)
|
106
|
+
const amount = new bignumber_js_1.default(fields.deposited_ctoken_amount)
|
107
|
+
.multipliedBy(cRatio)
|
108
|
+
.dividedBy(Math.pow(10, tokenPrice.decimals));
|
74
109
|
const price = new bignumber_js_1.default(fields.market_value.fields.value)
|
75
110
|
.dividedBy(Math.pow(10, 18))
|
76
111
|
.dividedBy(amount);
|
77
|
-
suppliedAssets.push(
|
112
|
+
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
|
113
|
+
suppliedLtvs.push(reserve.fields.config.fields.element.fields.max_close_ltv_pct / 100);
|
78
114
|
}
|
115
|
+
// Borrows
|
79
116
|
for (const borrow of borrows) {
|
80
117
|
const { fields } = borrow;
|
118
|
+
const index = Number(fields.reserve_array_index);
|
119
|
+
if (index > reserves.length)
|
120
|
+
continue;
|
121
|
+
const reserve = reserves[index];
|
81
122
|
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(fields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
|
82
123
|
if (!tokenPrice)
|
83
124
|
continue;
|
84
|
-
const
|
125
|
+
const cumulativeRateRatio = new bignumber_js_1.default(reserve.fields.cumulative_borrow_rate.fields.value).dividedBy(fields.cumulative_borrow_rate.fields.value);
|
126
|
+
const amount = new bignumber_js_1.default(fields.borrowed_amount.fields.value)
|
127
|
+
.times(cumulativeRateRatio)
|
128
|
+
.dividedBy(Math.pow(10, (constants_2.wadsDecimal + tokenPrice.decimals)));
|
85
129
|
if (amount.isZero())
|
86
130
|
continue;
|
87
131
|
const price = new bignumber_js_1.default(fields.market_value.fields.value)
|
88
|
-
.dividedBy(Math.pow(10,
|
132
|
+
.dividedBy(Math.pow(10, constants_2.wadsDecimal))
|
89
133
|
.dividedBy(amount);
|
90
|
-
borrowedAssets.push(
|
134
|
+
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
|
135
|
+
const borrowWeight = (0, bignumber_js_1.default)(reserve.fields.config.fields.element.fields.borrow_weight_bps).dividedBy(Math.pow(10, 4));
|
136
|
+
borrowedWeights.push(borrowWeight.toNumber());
|
91
137
|
}
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
138
|
+
// Rewards
|
139
|
+
if (!poolRewardById)
|
140
|
+
continue;
|
141
|
+
const cumulativeAmountByMint = new Map();
|
142
|
+
const earnedAmountByMint = new Map();
|
143
|
+
for (const userRewardManager of userRewardManagers) {
|
144
|
+
const share = new bignumber_js_1.default(userRewardManager.fields.share);
|
145
|
+
for (const userReward of userRewardManager.fields.rewards) {
|
146
|
+
const poolReward = poolRewardById.get(userReward.fields.pool_reward_id);
|
147
|
+
if (!poolReward)
|
97
148
|
continue;
|
98
|
-
const
|
99
|
-
|
100
|
-
|
101
|
-
|
149
|
+
const rewardMint = poolReward.coin_type.fields.name;
|
150
|
+
const earnedAmount = new bignumber_js_1.default(userReward.fields.earned_rewards.fields.value).dividedBy(Math.pow(10, constants_2.wadsDecimal));
|
151
|
+
const cumulativeAmount = new bignumber_js_1.default(userReward.fields.cumulative_rewards_per_share.fields.value)
|
152
|
+
.times(share)
|
153
|
+
.dividedBy(Math.pow(10, constants_2.wadsDecimal));
|
154
|
+
if (cumulativeAmount.isZero())
|
102
155
|
continue;
|
103
|
-
const
|
104
|
-
if (
|
105
|
-
|
156
|
+
const previousCumAmount = cumulativeAmountByMint.get(rewardMint);
|
157
|
+
if (previousCumAmount) {
|
158
|
+
cumulativeAmountByMint.set(rewardMint, previousCumAmount.plus(cumulativeAmount));
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
cumulativeAmountByMint.set(rewardMint, cumulativeAmount);
|
162
|
+
}
|
163
|
+
const previousEarnedAmount = earnedAmountByMint.get(rewardMint);
|
164
|
+
if (previousEarnedAmount) {
|
165
|
+
earnedAmountByMint.set(rewardMint, previousEarnedAmount.plus(earnedAmount));
|
106
166
|
}
|
107
167
|
else {
|
108
|
-
|
168
|
+
earnedAmountByMint.set(rewardMint, earnedAmount);
|
109
169
|
}
|
110
170
|
}
|
111
171
|
}
|
112
|
-
|
172
|
+
cumulativeAmountByMint.forEach((amount, mint) => {
|
113
173
|
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(mint, portfolio_core_1.NetworkId.sui));
|
174
|
+
const earnedAmount = earnedAmountByMint.get(mint);
|
114
175
|
if (tokenPrice)
|
115
|
-
rewardAssets.push(
|
176
|
+
rewardAssets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount
|
177
|
+
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
178
|
+
.minus(earnedAmount || 0)
|
179
|
+
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice)), { attributes: { isClaimable: true } }));
|
116
180
|
});
|
117
181
|
}
|
118
182
|
if (suppliedAssets.length === 0 &&
|
119
183
|
borrowedAssets.length === 0 &&
|
120
184
|
rewardAssets.length === 0)
|
121
185
|
return [];
|
122
|
-
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
186
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
|
123
187
|
const element = {
|
124
188
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
125
189
|
networkId: portfolio_core_1.NetworkId.sui,
|
@@ -135,7 +199,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
135
199
|
suppliedYields,
|
136
200
|
collateralRatio: null,
|
137
201
|
healthRatio,
|
138
|
-
rewardAssets,
|
202
|
+
rewardAssets: [],
|
139
203
|
rewardValue,
|
140
204
|
value,
|
141
205
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qEAAkE;AAElE,qEAAkE;AAClE,
|
1
|
+
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC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CACX,KACD,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IACjC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IACE,cAAc,CAAC,MAAM,KAAK,CAAC;QAC3B,cAAc,CAAC,MAAM,KAAK,CAAC;QAC3B,YAAY,CAAC,MAAM,KAAK,CAAC;QAEzB,OAAO,EAAE,CAAC;IAEZ,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,CAChB,CAAC;IAEJ,MAAM,OAAO,GAAqB;QAChC,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,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,EAAE,EAAE;YAChB,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -50,6 +50,7 @@ export type Reward = {
|
|
50
50
|
export type LendingMarket = {
|
51
51
|
id: ID;
|
52
52
|
version: string;
|
53
|
+
fee_receiver: string;
|
53
54
|
reserves: ParsedData<Reserve>[];
|
54
55
|
};
|
55
56
|
export type Reserve = {
|
@@ -58,12 +59,12 @@ export type Reserve = {
|
|
58
59
|
attributed_borrow_value: ParsedData<Value>;
|
59
60
|
available_amount: string;
|
60
61
|
borrowed_amount: ParsedData<Value>;
|
61
|
-
borrows_pool_reward_manager: ParsedData<
|
62
|
+
borrows_pool_reward_manager: ParsedData<PoolRewardManager>;
|
62
63
|
coin_type: ParsedData<Name>;
|
63
64
|
config: ParsedData<Config>;
|
64
65
|
ctoken_supply: string;
|
65
66
|
cumulative_borrow_rate: ParsedData<Value>;
|
66
|
-
deposits_pool_reward_manager: ParsedData<
|
67
|
+
deposits_pool_reward_manager: ParsedData<PoolRewardManager>;
|
67
68
|
interest_last_update_timestamp_s: string;
|
68
69
|
lending_market_id: string;
|
69
70
|
mint_decimals: number;
|
@@ -73,7 +74,7 @@ export type Reserve = {
|
|
73
74
|
smoothed_price: ParsedData<Value>;
|
74
75
|
unclaimed_spread_fees: ParsedData<Value>;
|
75
76
|
};
|
76
|
-
export type
|
77
|
+
export type PoolRewardManager = {
|
77
78
|
id: ID;
|
78
79
|
last_update_time_ms: string;
|
79
80
|
pool_rewards: ParsedData<PoolReward>[];
|