@sonarwatch/portfolio-plugins 0.12.188 → 0.12.189
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1554 -1550
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/auxexchange/aptosLpJob.js +3 -3
- package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bluefin/bankFetcher.js +2 -2
- package/src/plugins/bluefin/bankFetcher.js.map +1 -1
- package/src/plugins/bluefin/poolFetcher.js +3 -3
- package/src/plugins/bluefin/poolFetcher.js.map +1 -1
- package/src/plugins/bluefin/positionFetcher.js +1 -1
- package/src/plugins/bluefin/positionFetcher.js.map +1 -1
- package/src/plugins/bluemove/poolsJob.js +18 -11
- package/src/plugins/bluemove/poolsJob.js.map +1 -1
- package/src/plugins/liquiditypools-sei/job.js +3 -3
- package/src/plugins/liquiditypools-sei/job.js.map +1 -1
- package/src/plugins/orca/lpTokensJob.js +2 -2
- package/src/plugins/orca/lpTokensJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/clmm/tokenPricesFromSqrt.js +7 -3
- package/src/utils/clmm/tokenPricesFromSqrt.js.map +1 -1
- package/src/utils/misc/MemoizedCache.d.ts +2 -1
- package/src/utils/misc/MemoizedCache.js +7 -2
- package/src/utils/misc/MemoizedCache.js.map +1 -1
- package/src/utils/misc/checkComputeAndStoreTokensPrices.js +3 -3
- package/src/utils/misc/checkComputeAndStoreTokensPrices.js.map +1 -1
- package/src/utils/misc/{getDecimalsForToken.d.ts → getCachedDecimalsForToken.d.ts} +5 -2
- package/src/utils/misc/{getDecimalsForToken.js → getCachedDecimalsForToken.js} +30 -12
- package/src/utils/misc/getCachedDecimalsForToken.js.map +1 -0
- package/src/utils/misc/getLpUnderlyingTokenSource.js +2 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/sui/constants.d.ts +2 -1
- package/src/utils/sui/constants.js +3 -2
- package/src/utils/sui/constants.js.map +1 -1
- package/src/utils/misc/getDecimalsForToken.js.map +0 -1
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
@@ -17,7 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const aptos_1 = require("../../utils/aptos");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const
|
20
|
+
const getCachedDecimalsForToken_1 = require("../../utils/misc/getCachedDecimalsForToken");
|
21
21
|
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
22
22
|
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
23
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -67,8 +67,8 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
67
|
tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(typeY, portfolio_core_1.NetworkId.aptos)),
|
68
68
|
];
|
69
69
|
const [decimalsX, decimalsY] = yield Promise.all([
|
70
|
-
(0,
|
71
|
-
(0,
|
70
|
+
(0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, typeX, portfolio_core_1.NetworkId.aptos),
|
71
|
+
(0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, typeY, portfolio_core_1.NetworkId.aptos),
|
72
72
|
]);
|
73
73
|
if (!decimalsX || !decimalsY)
|
74
74
|
continue;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAKoC;AAGpC,6CAI2B;AAC3B,iDAAqD;AACrD,2CAA0E;AAC1E,
|
1
|
+
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAKoC;AAGpC,6CAI2B;AAC3B,iDAAqD;AACrD,2CAA0E;AAC1E,0FAAuF;AACvF,mHAA2F;AAC3F,qGAA6E;AAO7E,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,qBAAS,CAAC,CAAC;IAC/D,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,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,SAAS;SACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,gCAAe,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,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}
|
@@ -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;
|
@@ -25,7 +25,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
25
25
|
const client = (0, clients_1.getClientSui)();
|
26
26
|
const [bank, tokenPrice] = yield Promise.all([
|
27
27
|
(0, getObject_1.getObject)(client, constants_1.bankObjectId),
|
28
|
-
cache.getTokenPrice((0, portfolio_core_1.formatMoveTokenAddress)(constants_2.
|
28
|
+
cache.getTokenPrice((0, portfolio_core_1.formatMoveTokenAddress)(constants_2.wUsdcSuiType), portfolio_core_1.NetworkId.sui),
|
29
29
|
]);
|
30
30
|
if (!((_b = (_a = bank.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.accounts.fields.id.id) || !tokenPrice)
|
31
31
|
return [];
|
@@ -41,7 +41,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
41
41
|
const assets = [];
|
42
42
|
if (((_f = (_e = account.data) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.fields.value.fields.balance) &&
|
43
43
|
((_h = (_g = account.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields.value.fields.balance) !== '0')
|
44
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(constants_2.
|
44
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_2.wUsdcSuiType, new bignumber_js_1.default((_k = (_j = account.data) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.fields.value.fields.balance)
|
45
45
|
.dividedBy(Math.pow(10, 9))
|
46
46
|
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
|
47
47
|
if (assets.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bankFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/bankFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAuD;AACvD,iDAAmD;AACnD,yDAAsD;AACtD,iFAA8E;AAE9E,qGAA6E;AAC7E,
|
1
|
+
{"version":3,"file":"bankFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/bankFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAuD;AACvD,iDAAmD;AACnD,yDAAsD;AACtD,iFAA8E;AAE9E,qGAA6E;AAC7E,yDAAyD;AAEz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AI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;aAC9D,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;aAClB,QAAQ,EAAE,EACb,0BAAS,CAAC,GAAG,EACb,UAAU,CACX,CACF,CAAC;IAEJ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,IAAI,EAAE,iBAAiB;YACvB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,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,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -27,7 +27,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
27
27
|
prefix: constants_1.platformId,
|
28
28
|
networkId: portfolio_core_1.NetworkId.sui,
|
29
29
|
}),
|
30
|
-
cache.getTokenPrice((0, portfolio_core_1.formatMoveTokenAddress)(constants_2.
|
30
|
+
cache.getTokenPrice((0, portfolio_core_1.formatMoveTokenAddress)(constants_2.wUsdcSuiType), portfolio_core_1.NetworkId.sui),
|
31
31
|
]);
|
32
32
|
if (!vault || !tokenPrice)
|
33
33
|
return [];
|
@@ -42,11 +42,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
42
|
return [];
|
43
43
|
const assets = [];
|
44
44
|
if (((_d = (_c = vaultAccount.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.value.fields.amount_locked) !== '0')
|
45
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(constants_2.
|
45
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(constants_2.wUsdcSuiType, new bignumber_js_1.default((_f = (_e = vaultAccount.data) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.fields.value.fields.amount_locked)
|
46
46
|
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
47
47
|
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
|
48
48
|
if (((_h = (_g = vaultAccount.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields.value.fields.pending_withdrawal) !== '0')
|
49
|
-
assets.push(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_2.
|
49
|
+
assets.push(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_2.wUsdcSuiType, new bignumber_js_1.default((_k = (_j = vaultAccount.data) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.fields.value.fields.pending_withdrawal)
|
50
50
|
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
51
51
|
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice)));
|
52
52
|
if (assets.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/poolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAkD;AAElD,qGAA6E;AAC7E,iFAA8E;AAC9E,iDAAmD;AACnD,
|
1
|
+
{"version":3,"file":"poolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/poolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAC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ache) => __awaiter(void 0, void 0, void 0, function* (
|
|
49
49
|
value: owner,
|
50
50
|
},
|
51
51
|
})));
|
52
|
-
const tokenPrice = yield cache.getTokenPrice(constants_2.
|
52
|
+
const tokenPrice = yield cache.getTokenPrice(constants_2.wUsdcSuiType, portfolio_core_1.NetworkId.sui);
|
53
53
|
if (!tokenPrice)
|
54
54
|
return [];
|
55
55
|
const elements = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA0D;AAC1D,iFAA8E;AAC9E,iDAAmD;AAEnD,qEAAkE;AAClE,qGAA6E;AAC7E,
|
1
|
+
{"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA0D;AAC1D,iFAA8E;AAC9E,iDAAmD;AAEnD,qEAAkE;AAClE,qGAA6E;AAC7E,yDAAyD;AACzD,0DAAyD;AAEzD,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB,MAAM,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;AAClD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,oBAAoB;IACpB,IAAI,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAW,2BAAe,EAAE;YAC7D,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC,CAAC;QACH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C,CAAC,KAAK,CAAC,CAAC;gBACjE,cAAc;gBACd,cAAc;gBACd,aAAa,EAAE,IAAA,+BAAc,EAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACjE,cAAc;gBACd,YAAY;gBACZ,WAAW,EAAE,IAAA,+BAAc,EAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC7D,WAAW,EAAE,IAAI;gBACjB,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -14,7 +14,9 @@ const constants_1 = require("./constants");
|
|
14
14
|
const clients_1 = require("../../utils/clients");
|
15
15
|
const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
|
16
16
|
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
17
|
+
const getCachedDecimalsForToken_1 = require("../../utils/misc/getCachedDecimalsForToken");
|
17
18
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
var _a, _b, _c;
|
18
20
|
const client = (0, clients_1.getClientSui)();
|
19
21
|
const pools = yield (0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, constants_1.dexInfoId);
|
20
22
|
const mints = new Set();
|
@@ -37,28 +39,33 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
39
|
});
|
38
40
|
const tokenPrices = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui);
|
39
41
|
const lpSources = [];
|
40
|
-
|
41
|
-
var _a, _b, _c;
|
42
|
+
for (const pool of pools) {
|
42
43
|
if (!pool.data ||
|
43
44
|
!pool.data.type ||
|
44
45
|
((_a = pool.data.content) === null || _a === void 0 ? void 0 : _a.fields.is_freeze) ||
|
45
46
|
!((_c = (_b = pool.data.content) === null || _b === void 0 ? void 0 : _b.fields.lsp_supply) === null || _c === void 0 ? void 0 : _c.type))
|
46
|
-
|
47
|
+
continue;
|
47
48
|
const { keys: coinTypeKeys } = (0, portfolio_core_1.parseTypeString)(pool.data.type);
|
48
49
|
if (!coinTypeKeys)
|
49
|
-
|
50
|
+
continue;
|
50
51
|
const coinTypeX = coinTypeKeys[0].type;
|
51
52
|
const coinTypeY = coinTypeKeys[1].type;
|
52
53
|
const { keys: lpCoinTypeKeys } = (0, portfolio_core_1.parseTypeString)(pool.data.content.fields.lsp_supply.type);
|
53
54
|
if (!lpCoinTypeKeys)
|
54
|
-
|
55
|
+
continue;
|
55
56
|
const lpCoinType = lpCoinTypeKeys[0].type;
|
56
57
|
if (!coinTypeX || !coinTypeY || !lpCoinType)
|
57
|
-
|
58
|
+
continue;
|
58
59
|
const tokenPriceX = tokenPrices.get(coinTypeX);
|
59
60
|
const tokenPriceY = tokenPrices.get(coinTypeY);
|
60
|
-
|
61
|
-
|
61
|
+
const decimalsX = tokenPriceX
|
62
|
+
? tokenPriceX.decimals
|
63
|
+
: yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, coinTypeX, portfolio_core_1.NetworkId.sui);
|
64
|
+
const decimalsY = tokenPriceY
|
65
|
+
? tokenPriceY.decimals
|
66
|
+
: yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, coinTypeY, portfolio_core_1.NetworkId.sui);
|
67
|
+
if (!decimalsX || !decimalsY)
|
68
|
+
continue;
|
62
69
|
const newLpSources = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
63
70
|
networkId: portfolio_core_1.NetworkId.sui,
|
64
71
|
sourceId: lpCoinType,
|
@@ -72,14 +79,14 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
79
|
poolUnderlyingsRaw: [
|
73
80
|
{
|
74
81
|
address: (0, portfolio_core_1.formatTokenAddress)(coinTypeX, portfolio_core_1.NetworkId.sui),
|
75
|
-
decimals:
|
82
|
+
decimals: decimalsX,
|
76
83
|
reserveAmountRaw: pool.data.content.fields.reserve_x,
|
77
84
|
weight: 0.5,
|
78
85
|
tokenPrice: tokenPriceX,
|
79
86
|
},
|
80
87
|
{
|
81
88
|
address: (0, portfolio_core_1.formatTokenAddress)(coinTypeY, portfolio_core_1.NetworkId.sui),
|
82
|
-
decimals:
|
89
|
+
decimals: decimalsY,
|
83
90
|
reserveAmountRaw: pool.data.content.fields.reserve_y,
|
84
91
|
weight: 0.5,
|
85
92
|
tokenPrice: tokenPriceY,
|
@@ -87,7 +94,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
94
|
],
|
88
95
|
});
|
89
96
|
lpSources.push(...newLpSources);
|
90
|
-
}
|
97
|
+
}
|
91
98
|
yield cache.setTokenPriceSources(lpSources);
|
92
99
|
});
|
93
100
|
const job = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluemove/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,iDAAmD;AACnD,mFAAgF;AAEhF,8EAA2E;
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluemove/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,iDAAmD;AACnD,mFAAgF;AAEhF,8EAA2E;AAC3E,0FAAuF;AAEvF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE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 = require("./constants");
|
20
20
|
const sei_1 = require("../../utils/sei");
|
21
21
|
const isAContract_1 = __importDefault(require("../../utils/sei/isAContract"));
|
22
|
-
const
|
22
|
+
const getCachedDecimalsForToken_1 = require("../../utils/misc/getCachedDecimalsForToken");
|
23
23
|
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
24
24
|
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
25
25
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -55,8 +55,8 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
55
|
continue;
|
56
56
|
const [tokenPriceX, tokenPriceY] = yield cache.getTokenPrices([poolInfo.mintX, poolInfo.mintY], portfolio_core_1.NetworkId.sei);
|
57
57
|
const [decimalsX, decimalsY] = yield Promise.all([
|
58
|
-
(0,
|
59
|
-
(0,
|
58
|
+
(0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, poolInfo.mintX, portfolio_core_1.NetworkId.sei),
|
59
|
+
(0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, poolInfo.mintY, portfolio_core_1.NetworkId.sei),
|
60
60
|
]);
|
61
61
|
const [reserveAmountRawX, reserveAmountRawY] = [
|
62
62
|
new bignumber_js_1.default(poolInfo.amountX),
|
@@ -1 +1 @@
|
|
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,2CAAqE;AACrE,yCAKyB;AACzB,8EAAsD;AACtD,
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;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;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,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,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,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,6BAAiB,EAAE,KAAK,EAAE;QAC5C,MAAM,EAAE,6BAAiB;QACzB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,oBAAoB;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -22,7 +22,7 @@ const solana_1 = require("../../utils/solana");
|
|
22
22
|
const fetchTokenSupplyAndDecimals_1 = require("../../utils/solana/fetchTokenSupplyAndDecimals");
|
23
23
|
const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
|
24
24
|
const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
|
25
|
-
const
|
25
|
+
const getCachedDecimalsForToken_1 = require("../../utils/misc/getCachedDecimalsForToken");
|
26
26
|
const getLpTokenSource_1 = require("../../utils/misc/getLpTokenSource");
|
27
27
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
28
|
const client = (0, clients_1.getClientSolana)();
|
@@ -49,7 +49,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
49
|
(0, runInBatch_1.default)(farmsAccounts.map((farm) => () => (0, fetchTokenSupplyAndDecimals_1.fetchTokenSupplyAndDecimals)(farm.farmTokenMint, client, 0))),
|
50
50
|
]);
|
51
51
|
const unknownMints = mints.filter((mint) => !tokenPriceById.get(mint));
|
52
|
-
const mintDecimals = yield (0, runInBatch_1.default)(unknownMints.map((mint) => () => (0,
|
52
|
+
const mintDecimals = yield (0, runInBatch_1.default)(unknownMints.map((mint) => () => (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, mint, portfolio_core_1.NetworkId.solana)));
|
53
53
|
const tokenAccountByAddress = new Map();
|
54
54
|
const tokensSupplyAndDecimalsByMint = new Map();
|
55
55
|
const decimalsByMint = new Map();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAErC,2CAKqB;AACrB,uCAA0D;AAC1D,iDAAsD;AACtD,6DAA0E;AAC1E,+CAK4B;AAC5B,gGAA6F;AAG7F,6EAAqD;AACrD,oFAA2E;AAC3E,
|
1
|
+
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAErC,2CAKqB;AACrB,uCAA0D;AAC1D,iDAAsD;AACtD,6DAA0E;AAC1E,+CAK4B;AAC5B,gGAA6F;AAG7F,6EAAqD;AACrD,oFAA2E;AAC3E,0FAAuF;AACvF,wEAAqE;AAErE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAA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,CAAC,WAAW,IAAI;oDACpC,cAAc,KAAE,WAAW,EAAE,CAAC;iBACpC;gBACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,EAAE,EAAE,sBAAU;YACd,WAAW,EAAE,wBAAwB;YACrC,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,QAAQ,CAAC,QAAQ,EAAE;YAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,QAAQ,EAAE,YAAY;YACtB,KAAK;YACL,WAAW,EAAE,cAAc,CAAC,WAAW,IAAI;gDACpC,cAAc,KAAE,WAAW,EAAE,CAAC;aACpC;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,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"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
42
42
|
const clients_1 = require("../../utils/clients");
|
43
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
44
|
const helpers_1 = require("./helpers");
|
45
|
-
const query = (0, graphql_request_1.gql) `
|
46
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
-
getAirdropFinalFrontend(authority: $authority) {
|
48
|
-
authority
|
49
|
-
community_allocation
|
50
|
-
eligibility
|
51
|
-
main_allocation
|
52
|
-
og_allocation
|
53
|
-
s1_allocation
|
54
|
-
s2_allocation
|
55
|
-
total_allocation
|
56
|
-
__typename
|
57
|
-
}
|
58
|
-
}
|
45
|
+
const query = (0, graphql_request_1.gql) `
|
46
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
+
getAirdropFinalFrontend(authority: $authority) {
|
48
|
+
authority
|
49
|
+
community_allocation
|
50
|
+
eligibility
|
51
|
+
main_allocation
|
52
|
+
og_allocation
|
53
|
+
s1_allocation
|
54
|
+
s2_allocation
|
55
|
+
total_allocation
|
56
|
+
__typename
|
57
|
+
}
|
58
|
+
}
|
59
59
|
`;
|
60
60
|
const networkId = portfolio_core_1.NetworkId.solana;
|
61
61
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.sqrtPriceX64ToPrice = void 0;
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
18
|
-
const
|
18
|
+
const getCachedDecimalsForToken_1 = require("../misc/getCachedDecimalsForToken");
|
19
19
|
const constants_1 = require("../../plugins/tokens/constants");
|
20
20
|
const getSourceWeight_1 = __importDefault(require("../misc/getSourceWeight"));
|
21
21
|
const computeAndStoreLpPrice_1 = require("../misc/computeAndStoreLpPrice");
|
@@ -34,8 +34,12 @@ function storeTokenPricesFromSqrt(cache, networkId, source, reserveX, reserveY,
|
|
34
34
|
const [tokenPriceX, tokenPriceY] = yield cache.getTokenPrices([mintX, mintY], networkId);
|
35
35
|
if (!tokenPriceX && !tokenPriceY)
|
36
36
|
return undefined;
|
37
|
-
const decimalsX = tempDecimalsX ||
|
38
|
-
|
37
|
+
const decimalsX = tempDecimalsX ||
|
38
|
+
(tokenPriceX === null || tokenPriceX === void 0 ? void 0 : tokenPriceX.decimals) ||
|
39
|
+
(yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, mintX, networkId));
|
40
|
+
const decimalsY = tempDecimalsY ||
|
41
|
+
(tokenPriceY === null || tokenPriceY === void 0 ? void 0 : tokenPriceY.decimals) ||
|
42
|
+
(yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, mintY, networkId));
|
39
43
|
if (!decimalsX || !decimalsY)
|
40
44
|
return undefined;
|
41
45
|
const xToYPrice = sqrtPriceX64ToPrice(sqrtPrice, decimalsX, decimalsY);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tokenPricesFromSqrt.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clmm/tokenPricesFromSqrt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAIoC;AAEpC,4DAAiC;AAEjC,
|
1
|
+
{"version":3,"file":"tokenPricesFromSqrt.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clmm/tokenPricesFromSqrt.ts"],"names":[],"mappings":";;;;;;;;;;;;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C,CAAC;iBACR,SAAS,CAAC,SAAA,EAAE,EAAI,SAAS,CAAA,CAAC,CAAC;YAC9B,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,GAAG,CAAC,CAAC;YACpC,IAAI,GAAG,CAAC,UAAU,CAAC,yCAAgB,CAAC;gBAAE,OAAO,SAAS,CAAC;YACvD,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,EAAE,MAAM;gBACV,MAAM;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS;gBACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;gBACnC,QAAQ,EAAE,SAAS;gBACnB,KAAK;gBACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;YACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,SAAS,CAAC;;CAClB;AArFD,2CAqFC;AAED,MAAM,cAAc,GAAG,CAAC,GAAY,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExE,SAAgB,mBAAmB,CACjC,YAAuB,EACvB,SAAiB,EACjB,SAAiB;IAEjB,OAAO,cAAc,CAAC,IAAI,oBAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,oBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC;AARD,kDAQC"}
|
@@ -5,8 +5,9 @@ export declare class MemoizedCache<T extends StorageValue, K = T> {
|
|
5
5
|
private readonly opts;
|
6
6
|
private readonly transform;
|
7
7
|
private readonly ttl;
|
8
|
+
private readonly fetch;
|
8
9
|
private item;
|
9
10
|
private lastUpdate;
|
10
|
-
constructor(key: string, opts: TransactionOptions, transform?: (i: T | undefined) => K, ttl?: number);
|
11
|
+
constructor(key: string, opts: TransactionOptions, transform?: (i: T | undefined) => K, ttl?: number, fetch?: () => Promise<T>);
|
11
12
|
getItem: (cache: Cache) => Promise<K>;
|
12
13
|
}
|