@sonarwatch/portfolio-plugins 0.11.120 → 0.11.122
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/plugins/abex/positionsFetcher.js +3 -1
- package/src/plugins/abex/positionsFetcher.js.map +1 -1
- package/src/plugins/aftermath/poolsJob.js +1 -1
- package/src/plugins/aftermath/poolsJob.js.map +1 -1
- package/src/plugins/aries/constants.d.ts +1 -0
- package/src/plugins/aries/constants.js +2 -1
- package/src/plugins/aries/constants.js.map +1 -1
- package/src/plugins/aries/depositsFetcher.js +16 -0
- package/src/plugins/aries/depositsFetcher.js.map +1 -1
- package/src/plugins/aries/helpers.d.ts +4 -0
- package/src/plugins/aries/helpers.js +39 -1
- package/src/plugins/aries/helpers.js.map +1 -1
- package/src/plugins/aries/index.js +2 -1
- package/src/plugins/aries/index.js.map +1 -1
- package/src/plugins/aries/reservesJob.d.ts +3 -0
- package/src/plugins/aries/reservesJob.js +64 -0
- package/src/plugins/aries/reservesJob.js.map +1 -0
- package/src/plugins/aries/types.d.ts +53 -0
- package/src/plugins/auxexchange/aptosLpJob.js +1 -1
- package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
- package/src/plugins/fluxbeam/poolsJob.js +1 -1
- package/src/plugins/fluxbeam/poolsJob.js.map +1 -1
- package/src/plugins/jupiter/helpers.d.ts +1 -0
- package/src/plugins/jupiter/helpers.js +30 -1
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/types.d.ts +10 -0
- package/src/plugins/lifinity/constants.d.ts +2 -0
- package/src/plugins/lifinity/constants.js +3 -1
- package/src/plugins/lifinity/constants.js.map +1 -1
- package/src/plugins/lifinity/index.js +2 -1
- package/src/plugins/lifinity/index.js.map +1 -1
- package/src/plugins/lifinity/xLfntyJob.d.ts +3 -0
- package/src/plugins/lifinity/xLfntyJob.js +43 -0
- package/src/plugins/lifinity/xLfntyJob.js.map +1 -0
- package/src/plugins/liquiditypools-sei/job.js +1 -1
- package/src/plugins/liquiditypools-sei/job.js.map +1 -1
- package/src/plugins/meteora/poolsJob.js +33 -46
- package/src/plugins/meteora/poolsJob.js.map +1 -1
- package/src/plugins/orca/lpTokensJob.js +1 -1
- package/src/plugins/orca/lpTokensJob.js.map +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +1 -1
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/suilend/helpers.d.ts +7 -2
- package/src/plugins/suilend/helpers.js +54 -3
- package/src/plugins/suilend/helpers.js.map +1 -1
- package/src/plugins/suilend/marketsJob.js +43 -2
- package/src/plugins/suilend/marketsJob.js.map +1 -1
- package/src/plugins/suilend/obligationsFetcher.js +22 -12
- package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
- package/src/plugins/suilend/types.d.ts +5 -0
- package/src/utils/misc/getLpUnderlyingTokenSource.d.ts +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
@@ -0,0 +1,43 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const helpers_1 = require("../jupiter/helpers");
|
16
|
+
const constants_2 = require("../tokens/constants");
|
17
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
const prices = yield (0, helpers_1.getPrices)([new web3_js_1.PublicKey(constants_1.xLfntyMint)], new web3_js_1.PublicKey(constants_1.lfntyMint));
|
19
|
+
const price = prices.get(constants_1.xLfntyMint);
|
20
|
+
if (!price)
|
21
|
+
return;
|
22
|
+
const lfntyTokenPrice = yield cache.getTokenPrice(constants_1.lfntyMint, portfolio_core_1.NetworkId.solana);
|
23
|
+
if (!lfntyTokenPrice)
|
24
|
+
return;
|
25
|
+
const source = {
|
26
|
+
address: constants_1.xLfntyMint,
|
27
|
+
decimals: constants_1.xLfntyDecimals,
|
28
|
+
id: 'jupiter-api',
|
29
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
30
|
+
timestamp: Date.now(),
|
31
|
+
price: price * lfntyTokenPrice.price,
|
32
|
+
platformId: constants_2.walletTokensPlatform.id,
|
33
|
+
weight: 0.5,
|
34
|
+
};
|
35
|
+
yield cache.setTokenPriceSource(source);
|
36
|
+
});
|
37
|
+
const job = {
|
38
|
+
id: `${constants_1.platformId}-xlfnty`,
|
39
|
+
executor,
|
40
|
+
label: 'normal',
|
41
|
+
};
|
42
|
+
exports.default = job;
|
43
|
+
//# sourceMappingURL=xLfntyJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"xLfntyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/xLfntyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAG5C,2CAAgF;AAChF,gDAA+C;AAC/C,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAS,EAC5B,CAAC,IAAI,mBAAS,CAAC,sBAAU,CAAC,CAAC,EAC3B,IAAI,mBAAS,CAAC,qBAAS,CAAC,CACzB,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAU,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,aAAa,CAC/C,qBAAS,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,eAAe;QAAE,OAAO;IAE7B,MAAM,MAAM,GAAqB;QAC/B,OAAO,EAAE,sBAAU;QACnB,QAAQ,EAAE,0BAAc;QACxB,EAAE,EAAE,aAAa;QACjB,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK;QACpC,UAAU,EAAE,gCAAoB,CAAC,EAAE;QACnC,MAAM,EAAE,GAAG;KACZ,CAAC;IACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -64,7 +64,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
64
|
];
|
65
65
|
if (!decimalsX || !decimalsY)
|
66
66
|
continue;
|
67
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpContract,
|
67
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpContract, portfolio_core_1.NetworkId.sei, {
|
68
68
|
address: poolInfo.mintX,
|
69
69
|
decimals: decimalsX,
|
70
70
|
reserveAmountRaw: reserveAmountRawX,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../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AA0B,EACjD,UAAU,EACV,
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,2CAA4D;AAC5D,yCAKyB;AACzB,8EAAsD;AACtD,8EAA2E;AAC3E,6GAAqF;AACrF,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAAG,MAAM,IAAA,wBAAiB,EAAC,IAAA,0BAAc,EAAC,0BAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE9E,MAAM,yBAAyB,GAA0B,IAAI,GAAG,EAAE,CAAC;IACnE,KAAK,MAAM,iBAAiB,IAAI,+BAAmB,EAAE,CAAC;QACpD,MAAM,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC;QACpC,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,SAAS,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAErC,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC;QACnD,KAAK,MAAM,UAAU,IAAI,SAAS,EAAE,CAAC;YACnC,MAAM,WAAW,GAAG,CAAC,MAAM,cAAc,CAAC,kBAAkB,CAC1D,UAAU,EACV,uBAAiB,CAClB,CAAc,CAAC;YAChB,IAAI,CAAC,WAAW;gBAAE,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UAAU,CAAC,CAAC;gBAClE,IAAI,CAAC,eAAe;oBAAE,SAAS;gBAC/B,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE;oBACxC,GAAG,eAAe;oBAClB,UAAU;iBACX,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC;QACxD,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnD,MAAM,KAAK,CAAC,OAAO,CACjB,QAAQ,EACR,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC3B;YACE,MAAM,EAAE,oBAAQ;YAChB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,oBAAQ;IACZ,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -23,6 +23,7 @@ const fetchTokenSupplyAndDecimals_1 = require("../../utils/solana/fetchTokenSupp
|
|
23
23
|
const struct_1 = require("./struct");
|
24
24
|
const filters_1 = require("./filters");
|
25
25
|
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
26
|
+
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
26
27
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
27
28
|
const client = (0, clients_1.getClientSolana)();
|
28
29
|
// Get all 2-tokens pool (permissionless)
|
@@ -78,11 +79,11 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
79
|
const tokensAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, Array.from(vaultsLpAddresses));
|
79
80
|
if (!tokensAccounts)
|
80
81
|
return;
|
81
|
-
const
|
82
|
+
const tokenAccountsMap = new Map();
|
82
83
|
tokensAccounts.forEach((tokenAccount) => {
|
83
84
|
if (!tokenAccount)
|
84
85
|
return;
|
85
|
-
|
86
|
+
tokenAccountsMap.set(tokenAccount.pubkey.toString(), tokenAccount);
|
86
87
|
});
|
87
88
|
// Get all mints account
|
88
89
|
const mintsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, Array.from(lpMints));
|
@@ -90,59 +91,45 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
91
|
mintsAccounts.forEach((mintAccount) => {
|
91
92
|
if (!mintAccount)
|
92
93
|
return;
|
93
|
-
mintsAccountByAddress.set(mintAccount.pubkey, mintAccount);
|
94
|
+
mintsAccountByAddress.set(mintAccount.pubkey.toString(), mintAccount);
|
94
95
|
});
|
95
96
|
for (let id = 0; id < poolsAccounts.length; id++) {
|
96
97
|
const poolAccount = poolsAccounts[id];
|
97
|
-
const
|
98
|
-
const
|
99
|
-
|
98
|
+
const aTokenMint = poolAccount.tokenAMint.toString();
|
99
|
+
const bTokenMint = poolAccount.tokenBMint.toString();
|
100
|
+
const aTokenPrice = tokenPriceById.get(aTokenMint);
|
101
|
+
const bTokenPrice = tokenPriceById.get(bTokenMint);
|
102
|
+
if (!bTokenPrice || !aTokenPrice)
|
100
103
|
continue;
|
101
|
-
const
|
102
|
-
const
|
103
|
-
if (!
|
104
|
+
const tAccountA = tokenAccountsMap.get(poolAccount.aVaultLp.toString());
|
105
|
+
const tAccountB = tokenAccountsMap.get(poolAccount.bVaultLp.toString());
|
106
|
+
if (!tAccountA || !tAccountB)
|
104
107
|
continue;
|
105
|
-
if (
|
106
|
-
tokenAccountB.amount.isLessThanOrEqualTo(0))
|
108
|
+
if (tAccountA.amount.isZero() || tAccountB.amount.isZero())
|
107
109
|
continue;
|
108
|
-
const
|
109
|
-
const tokenAmountB = tokenAccountB.amount.dividedBy(Math.pow(10, BTokenPrice.decimals));
|
110
|
-
const totalValueTokenA = tokenAmountA.multipliedBy(ATokenPrice.price);
|
111
|
-
const totalValueTokenB = tokenAmountB.multipliedBy(BTokenPrice.price);
|
112
|
-
const { lpMint } = poolAccount;
|
110
|
+
const lpMint = poolAccount.lpMint.toString();
|
113
111
|
const lpMintAccount = mintsAccountByAddress.get(lpMint);
|
114
112
|
if (!lpMintAccount)
|
115
113
|
continue;
|
116
|
-
const
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
yield cache.setTokenPriceSource({
|
136
|
-
id: constants_1.platformId,
|
137
|
-
weight: 1,
|
138
|
-
address: lpMint.toString(),
|
139
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
140
|
-
platformId: constants_1.platformId,
|
141
|
-
decimals: lpDecimals,
|
142
|
-
price,
|
143
|
-
underlyings,
|
144
|
-
timestamp: Date.now(),
|
145
|
-
});
|
114
|
+
const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.solana, lpMint, constants_1.platformId, undefined, {
|
115
|
+
address: lpMint,
|
116
|
+
decimals: lpMintAccount.decimals,
|
117
|
+
supplyRaw: lpMintAccount.supply,
|
118
|
+
}, [
|
119
|
+
{
|
120
|
+
address: aTokenPrice.address,
|
121
|
+
decimals: aTokenPrice.decimals,
|
122
|
+
price: aTokenPrice.price,
|
123
|
+
reserveAmountRaw: tAccountA.amount,
|
124
|
+
},
|
125
|
+
{
|
126
|
+
address: bTokenPrice.address,
|
127
|
+
decimals: bTokenPrice.decimals,
|
128
|
+
price: bTokenPrice.price,
|
129
|
+
reserveAmountRaw: tAccountB.amount,
|
130
|
+
},
|
131
|
+
]);
|
132
|
+
yield cache.setTokenPriceSource(lpSource);
|
146
133
|
}
|
147
134
|
// 4 pools
|
148
135
|
for (let id = 0; id < meteoraPools.length; id++) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAC5C,gEAAqC;AACrC,2CAAyD;AACzD,iDAAsD;AACtD,+CAO4B;AAC5B,mCAAgC;AAChC,gGAA6F;AAC7F,qCAAsD;AACtD,uCAAqE;AAGrE,6FAAoE;AACpE,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,yCAAyC;IACzC,MAAM,qBAAqB,GAAG,MAAM,IAAA,iCAAwB,EAC1D,MAAM,EACN,wBAAe,EACf,0BAAc,EACd,8BAAoB,CACrB,CAAC;IACF,MAAM,mBAAmB,GAAG,MAAM,IAAA,iCAAwB,EACxD,MAAM,EACN,wBAAe,EACf,0BAAc,EACd,4BAAkB,CACnB,CAAC;IAEF,SAAS;IACT,MAAM,YAAY,GAAG,aAAK,CAAC;IAC3B,6BAA6B;IAC7B,MAAM,iBAAiB,GAAmB,IAAI,GAAG,EAAE,CAAC;IACpD,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,iBAAiB,CAAC,GA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AC;QAEnC,MAAM,KAAK,CAAC,mBAAmB,CAAC;YAC9B,EAAE,EAAE,sBAAU;YACd,MAAM,EAAE,CAAC;YACT,OAAO;YACP,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,QAAQ;YACR,KAAK;YACL,WAAW;YACX,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,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"}
|
@@ -87,7 +87,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
87
|
continue;
|
88
88
|
const coinAmountWei = new bignumber_js_1.default(poolCoinTokenAccount.amount.toString());
|
89
89
|
const pcAmountWei = new bignumber_js_1.default(poolPcTokenAccount.amount.toString());
|
90
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpMint.toString(),
|
90
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpMint.toString(), portfolio_core_1.NetworkId.solana, {
|
91
91
|
address: mintA,
|
92
92
|
decimals: decimalsA,
|
93
93
|
reserveAmountRaw: coinAmountWei,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AAErC,2CAAyE;AACzE,uCAA0D;AAC1D,iDAAsD;AACtD,6DAA0E;AAC1E,+CAK4B;AAC5B,gGAA6F;AAG7F,6EAAqD;AACrD,oFAA2E;AAC3E,6FAAoE;AACpE,6GAAqF;AACrF,8EAA2E;AAC3E,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EA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IACL,CAAC;AACH,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"}
|
@@ -86,7 +86,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
86
|
];
|
87
87
|
if (!decimalsX || !decimalsY)
|
88
88
|
continue;
|
89
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType,
|
89
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
|
90
90
|
address: typeX,
|
91
91
|
decimals: decimalsX,
|
92
92
|
reserveAmountRaw: reserveAmountRawX,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pancakeswap/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAuD;AAGvD,2CAA+E;AAE/E,iDAAqD;AACrD,6CAM2B;AAC3B,6FAAoE;AACpE,6GAAqF;AACrF,8EAA2E;AAC3E,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,MAAM,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C;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -136,7 +136,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
136
|
tokenPrices.get(mintB),
|
137
137
|
];
|
138
138
|
const lpMint = amm.lpMintAddress;
|
139
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpMint.toString(),
|
139
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpMint.toString(), portfolio_core_1.NetworkId.solana, {
|
140
140
|
address: mintA,
|
141
141
|
decimals: decimalsA,
|
142
142
|
reserveAmountRaw: tokenAmountA,
|
@@ -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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,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"}
|
@@ -1,2 +1,7 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import BigNumber from 'bignumber.js';
|
2
|
+
import { BorrowLendRate } from '@sonarwatch/portfolio-core';
|
3
|
+
import { LendingMarket, PoolReward, Reserve } from './types';
|
4
|
+
export declare function getPoolsRewardsAsMap(lendingMarkets: LendingMarket[] | undefined): Map<string, PoolReward>;
|
5
|
+
export declare function getRatesAsMap(borrowLendRates: BorrowLendRate[] | undefined): Map<string, BorrowLendRate>;
|
6
|
+
export declare function getBorrowApr(utilization: BigNumber, borrowedAmount: BigNumber, availableAmount: BigNumber, reserveFields: Reserve): number;
|
7
|
+
export declare function getDepositApr(utilization: BigNumber, borrowApr: number, reserveFields: Reserve): number;
|
@@ -1,10 +1,14 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getPoolsRewardsAsMap = void 0;
|
6
|
+
exports.getDepositApr = exports.getBorrowApr = exports.getRatesAsMap = exports.getPoolsRewardsAsMap = void 0;
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
4
8
|
function getPoolsRewardsAsMap(lendingMarkets) {
|
5
|
-
if (!lendingMarkets)
|
6
|
-
return undefined;
|
7
9
|
const rewardMintByPoolId = new Map();
|
10
|
+
if (!lendingMarkets)
|
11
|
+
return rewardMintByPoolId;
|
8
12
|
for (const lendingMarket of lendingMarkets) {
|
9
13
|
const { reserves } = lendingMarket;
|
10
14
|
for (const reserve of reserves) {
|
@@ -16,4 +20,51 @@ function getPoolsRewardsAsMap(lendingMarkets) {
|
|
16
20
|
return rewardMintByPoolId;
|
17
21
|
}
|
18
22
|
exports.getPoolsRewardsAsMap = getPoolsRewardsAsMap;
|
23
|
+
function getRatesAsMap(borrowLendRates) {
|
24
|
+
const ratesByReserveId = new Map();
|
25
|
+
if (!borrowLendRates)
|
26
|
+
return ratesByReserveId;
|
27
|
+
for (const borrowLendRate of borrowLendRates) {
|
28
|
+
const id = borrowLendRate.poolName;
|
29
|
+
ratesByReserveId.set(id, borrowLendRate);
|
30
|
+
}
|
31
|
+
return ratesByReserveId;
|
32
|
+
}
|
33
|
+
exports.getRatesAsMap = getRatesAsMap;
|
34
|
+
function getBorrowApr(utilization, borrowedAmount, availableAmount, reserveFields) {
|
35
|
+
const { interest_rate_aprs: rateAprs, interest_rate_utils: rateUtils } = reserveFields.config.fields.element.fields;
|
36
|
+
if (borrowedAmount.isZero())
|
37
|
+
return (0, bignumber_js_1.default)(rateAprs[0]).dividedBy(100).toNumber();
|
38
|
+
if (availableAmount.isZero())
|
39
|
+
return (0, bignumber_js_1.default)(rateAprs[rateAprs.length]).dividedBy(100).toNumber();
|
40
|
+
for (let i = 0; i < rateUtils.length; i++) {
|
41
|
+
const currentUtil = rateUtils[i] / 100;
|
42
|
+
const nextUtil = rateUtils[i + 1] / 100;
|
43
|
+
const currentApr = new bignumber_js_1.default(rateAprs[i]).dividedBy(Math.pow(10, 4));
|
44
|
+
const nextApr = new bignumber_js_1.default(rateAprs[i + 1]).dividedBy(Math.pow(10, 4));
|
45
|
+
if (utilization.isEqualTo(currentUtil)) {
|
46
|
+
return currentApr.toNumber();
|
47
|
+
}
|
48
|
+
if (utilization.isLessThan(nextUtil)) {
|
49
|
+
const utilizationDelta = utilization.minus(currentUtil);
|
50
|
+
const utilStepsDelta = nextUtil - currentUtil;
|
51
|
+
return utilizationDelta
|
52
|
+
.dividedBy(utilStepsDelta)
|
53
|
+
.times(nextApr.minus(currentApr))
|
54
|
+
.plus(currentApr)
|
55
|
+
.toNumber();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
return 0;
|
59
|
+
}
|
60
|
+
exports.getBorrowApr = getBorrowApr;
|
61
|
+
function getDepositApr(utilization, borrowApr, reserveFields) {
|
62
|
+
return (0, bignumber_js_1.default)(borrowApr)
|
63
|
+
.times(1 -
|
64
|
+
Number(reserveFields.config.fields.element.fields.spread_fee_bps) /
|
65
|
+
Math.pow(10, 4))
|
66
|
+
.times(utilization)
|
67
|
+
.toNumber();
|
68
|
+
}
|
69
|
+
exports.getDepositApr = getDepositApr;
|
19
70
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/helpers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAIrC,SAAgB,oBAAoB,CAClC,cAA2C;IAE3C,MAAM,kBAAkB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC9D,IAAI,CAAC,cAAc;QAAE,OAAO,kBAAkB,CAAC;IAE/C,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;QACnC,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,CA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ments, 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
|
+
};
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
13
17
|
const clients_1 = require("../../utils/clients");
|
14
18
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
15
19
|
const constants_1 = require("./constants");
|
20
|
+
const helpers_1 = require("./helpers");
|
21
|
+
const constants_2 = require("../solend/constants");
|
16
22
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
var _a, _b;
|
17
24
|
const client = (0, clients_1.getClientSui)();
|
18
25
|
const marketsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, [
|
19
26
|
constants_1.mainMarket,
|
20
27
|
]);
|
21
|
-
|
28
|
+
const promises = [];
|
29
|
+
const rates = [];
|
30
|
+
const lendingMarkets = [];
|
31
|
+
for (const market of marketsObjects) {
|
32
|
+
if ((_b = (_a = market.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) {
|
33
|
+
lendingMarkets.push(market.data.content.fields);
|
34
|
+
for (const reserve of market.data.content.fields.reserves) {
|
35
|
+
const borrowedAmount = new bignumber_js_1.default(reserve.fields.borrowed_amount.fields.value);
|
36
|
+
const availableAmount = new bignumber_js_1.default(reserve.fields.available_amount).times(Math.pow(10, constants_2.wadsDecimal));
|
37
|
+
const utilization = borrowedAmount.dividedBy(availableAmount.plus(borrowedAmount));
|
38
|
+
const borrowApr = (0, helpers_1.getBorrowApr)(utilization, borrowedAmount, availableAmount, reserve.fields);
|
39
|
+
const depositApr = (0, helpers_1.getDepositApr)(utilization, borrowApr, reserve.fields);
|
40
|
+
const rate = {
|
41
|
+
poolName: reserve.fields.id.id,
|
42
|
+
borrowedAmount: borrowedAmount.toNumber(),
|
43
|
+
depositedAmount: borrowedAmount.plus(availableAmount).toNumber(),
|
44
|
+
platformId: constants_1.platformId,
|
45
|
+
tokenAddress: reserve.fields.coin_type.fields.name,
|
46
|
+
utilizationRatio: utilization.toNumber(),
|
47
|
+
depositYield: { apr: depositApr, apy: (0, portfolio_core_1.aprToApy)(depositApr) },
|
48
|
+
borrowYield: { apr: borrowApr, apy: (0, portfolio_core_1.aprToApy)(borrowApr) },
|
49
|
+
};
|
50
|
+
rates.push(rate);
|
51
|
+
promises.push(cache.setItem(`${reserve.fields.id.id}-${reserve.fields.coin_type.fields.name}`, rate, {
|
52
|
+
prefix: portfolio_core_1.borrowLendRatesPrefix,
|
53
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
54
|
+
}));
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
promises.push(cache.setItem(constants_1.marketsKey, {
|
59
|
+
lendingMarkets,
|
60
|
+
rates,
|
61
|
+
}, {
|
22
62
|
prefix: constants_1.platformId,
|
23
63
|
networkId: portfolio_core_1.NetworkId.sui,
|
24
|
-
});
|
64
|
+
}));
|
65
|
+
yield Promise.allSettled(promises);
|
25
66
|
});
|
26
67
|
const job = {
|
27
68
|
id: `${constants_1.platformId}-markets`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,iDAAmD;AACnD,qEAAkE;AAClE,2CAAiE;AAEjE,uCAAwD;AACxD,mDAAkD;AAElD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;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@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
42
|
if (obligations.length === 0)
|
43
43
|
return [];
|
44
44
|
const mints = new Set();
|
45
|
-
const
|
45
|
+
const marketsInfo = yield cache.getItem(constants_1.marketsKey, {
|
46
46
|
prefix: constants_1.platformId,
|
47
47
|
networkId: portfolio_core_1.NetworkId.sui,
|
48
48
|
});
|
49
|
+
const lendingMarkets = marketsInfo === null || marketsInfo === void 0 ? void 0 : marketsInfo.lendingMarkets;
|
50
|
+
const rates = marketsInfo === null || marketsInfo === void 0 ? void 0 : marketsInfo.rates;
|
51
|
+
const ratesByReserveId = (0, helpers_1.getRatesAsMap)(rates);
|
49
52
|
const marketsByIndex = new Map();
|
50
|
-
if (
|
51
|
-
|
53
|
+
if (lendingMarkets)
|
54
|
+
marketsInfo.lendingMarkets.forEach((market) => {
|
52
55
|
marketsByIndex.set(market.id.id, market);
|
53
56
|
});
|
54
|
-
const poolRewardById = (0, helpers_1.getPoolsRewardsAsMap)(
|
55
|
-
|
56
|
-
poolRewardById.forEach((pool) => mints.add(pool.coin_type.fields.name));
|
57
|
+
const poolRewardById = (0, helpers_1.getPoolsRewardsAsMap)(lendingMarkets);
|
58
|
+
poolRewardById.forEach((pool) => mints.add(pool.coin_type.fields.name));
|
57
59
|
const borrowedAssets = [];
|
58
60
|
const borrowedYields = [];
|
59
61
|
const suppliedAssets = [];
|
@@ -92,6 +94,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
92
94
|
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(fields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
|
93
95
|
if (!tokenPrice)
|
94
96
|
continue;
|
97
|
+
const reserveRates = ratesByReserveId.get(reserve.fields.id.id);
|
98
|
+
if (reserveRates) {
|
99
|
+
suppliedYields.push([reserveRates.depositYield]);
|
100
|
+
}
|
95
101
|
const amount = new bignumber_js_1.default(fields.deposited_ctoken_amount)
|
96
102
|
.multipliedBy(cRatio)
|
97
103
|
.dividedBy(Math.pow(10, tokenPrice.decimals));
|
@@ -103,20 +109,24 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
103
109
|
}
|
104
110
|
// Borrows
|
105
111
|
for (const borrow of borrows) {
|
106
|
-
const { fields } = borrow;
|
107
|
-
const reserve = reserves.at(Number(
|
112
|
+
const { fields: userBorrowFields } = borrow;
|
113
|
+
const reserve = reserves.at(Number(userBorrowFields.reserve_array_index));
|
108
114
|
if (!reserve)
|
109
115
|
continue;
|
110
|
-
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(
|
116
|
+
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(userBorrowFields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
|
111
117
|
if (!tokenPrice)
|
112
118
|
continue;
|
113
|
-
const cumulativeRateRatio = new bignumber_js_1.default(reserve.fields.cumulative_borrow_rate.fields.value).dividedBy(
|
114
|
-
const amount = new bignumber_js_1.default(
|
119
|
+
const cumulativeRateRatio = new bignumber_js_1.default(reserve.fields.cumulative_borrow_rate.fields.value).dividedBy(userBorrowFields.cumulative_borrow_rate.fields.value);
|
120
|
+
const amount = new bignumber_js_1.default(userBorrowFields.borrowed_amount.fields.value)
|
115
121
|
.times(cumulativeRateRatio)
|
116
122
|
.dividedBy(Math.pow(10, (constants_2.wadsDecimal + tokenPrice.decimals)));
|
117
123
|
if (amount.isZero())
|
118
124
|
continue;
|
119
|
-
const
|
125
|
+
const reserveRates = ratesByReserveId.get(reserve.fields.id.id);
|
126
|
+
if (reserveRates) {
|
127
|
+
borrowedYields.push([reserveRates.borrowYield]);
|
128
|
+
}
|
129
|
+
const price = new bignumber_js_1.default(userBorrowFields.market_value.fields.value)
|
120
130
|
.dividedBy(Math.pow(10, constants_2.wadsDecimal))
|
121
131
|
.dividedBy(amount);
|
122
132
|
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
|