@sonarwatch/portfolio-plugins 0.12.142 → 0.12.144
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2297 -2289
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/alphafi/constants.d.ts +10 -0
- package/src/plugins/alphafi/constants.js +61 -0
- package/src/plugins/alphafi/constants.js.map +1 -0
- package/src/plugins/alphafi/index.d.ts +6 -0
- package/src/plugins/alphafi/index.js +13 -0
- package/src/plugins/alphafi/index.js.map +1 -0
- package/src/plugins/alphafi/poolsJob.d.ts +3 -0
- package/src/plugins/alphafi/poolsJob.js +117 -0
- package/src/plugins/alphafi/poolsJob.js.map +1 -0
- package/src/plugins/alphafi/positionsFetcher.d.ts +3 -0
- package/src/plugins/alphafi/positionsFetcher.js +149 -0
- package/src/plugins/alphafi/positionsFetcher.js.map +1 -0
- package/src/plugins/alphafi/types.d.ts +224 -0
- package/src/plugins/alphafi/types.js +3 -0
- package/src/plugins/alphafi/types.js.map +1 -0
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/cetus/clmmsFetcher.js +22 -11
- package/src/plugins/cetus/clmmsFetcher.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/misc/tokenPriceToAssetTokens.d.ts +2 -2
- package/src/utils/misc/tokenPriceToAssetTokens.js +3 -3
- package/src/utils/misc/tokenPriceToAssetTokens.js.map +1 -1
- 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
package/src/index.js
CHANGED
@@ -135,6 +135,7 @@ const thevault_1 = require("./plugins/thevault");
|
|
135
135
|
const deepbook_1 = require("./plugins/deepbook");
|
136
136
|
const suins_1 = require("./plugins/suins");
|
137
137
|
const debridge_1 = require("./plugins/debridge");
|
138
|
+
const alphafi_1 = require("./plugins/alphafi");
|
138
139
|
const jewel_1 = require("./plugins/jewel");
|
139
140
|
var constants_1 = require("./plugins/tokens/constants");
|
140
141
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
@@ -264,6 +265,7 @@ exports.platforms = [
|
|
264
265
|
...deepbook_1.platforms,
|
265
266
|
...suins_1.platforms,
|
266
267
|
...debridge_1.platforms,
|
268
|
+
...alphafi_1.platforms,
|
267
269
|
...jewel_1.platforms,
|
268
270
|
];
|
269
271
|
// JOBS //
|
@@ -376,6 +378,7 @@ exports.jobs = [
|
|
376
378
|
...deepbook_1.jobs,
|
377
379
|
...suins_1.jobs,
|
378
380
|
...debridge_1.jobs,
|
381
|
+
...alphafi_1.jobs,
|
379
382
|
...jewel_1.jobs,
|
380
383
|
];
|
381
384
|
// FETCHERS //
|
@@ -490,6 +493,7 @@ exports.fetchers = [
|
|
490
493
|
...deepbook_1.fetchers,
|
491
494
|
...suins_1.fetchers,
|
492
495
|
...debridge_1.fetchers,
|
496
|
+
...alphafi_1.fetchers,
|
493
497
|
...jewel_1.fetchers,
|
494
498
|
];
|
495
499
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AAC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B,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAK0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAK2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAKyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,2CAIyB;AACzB,uDAI+B;AAC/B,6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kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,gBAAa;CACjB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "alphafi";
|
3
|
+
export declare const platform: Platform;
|
4
|
+
export declare const alphaPoolsInfoKey = "alphaPoolsInfo";
|
5
|
+
export declare const alphaToken = "0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA";
|
6
|
+
export declare const receiptTypes: string[];
|
7
|
+
export declare const investorsPositionType = "0x2::dynamic_field::Field<vector<u8>, 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::position::Position>";
|
8
|
+
export declare const investorByCetusPool: Map<string, string>;
|
9
|
+
export declare const alphaVaultAddress = "0x6ee8f60226edf48772f81e5986994745dae249c2605a5b12de6602ef1b05b0c1";
|
10
|
+
export declare const naviPools: string[];
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.naviPools = exports.alphaVaultAddress = exports.investorByCetusPool = exports.investorsPositionType = exports.receiptTypes = exports.alphaToken = exports.alphaPoolsInfoKey = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'alphafi';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'Alpha Fi',
|
8
|
+
image: 'https://sonar.watch/img/platforms/alphafi.webp',
|
9
|
+
website: 'https://alphafi.xyz/',
|
10
|
+
twitter: 'https://x.com/AlphaFiSUI',
|
11
|
+
defiLlamaId: 'alphafi', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.alphaPoolsInfoKey = 'alphaPoolsInfo';
|
14
|
+
exports.alphaToken = '0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA';
|
15
|
+
exports.receiptTypes = [
|
16
|
+
'0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphapool::Receipt', // ALPHA_POOL_RECEIPT
|
17
|
+
'0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_sui_pool::Receipt', // ALPHA_SUI_POOL_RECEIPT
|
18
|
+
'0x2793db7aa0e0209afc84f0adb1b258973cf1c9da55c35ee85c18f2ed4912bb6f::alphafi_cetus_pool_base_a::Receipt', // CETUS RECEIPT
|
19
|
+
'0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_pool::Receipt', // CETUS RECEIPT
|
20
|
+
'0x8f7d2c35e19c65213bc2153086969a55ec207b5a25ebdee303a6d9edd9c053e3::alphafi_navi_pool::Receipt', // NAVI RECEIPT
|
21
|
+
];
|
22
|
+
exports.investorsPositionType = '0x2::dynamic_field::Field<vector<u8>, 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::position::Position>';
|
23
|
+
exports.investorByCetusPool = new Map([
|
24
|
+
[
|
25
|
+
'0x30066d9879374276dc01177fbd239a9377b497bcd347c82811d75fcda35b18e5',
|
26
|
+
'0x87a76889bf4ed211276b16eb482bf6df8d4e27749ebecd13017d19a63f75a6d5',
|
27
|
+
],
|
28
|
+
[
|
29
|
+
'0x594f13b8f287003fd48e4264e7056e274b84709ada31e3657f00eeedc1547e37',
|
30
|
+
'0x46d901d5e1dba34103038bd2ba789b775861ea0bf4d6566afd5029cf466a3d88',
|
31
|
+
],
|
32
|
+
[
|
33
|
+
'0xa7239a0c727c40ee3a139689b16b281acfd0682a06c23531b184a61721ece437',
|
34
|
+
'0x1b923520f19660d4eb013242c6d03c84fdea034b8f784cfd71173ef72ece50e1',
|
35
|
+
],
|
36
|
+
[
|
37
|
+
'0xee6f6392cbd9e1997f6e4cf71db0c1ae1611f1f5f7f23f90ad2c64b8f23cceab',
|
38
|
+
'0xb6ca8aba0fb26ed264a3ae3d9c1461ac7c96cdcbeabb01e71086e9a8340b9c55',
|
39
|
+
],
|
40
|
+
[
|
41
|
+
'0xbdf4f673b34274f36be284bca3f765083380fefb29141f971db289294bf679c6',
|
42
|
+
'0x9ae0e56aa0ebc27f9d8a17b5a9118d368ba262118d878977b6194a10a671bbbc',
|
43
|
+
],
|
44
|
+
[
|
45
|
+
'0x676fc5cad79f51f6a7d03bfa3474ecd3c695d322380fc68e3d4f61819da3bf8a',
|
46
|
+
'0x05fa099d1df7b5bfb2e420d5ee2d63508db17c40ce7c4e0ca0305cd5df974e43',
|
47
|
+
],
|
48
|
+
[
|
49
|
+
'0x045e4e3ccd383bedeb8fda54c39a7a1b1a6ed6a9f66aec4998984373558f96a0',
|
50
|
+
'0xdd9018247d579bd7adfdbced4ed39c28821c6019461d37dbdf32f0d409959b1c',
|
51
|
+
],
|
52
|
+
]);
|
53
|
+
exports.alphaVaultAddress = '0x6ee8f60226edf48772f81e5986994745dae249c2605a5b12de6602ef1b05b0c1';
|
54
|
+
exports.naviPools = [
|
55
|
+
'0x01493446093dfcdcfc6c16dc31ffe40ba9ac2e99a3f6c16a0d285bff861944ae', // USDC
|
56
|
+
'0xe4eef7d4d8cafa3ef90ea486ff7d1eec347718375e63f1f778005ae646439aad', // WETH
|
57
|
+
'0x643f84e0a33b19e2b511be46232610c6eb38e772931f582f019b8bbfb893ddb3', // SUI
|
58
|
+
'0x0d9598006d37077b4935400f6525d7f1070784e2d6f04765d76ae0a4880f7d0a', // VSUI
|
59
|
+
'0xc696ca5b8f21a1f8fcd62cff16bbe5a396a4bed6f67909cfec8269eb16e60757', // USDT
|
60
|
+
];
|
61
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/alphafi/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,SAAS,EAAE,sCAAsC;CAC/D,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AACrC,QAAA,UAAU,GACrB,kFAAkF,CAAC;AAExE,QAAA,YAAY,GAAG;IAC1B,wFAAwF,EAAE,qBAAqB;IAC/G,qGAAqG,EAAE,yBAAyB;IAChI,wGAAwG,EAAE,gBAAgB;IAC1H,iGAAiG,EAAE,gBAAgB;IACnH,gGAAgG,EAAE,eAAe;CAClH,CAAC;AAEW,QAAA,qBAAqB,GAChC,+HAA+H,CAAC;AAErH,QAAA,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IAC9D;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;IACD;QACE,oEAAoE;QACpE,oEAAoE;KACrE;CACF,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAE1D,QAAA,SAAS,GAAG;IACvB,oEAAoE,EAAE,OAAO;IAC7E,oEAAoE,EAAE,OAAO;IAC7E,oEAAoE,EAAE,MAAM;IAC5E,oEAAoE,EAAE,OAAO;IAC7E,oEAAoE,EAAE,OAAO;CAC9E,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const positionsFetcher_1 = __importDefault(require("./positionsFetcher"));
|
9
|
+
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [poolsJob_1.default];
|
12
|
+
exports.fetchers = [positionsFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/alphafi/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0EAAkD;AAClD,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,0BAAgB,CAAC,CAAC"}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
|
19
|
+
const getObject_1 = require("../../utils/sui/getObject");
|
20
|
+
const constants_1 = require("./constants");
|
21
|
+
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
22
|
+
const helpers_1 = require("../cetus/helpers");
|
23
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
24
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
26
|
+
const client = (0, clients_1.getClientSui)();
|
27
|
+
const poolsInfos = [];
|
28
|
+
const aplhaPools = Array.from(constants_1.investorByCetusPool.keys());
|
29
|
+
for (let n = 0; n < aplhaPools.length; n++) {
|
30
|
+
const alphaPoolAddress = aplhaPools[n];
|
31
|
+
const investor = constants_1.investorByCetusPool.get(alphaPoolAddress);
|
32
|
+
if (!investor)
|
33
|
+
continue;
|
34
|
+
const investorObj = yield (0, getObject_1.getObject)(client, investor);
|
35
|
+
if (!investorObj || !((_b = (_a = investorObj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
|
36
|
+
continue;
|
37
|
+
const dynFieldObjs = yield (0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, investor);
|
38
|
+
const lpPositionObj = dynFieldObjs.find((obj) => { var _a, _b; return ((_b = (_a = obj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === constants_1.investorsPositionType; });
|
39
|
+
if (!lpPositionObj)
|
40
|
+
continue;
|
41
|
+
const lpPosition = (_d = (_c = lpPositionObj.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.value.fields;
|
42
|
+
if (!lpPosition)
|
43
|
+
continue;
|
44
|
+
const poolObj = yield (0, getObject_1.getObject)(client, lpPosition.pool);
|
45
|
+
if (!((_f = (_e = poolObj.data) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.fields))
|
46
|
+
continue;
|
47
|
+
const pool = (0, helpers_1.getPoolFromObject)(poolObj);
|
48
|
+
const upperBound = 443636;
|
49
|
+
let tickLowerIndex = Number(investorObj.data.content.fields.lower_tick);
|
50
|
+
let tickUpperIndex = Number(investorObj.data.content.fields.upper_tick);
|
51
|
+
if (tickLowerIndex > upperBound) {
|
52
|
+
// eslint-disable-next-line no-bitwise
|
53
|
+
tickLowerIndex = -~(tickLowerIndex - 1);
|
54
|
+
}
|
55
|
+
if (tickUpperIndex > upperBound) {
|
56
|
+
// eslint-disable-next-line no-bitwise
|
57
|
+
tickUpperIndex = -~(tickUpperIndex - 1);
|
58
|
+
}
|
59
|
+
const alphaPool = yield (0, getObject_1.getObject)(client, alphaPoolAddress);
|
60
|
+
if (!((_h = (_g = alphaPool.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields))
|
61
|
+
continue;
|
62
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(lpPosition.liquidity), pool.current_tick_index, tickLowerIndex, tickUpperIndex, false);
|
63
|
+
poolsInfos.push({
|
64
|
+
cointTypeA: (0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeA),
|
65
|
+
cointTypeB: (0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeB),
|
66
|
+
tokenAmountA,
|
67
|
+
tokenAmountB,
|
68
|
+
alphaPoolId: alphaPoolAddress,
|
69
|
+
underlyingPoolId: pool.poolAddress,
|
70
|
+
xTokenSupply: (0, bignumber_js_1.default)(alphaPool.data.content.fields.xTokenSupply),
|
71
|
+
tokensInvested: (0, bignumber_js_1.default)(alphaPool.data.content.fields.tokensInvested),
|
72
|
+
});
|
73
|
+
}
|
74
|
+
const alphaVaultObj = yield (0, getObject_1.getObject)(client, constants_1.alphaVaultAddress);
|
75
|
+
if (alphaVaultObj && ((_k = (_j = alphaVaultObj.data) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.fields)) {
|
76
|
+
const alphaVault = (_m = (_l = alphaVaultObj.data) === null || _l === void 0 ? void 0 : _l.content) === null || _m === void 0 ? void 0 : _m.fields;
|
77
|
+
poolsInfos.push({
|
78
|
+
alphaPoolId: constants_1.alphaVaultAddress,
|
79
|
+
cointTypeA: constants_1.alphaToken,
|
80
|
+
tokenAmountA: (0, bignumber_js_1.default)(alphaVault.alpha_bal),
|
81
|
+
tokensInvested: (0, bignumber_js_1.default)(alphaVault.tokensInvested),
|
82
|
+
xTokenSupply: (0, bignumber_js_1.default)(alphaVault.xTokenSupply),
|
83
|
+
unlockAt: new bignumber_js_1.default(alphaVault.locking_start_ms)
|
84
|
+
.plus(alphaVault.locked_period_in_ms)
|
85
|
+
.toNumber(),
|
86
|
+
});
|
87
|
+
}
|
88
|
+
const naviPoolsObjs = yield (0, multiGetObjects_1.multiGetObjects)(client, constants_1.naviPools);
|
89
|
+
naviPoolsObjs.forEach((obj, index) => {
|
90
|
+
var _a, _b;
|
91
|
+
if (!((_b = (_a = obj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
|
92
|
+
return;
|
93
|
+
const naviPool = obj.data.content.fields;
|
94
|
+
const types = (0, portfolio_core_1.parseTypeString)(obj.data.type);
|
95
|
+
if (!types.keys)
|
96
|
+
return;
|
97
|
+
const token = types.keys[0].type;
|
98
|
+
poolsInfos.push({
|
99
|
+
alphaPoolId: constants_1.naviPools[index],
|
100
|
+
cointTypeA: token,
|
101
|
+
tokenAmountA: (0, bignumber_js_1.default)(naviPool.tokensInvested),
|
102
|
+
xTokenSupply: (0, bignumber_js_1.default)(naviPool.xTokenSupply),
|
103
|
+
tokensInvested: (0, bignumber_js_1.default)(naviPool.tokensInvested),
|
104
|
+
});
|
105
|
+
});
|
106
|
+
yield cache.setItem(constants_1.alphaPoolsInfoKey, poolsInfos, {
|
107
|
+
prefix: constants_1.platformId,
|
108
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
109
|
+
});
|
110
|
+
});
|
111
|
+
const job = {
|
112
|
+
id: `${constants_1.platformId}-pools`,
|
113
|
+
executor,
|
114
|
+
label: 'normal',
|
115
|
+
};
|
116
|
+
exports.default = job;
|
117
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/alphafi/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,iDAAmD;AACnD,mFAAgF;AAChF,yDAAsD;AAEtD,2CAQqB;AAQrB,wFAAyF;AACzF,8CAAqD;AACrD,qEAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,UAAU,GAAoB,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,+BAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;IAE1D,KAAK,IAAI,CAAC,GAAG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CAAC,CAAC,IAAI,CAAC;QAEjC,UAAU,CAAC,IAAI,CAAC;YACd,WAAW,EAAE,qBAAS,CAAC,KAAK,CAAC;YAC7B,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAA,sBAAS,EAAC,QAAQ,CAAC,cAAc,CAAC;YAChD,YAAY,EAAE,IAAA,sBAAS,EAAC,QAAQ,CAAC,YAAY,CAAC;YAC9C,cAAc,EAAE,IAAA,sBAAS,EAAC,QAAQ,CAAC,cAAc,CAAC;SACnD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,6BAAiB,EAAE,UAAU,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,149 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
19
|
+
const clients_1 = require("../../utils/clients");
|
20
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
21
|
+
const balanceFactor = Math.pow(10, 9);
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const client = (0, clients_1.getClientSui)();
|
24
|
+
const [receipts, alphaPoolsInfo] = yield Promise.all([
|
25
|
+
(0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
26
|
+
filter: {
|
27
|
+
MatchAny: constants_1.receiptTypes.map((t) => ({
|
28
|
+
StructType: t,
|
29
|
+
})),
|
30
|
+
},
|
31
|
+
}),
|
32
|
+
cache.getItem(constants_1.alphaPoolsInfoKey, {
|
33
|
+
prefix: constants_1.platformId,
|
34
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
35
|
+
}),
|
36
|
+
]);
|
37
|
+
if (receipts.length === 0 || !alphaPoolsInfo)
|
38
|
+
return [];
|
39
|
+
const alphaPoolInfoById = new Map();
|
40
|
+
alphaPoolsInfo.forEach((pool) => alphaPoolInfoById.set(pool.alphaPoolId, pool));
|
41
|
+
const mints = new Set();
|
42
|
+
alphaPoolsInfo.forEach((aI) => {
|
43
|
+
mints.add(aI.cointTypeA);
|
44
|
+
if (aI.cointTypeB)
|
45
|
+
mints.add(aI.cointTypeB);
|
46
|
+
});
|
47
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap([...Array.from(mints), (0, portfolio_core_1.formatMoveTokenAddress)(constants_1.alphaToken)], portfolio_core_1.NetworkId.sui);
|
48
|
+
const elements = [];
|
49
|
+
const cetusLiquidities = [];
|
50
|
+
const alphaAssets = [];
|
51
|
+
const naviAssets = [];
|
52
|
+
receipts.forEach((receipt) => {
|
53
|
+
var _a, _b;
|
54
|
+
if (!((_b = (_a = receipt.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_id))
|
55
|
+
return;
|
56
|
+
const receiptInfo = receipt.data.content.fields;
|
57
|
+
const alphaPoolInfo = alphaPoolInfoById.get(receiptInfo.pool_id);
|
58
|
+
if (!alphaPoolInfo)
|
59
|
+
return;
|
60
|
+
// Single Vaults
|
61
|
+
if (!alphaPoolInfo.cointTypeB ||
|
62
|
+
!alphaPoolInfo.tokenAmountB ||
|
63
|
+
!alphaPoolInfo.underlyingPoolId) {
|
64
|
+
const lockedShares = new bignumber_js_1.default(receiptInfo.xTokenBalance).dividedBy(alphaPoolInfo.xTokenSupply);
|
65
|
+
const unlockedShares = new bignumber_js_1.default(receiptInfo.unlocked_xtokens).dividedBy(alphaPoolInfo.xTokenSupply);
|
66
|
+
const lockedAmount = lockedShares.multipliedBy(alphaPoolInfo.tokensInvested);
|
67
|
+
const unlockedAmount = unlockedShares.multipliedBy(alphaPoolInfo.tokensInvested);
|
68
|
+
const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatMoveTokenAddress)(alphaPoolInfo.cointTypeA));
|
69
|
+
if (!tokenPrice)
|
70
|
+
return;
|
71
|
+
// Alpha Vault
|
72
|
+
if (alphaPoolInfo.unlockAt) {
|
73
|
+
if (!lockedAmount.isZero())
|
74
|
+
alphaAssets.push((0, tokenPriceToAssetToken_1.default)(alphaPoolInfo.cointTypeA, lockedAmount.dividedBy(balanceFactor).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, undefined, { lockedUntil: alphaPoolInfo.unlockAt }));
|
75
|
+
if (!unlockedAmount.isZero())
|
76
|
+
alphaAssets.push((0, tokenPriceToAssetToken_1.default)(alphaPoolInfo.cointTypeA, unlockedAmount.dividedBy(balanceFactor).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, undefined, { isClaimable: true }));
|
77
|
+
// Navi Strategies
|
78
|
+
}
|
79
|
+
else if (!lockedAmount.isZero()) {
|
80
|
+
naviAssets.push((0, tokenPriceToAssetToken_1.default)(alphaPoolInfo.cointTypeA, lockedAmount.dividedBy(Math.pow(10, 9)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, undefined));
|
81
|
+
}
|
82
|
+
// Cetus Strategies (2 tokens)
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
const [tokenPriceA, tokenPriceB] = [
|
86
|
+
tokenPriceById.get(alphaPoolInfo.cointTypeA),
|
87
|
+
tokenPriceById.get(alphaPoolInfo.cointTypeB),
|
88
|
+
];
|
89
|
+
if (!tokenPriceA || !tokenPriceB)
|
90
|
+
return;
|
91
|
+
const assets = [];
|
92
|
+
const xTokenShares = new bignumber_js_1.default(receiptInfo.xTokenBalance).dividedBy(alphaPoolInfo.xTokenSupply);
|
93
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(alphaPoolInfo.cointTypeA, xTokenShares
|
94
|
+
.times(alphaPoolInfo.tokenAmountA)
|
95
|
+
.dividedBy(Math.pow(10, tokenPriceA.decimals))
|
96
|
+
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA));
|
97
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(alphaPoolInfo.cointTypeB, xTokenShares
|
98
|
+
.times(alphaPoolInfo.tokenAmountB)
|
99
|
+
.dividedBy(Math.pow(10, tokenPriceB.decimals))
|
100
|
+
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB));
|
101
|
+
cetusLiquidities.push({
|
102
|
+
assets,
|
103
|
+
assetsValue: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
104
|
+
rewardAssets: [],
|
105
|
+
rewardAssetsValue: 0,
|
106
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
107
|
+
yields: [],
|
108
|
+
});
|
109
|
+
}
|
110
|
+
});
|
111
|
+
if (cetusLiquidities.length !== 0)
|
112
|
+
elements.push({
|
113
|
+
type: 'liquidity',
|
114
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
115
|
+
platformId: constants_1.platformId,
|
116
|
+
name: 'LP Strategies',
|
117
|
+
value: (0, portfolio_core_1.getUsdValueSum)(cetusLiquidities.map((l) => l.value)),
|
118
|
+
label: 'Deposit',
|
119
|
+
data: { liquidities: cetusLiquidities },
|
120
|
+
});
|
121
|
+
if (alphaAssets.length !== 0)
|
122
|
+
elements.push({
|
123
|
+
type: 'multiple',
|
124
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
125
|
+
platformId: constants_1.platformId,
|
126
|
+
name: 'Alpha Vault',
|
127
|
+
value: (0, portfolio_core_1.getUsdValueSum)(alphaAssets.map((a) => a.value)),
|
128
|
+
label: 'Deposit',
|
129
|
+
data: { assets: alphaAssets },
|
130
|
+
});
|
131
|
+
if (naviAssets.length !== 0)
|
132
|
+
elements.push({
|
133
|
+
type: 'multiple',
|
134
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
135
|
+
platformId: constants_1.platformId,
|
136
|
+
name: 'Single Token Strategies',
|
137
|
+
value: (0, portfolio_core_1.getUsdValueSum)(naviAssets.map((a) => a.value)),
|
138
|
+
label: 'Deposit',
|
139
|
+
data: { assets: naviAssets },
|
140
|
+
});
|
141
|
+
return elements;
|
142
|
+
});
|
143
|
+
const fetcher = {
|
144
|
+
id: `${constants_1.platformId}-positions`,
|
145
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
146
|
+
executor,
|
147
|
+
};
|
148
|
+
exports.default = fetcher;
|
149
|
+
//# sourceMappingURL=positionsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/alphafi/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAErC,2CAKqB;AAErB,qEAAkE;AAClE,iDAAmD;AAEnD,qGAA6E;AAE7E,MAAM,aAAa,GAAG,SAA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