@sonarwatch/portfolio-plugins 0.12.161 → 0.12.162

Sign up to get free protection for your applications and to get access to all the features.
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.12.161",
3
+ "version": "0.12.162",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -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;
@@ -5,9 +5,11 @@ export declare const platform: Platform;
5
5
  export declare const vaultsPackageId = "0xc4ee7b00ea981402a6285b14ffa5dcd1ee7f97eb2a91df3bcc04fa88c56ac7d7";
6
6
  export declare const farmsPackageId = "0x88701243d0445aa38c0a13f02a9af49a58092dfadb93af9754edb41c52f40085";
7
7
  export declare const vaultsInfoKey = "vaultsInfos";
8
+ export declare const leverageVaultsInfoKey = "leverageVaultsInfos";
8
9
  export declare const farmsInfoKey = "farmsInfos";
9
10
  export declare const vaultsUrl = "https://88ob93rfva.execute-api.ap-southeast-1.amazonaws.com/release/vaults";
10
11
  export declare const poolsUrl = "https://xd0ljetd33.execute-api.ap-southeast-1.amazonaws.com/release/pools";
12
+ export declare const leverageVaultsUrl = "https://4sacq88271.execute-api.ap-southeast-1.amazonaws.com/release/vaults";
11
13
  export declare const vaultsCointsTypes: string[];
12
14
  export declare const vaultsInfo: VaultInfo[];
13
15
  export declare const dynamicFieldPositionType = "0x2::dynamic_field::Field<vector<u8>, 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::position::Position>";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dynamicFieldPositionType = exports.vaultsInfo = exports.vaultsCointsTypes = exports.poolsUrl = exports.vaultsUrl = exports.farmsInfoKey = exports.vaultsInfoKey = exports.farmsPackageId = exports.vaultsPackageId = exports.platform = exports.platformId = void 0;
3
+ exports.dynamicFieldPositionType = exports.vaultsInfo = exports.vaultsCointsTypes = exports.leverageVaultsUrl = exports.poolsUrl = exports.vaultsUrl = exports.farmsInfoKey = exports.leverageVaultsInfoKey = exports.vaultsInfoKey = exports.farmsPackageId = exports.vaultsPackageId = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'kriya';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -13,9 +13,11 @@ exports.platform = {
13
13
  exports.vaultsPackageId = '0xc4ee7b00ea981402a6285b14ffa5dcd1ee7f97eb2a91df3bcc04fa88c56ac7d7';
14
14
  exports.farmsPackageId = '0x88701243d0445aa38c0a13f02a9af49a58092dfadb93af9754edb41c52f40085';
15
15
  exports.vaultsInfoKey = 'vaultsInfos';
16
+ exports.leverageVaultsInfoKey = 'leverageVaultsInfos';
16
17
  exports.farmsInfoKey = 'farmsInfos';
17
18
  exports.vaultsUrl = 'https://88ob93rfva.execute-api.ap-southeast-1.amazonaws.com/release/vaults';
18
19
  exports.poolsUrl = 'https://xd0ljetd33.execute-api.ap-southeast-1.amazonaws.com/release/pools';
20
+ exports.leverageVaultsUrl = 'https://4sacq88271.execute-api.ap-southeast-1.amazonaws.com/release/vaults';
19
21
  exports.vaultsCointsTypes = [
20
22
  '0xc4ee7b00ea981402a6285b14ffa5dcd1ee7f97eb2a91df3bcc04fa88c56ac7d7::kc_allweather_vt::KC_ALLWEATHER_VT',
21
23
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,YAAY,EAAE,sCAAsC;IACjE,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAE1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,YAAY,GAAG,YAAY,CAAC;AAE5B,QAAA,SAAS,GACpB,4EAA4E,CAAC;AAClE,QAAA,QAAQ,GACnB,2EAA2E,CAAC;AAEjE,QAAA,iBAAiB,GAAG;IAC/B,wGAAwG;CACzG,CAAC;AAEW,QAAA,UAAU,GAAgB;IACrC;QACE,SAAS,EACP,wGAAwG;QAC1G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,4GAA4G;QAC9G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,8FAA8F;QAChG,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;CACF,CAAC;AAEW,QAAA,wBAAwB,GACnC,+HAA+H,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,YAAY,EAAE,sCAAsC;IACjE,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAE1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,YAAY,GAAG,YAAY,CAAC;AAE5B,QAAA,SAAS,GACpB,4EAA4E,CAAC;AAClE,QAAA,QAAQ,GACnB,2EAA2E,CAAC;AACjE,QAAA,iBAAiB,GAC5B,4EAA4E,CAAC;AAElE,QAAA,iBAAiB,GAAG;IAC/B,wGAAwG;CACzG,CAAC;AAEW,QAAA,UAAU,GAAgB;IACrC;QACE,SAAS,EACP,wGAAwG;QAC1G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,4GAA4G;QAC9G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,8FAA8F;QAChG,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;CACF,CAAC;AAEW,QAAA,wBAAwB,GACnC,+HAA+H,CAAC"}
@@ -25,7 +25,6 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
25
25
  },
26
26
  })
27
27
  .catch(() => null);
28
- console.log('constexecutor:JobExecutor= ~ pools:', pools);
29
28
  if (!pools)
30
29
  return;
31
30
  const poolsInfo = [];
@@ -1 +1 @@
1
- {"version":3,"file":"farmsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/farmsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAAiE;AAGjE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,GAAqC,MAAM,eAAK;SACxD,GAAG,CAAC,oBAAQ,EAAE;QACb,OAAO,EAAE;YACP,MAAM,EAAE,gCAAgC;YACxC,OAAO,EAAE,+BAA+B;YACxC,WAAW,EAAE,0CAA0C;SACxD;KACF,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;IAE1D,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,SAAS,KAAK,GAAG;YAAE,SAAS;QAErC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,SAAS,EAAE;QAC3C,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;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"farmsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/farmsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAAiE;AAGjE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,GAAqC,MAAM,eAAK;SACxD,GAAG,CAAC,oBAAQ,EAAE;QACb,OAAO,EAAE;YACP,MAAM,EAAE,gCAAgC;YACxC,OAAO,EAAE,+BAA+B;YACxC,WAAW,EAAE,0CAA0C;SACxD;KACF,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAErB,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,SAAS,KAAK,GAAG;YAAE,SAAS;QAErC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,SAAS,EAAE;QAC3C,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;AACF,kBAAe,GAAG,CAAC"}
@@ -9,7 +9,13 @@ const vaultsFetcher_1 = __importDefault(require("./vaultsFetcher"));
9
9
  const vaultsJob_1 = __importDefault(require("./vaultsJob"));
10
10
  const farmsJob_1 = __importDefault(require("./farmsJob"));
11
11
  const farmsFetcher_1 = __importDefault(require("./farmsFetcher"));
12
+ const leverageVaultsFetcher_1 = __importDefault(require("./leverageVaultsFetcher"));
13
+ const leverageVaultsJob_1 = __importDefault(require("./leverageVaultsJob"));
12
14
  exports.platforms = [constants_1.platform];
13
- exports.jobs = [vaultsJob_1.default, farmsJob_1.default];
14
- exports.fetchers = [vaultsFetcher_1.default, farmsFetcher_1.default];
15
+ exports.jobs = [vaultsJob_1.default, leverageVaultsJob_1.default, farmsJob_1.default];
16
+ exports.fetchers = [
17
+ vaultsFetcher_1.default,
18
+ leverageVaultsFetcher_1.default,
19
+ farmsFetcher_1.default,
20
+ ];
15
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA2C;AAC3C,4DAAmC;AACnC,0DAAkC;AAClC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,mBAAQ,EAAE,kBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc,CAAC,uBAAY,EAAE,sBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA4C;AAC5C,4DAAoC;AACpC,0DAAkC;AAClC,kEAA0C;AAC1C,oFAA4D;AAC5D,4EAAoD;AAEvC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,mBAAS,EAAE,2BAAiB,EAAE,kBAAQ,CAAC,CAAC;AACvD,QAAA,QAAQ,GAAc;IACjC,uBAAa;IACb,+BAAqB;IACrB,sBAAY;CACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,111 @@
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 clients_1 = require("../../utils/clients");
19
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
+ const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
21
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
22
+ const leverageVaultsMemo = new MemoizedCache_1.MemoizedCache(constants_1.leverageVaultsInfoKey, {
23
+ prefix: constants_1.platformId,
24
+ networkId: portfolio_core_1.NetworkId.sui,
25
+ });
26
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
27
+ const client = (0, clients_1.getClientSui)();
28
+ const leverageVaults = yield leverageVaultsMemo.getItem(cache);
29
+ const receipts = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
30
+ filter: {
31
+ MatchAny: leverageVaults.map((v) => ({
32
+ StructType: v.farmStakeReceiptType,
33
+ })),
34
+ },
35
+ });
36
+ if (receipts.length === 0)
37
+ return [];
38
+ const mints = new Set();
39
+ receipts.forEach((pos) => {
40
+ var _a;
41
+ const posContent = (_a = pos.data) === null || _a === void 0 ? void 0 : _a.content;
42
+ if (!posContent)
43
+ return;
44
+ const vault = leverageVaults.find((v) => { var _a, _b; return v.farmId === ((_b = (_a = pos.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.farm_id); });
45
+ if (!vault)
46
+ return;
47
+ mints.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.coinA));
48
+ mints.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.coinB));
49
+ });
50
+ const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.sui);
51
+ if (!tokenPrices)
52
+ return [];
53
+ const elements = [];
54
+ receipts.forEach((pos) => {
55
+ var _a;
56
+ const posContent = (_a = pos.data) === null || _a === void 0 ? void 0 : _a.content;
57
+ if (!posContent)
58
+ return;
59
+ const vault = leverageVaults.find((v) => { var _a, _b; return v.farmId === ((_b = (_a = pos.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.farm_id); });
60
+ if (!vault)
61
+ return;
62
+ const tokenPriceA = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(vault.coinA));
63
+ const tokenPriceB = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(vault.coinB));
64
+ if (!tokenPriceA || !tokenPriceB)
65
+ return;
66
+ const sharesPercentage = new bignumber_js_1.default(posContent.fields.rewards_stake_receipt.fields.shares).dividedBy(vault.lpSupply);
67
+ const depositedUsd = sharesPercentage.multipliedBy(vault.tvl);
68
+ if (depositedUsd.isZero())
69
+ return;
70
+ const borrowedAssets = [];
71
+ const borrowedYields = [];
72
+ const suppliedAssets = [];
73
+ const suppliedYields = [];
74
+ const rewardAssets = [];
75
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceA.address, sharesPercentage.multipliedBy(vault.depositedA).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA));
76
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceB.address, sharesPercentage.multipliedBy(vault.borrowedB).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB));
77
+ const { borrowedValue, suppliedValue, value, rewardValue, healthRatio } = (0, portfolio_core_1.getElementLendingValues)({
78
+ suppliedAssets,
79
+ borrowedAssets,
80
+ rewardAssets,
81
+ });
82
+ elements.push({
83
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
84
+ networkId: portfolio_core_1.NetworkId.sui,
85
+ platformId: constants_1.platformId,
86
+ label: 'Lending',
87
+ name: `${vault.vaultSource} ${vault.vaultName}`,
88
+ value,
89
+ data: {
90
+ borrowedAssets,
91
+ borrowedValue,
92
+ borrowedYields,
93
+ suppliedAssets,
94
+ suppliedValue,
95
+ suppliedYields,
96
+ healthRatio,
97
+ rewardAssets,
98
+ rewardValue,
99
+ value,
100
+ },
101
+ });
102
+ });
103
+ return elements;
104
+ });
105
+ const fetcher = {
106
+ id: `${constants_1.platformId}-leverage-vaults`,
107
+ networkId: portfolio_core_1.NetworkId.sui,
108
+ executor,
109
+ };
110
+ exports.default = fetcher;
111
+ //# sourceMappingURL=leverageVaultsFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leverageVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/leverageVaultsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAAgE;AAChE,iDAAmD;AAEnD,qGAA6E;AAC7E,qEAAkE;AAClE,kEAA+D;AAE/D,MAAM,kBAAkB,GAAG,IAAI,6BAAa,CAC1C,iCAAqB,EACrB;IACE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;CACzB,CACF,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE/D,MAAM,QAAQ,GAAG,MAAM,IAAA,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ACZ,CACF,CAAC;QAEF,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,WAAW,CAAC,OAAO,EACnB,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EACzD,0BAAS,CAAC,GAAG,EACb,WAAW,CACZ,CACF,CAAC;QAEF,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC;YACtB,cAAc;YACd,cAAc;YACd,YAAY;SACb,CAAC,CAAC;QAEL,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,EAAE;YAC/C,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,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,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,35 @@
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 axios_1 = __importDefault(require("axios"));
16
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
+ const constants_1 = require("./constants");
18
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
+ const vaults = yield axios_1.default
20
+ .get(constants_1.leverageVaultsUrl)
21
+ .catch(() => null);
22
+ if (!vaults)
23
+ return;
24
+ yield cache.setItem(constants_1.leverageVaultsInfoKey, vaults.data, {
25
+ prefix: constants_1.platformId,
26
+ networkId: portfolio_core_1.NetworkId.sui,
27
+ });
28
+ });
29
+ const job = {
30
+ id: `${constants_1.platformId}-leverage-vaults`,
31
+ executor,
32
+ label: 'normal',
33
+ };
34
+ exports.default = job;
35
+ //# sourceMappingURL=leverageVaultsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leverageVaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/leverageVaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAIqB;AAGrB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAA8C,MAAM,eAAK;SAClE,GAAG,CAAC,6BAAiB,CAAC;SACtB,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAErB,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,KAAK,CAAC,OAAO,CAAC,iCAAqB,EAAE,MAAM,CAAC,IAAI,EAAE;QACtD,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,kBAAkB;IACnC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -153,3 +153,53 @@ export type LiquidityPosition = {
153
153
  stake_weight: string;
154
154
  start_unit: string;
155
155
  };
156
+ export type StakeReceiptWithPoints = {
157
+ farm_id: string;
158
+ id: ID;
159
+ rewards_stake_receipt: {
160
+ fields: {
161
+ farm_id: string;
162
+ id: ID;
163
+ reward_infos: {
164
+ fields: {
165
+ id: ID;
166
+ size: string;
167
+ };
168
+ type: string;
169
+ };
170
+ shares: string;
171
+ };
172
+ type: string;
173
+ };
174
+ user_points_info: {
175
+ fields: {
176
+ claimed_points: string;
177
+ index: string;
178
+ updated_at: string;
179
+ };
180
+ type: string;
181
+ };
182
+ };
183
+ export type LeverageVaultInfo = {
184
+ depositedA: string;
185
+ apr: string;
186
+ borrowedBUsd: string;
187
+ farmStakeReceiptType: string;
188
+ decimalA: string;
189
+ createdAt: string;
190
+ farmSource: string;
191
+ coinB: string;
192
+ decimalB: string;
193
+ tvl: string;
194
+ borrowedB: string;
195
+ targetLeverage: string;
196
+ vaultName: string;
197
+ depositedAUsd: string;
198
+ lpSupply: string;
199
+ vaultSource: string;
200
+ farmId: string;
201
+ fees: string;
202
+ coinA: string;
203
+ updatedAt: string;
204
+ id: string;
205
+ };
@@ -26,7 +26,6 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
26
26
  if (!vaultsBalances.some((balance) => balance.totalBalance !== '0'))
27
27
  return [];
28
28
  const poolInfos = yield cache.getItems(constants_1.vaultsInfo.map((vault) => vault.underlyingPool), { prefix: constants_2.clmmPoolsPrefix, networkId: portfolio_core_1.NetworkId.sui });
29
- console.log('constexecutor:FetcherExecutor= ~ poolInfos:', poolInfos);
30
29
  const vaultsPositionInfo = yield cache.getItem(constants_1.vaultsInfoKey, {
31
30
  prefix: constants_1.platformId,
32
31
  networkId: portfolio_core_1.NetworkId.sui,
@@ -1 +1 @@
1
- {"version":3,"file":"vaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/vaultsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAoE;AACpE,iDAAmD;AACnD,6EAA0E;AAE1E,kDAAqD;AAErD,wFAAyF;AACzF,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,MAAM,IAAA,yCAAmB,EAC9C,MAAM,EACN,KAAK,EACL,sBAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3C,CAAC;IAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,KAAK,GAAG,CAAC;QACjE,OAAO,EAAE,CAAC;IAEZ,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,QAAQ,CACpC,sBAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAC/C,EAAE,MAAM,EAAE,2BAAe,EAAE,SAAS,EAAE,0BAAS,CAAC,GAAG,EAAE,CACtD,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,6CAA6C,EAAE,SAAS,CAAC,CAAC;IAEtE,MAAM,kBAAkB,GAAG,MAAM,KAAK,CAAC,OAAO,CAC5C,yBAAa,EACb;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KAC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W,CAAC,IAAI,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,IAAI;YACvB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;IACL,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAExC,OAAO;QACL;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,WAAW;aACZ;YACD,KAAK,EAAE,eAAe;YACtB,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;SACf;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,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* () {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;