@sonarwatch/portfolio-plugins 0.14.4 → 0.14.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +1 -1
  3. package/src/plugins/01/depostisFetcher.js +4 -3
  4. package/src/plugins/01/depostisFetcher.js.map +1 -1
  5. package/src/plugins/debridge/airdropFetcher.d.ts +1 -0
  6. package/src/plugins/debridge/airdropFetcher.js +42 -11
  7. package/src/plugins/debridge/airdropFetcher.js.map +1 -1
  8. package/src/plugins/debridge/dlmmVaultsFetcher.js +29 -87
  9. package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
  10. package/src/plugins/debridge/index.js +1 -1
  11. package/src/plugins/debridge/index.js.map +1 -1
  12. package/src/plugins/debridge/types.d.ts +1 -1
  13. package/src/plugins/lulo/depositsFetcher.js +1 -17
  14. package/src/plugins/lulo/depositsFetcher.js.map +1 -1
  15. package/src/plugins/nxfinance/constants.js +1 -0
  16. package/src/plugins/nxfinance/constants.js.map +1 -1
  17. package/src/plugins/nxfinance/positionsFetcher.js +3 -1
  18. package/src/plugins/nxfinance/positionsFetcher.js.map +1 -1
  19. package/src/plugins/save/constants.d.ts +2 -0
  20. package/src/plugins/save/constants.js +9 -1
  21. package/src/plugins/save/constants.js.map +1 -1
  22. package/src/plugins/save/helpers.d.ts +3 -3
  23. package/src/plugins/save/helpers.js +122 -121
  24. package/src/plugins/save/helpers.js.map +1 -1
  25. package/src/plugins/save/index.js +1 -1
  26. package/src/plugins/save/index.js.map +1 -1
  27. package/src/plugins/save/obligationsFetcher.js +14 -34
  28. package/src/plugins/save/obligationsFetcher.js.map +1 -1
  29. package/src/utils/elementbuilder/ElementBorrowlendBuilder.js +0 -1
  30. package/src/utils/elementbuilder/ElementBorrowlendBuilder.js.map +1 -1
  31. package/src/utils/elementbuilder/ElementBuilder.d.ts +0 -1
  32. package/src/utils/elementbuilder/ElementBuilder.js +0 -1
  33. package/src/utils/elementbuilder/ElementBuilder.js.map +1 -1
  34. package/src/utils/elementbuilder/ElementParams.d.ts +0 -1
  35. package/src/utils/elementbuilder/ElementRegistry.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.14.6](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.5...plugins-0.14.6) (2024-10-17)
6
+
7
+
8
+
9
+ ## [0.14.5](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.4...plugins-0.14.5) (2024-10-17)
10
+
11
+
12
+ ### Reverts
13
+
14
+ * Revert "nxfinance fix" ([771326b](https://github.com/sonarwatch/portfolio/commit/771326b2733e529f7b90a7827978822b4f640349))
15
+
16
+
17
+
5
18
  ## [0.14.4](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.3...plugins-0.14.4) (2024-10-17)
6
19
 
7
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.14.4",
3
+ "version": "0.14.6",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -40,9 +40,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
40
40
  const mint = constants_1.mints[i];
41
41
  if (mint === '1111111111111111111111111111111111111111111')
42
42
  continue;
43
- const amount = mint ===
44
- ('So11111111111111111111111111111111111111112' ||
45
- 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So')
43
+ const amount = [
44
+ 'So11111111111111111111111111111111111111112',
45
+ 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
46
+ ].includes(mint)
46
47
  ? rawAmount.dividedBy(1000)
47
48
  : rawAmount;
48
49
  if (amount.isLessThan('0.0001'))
@@ -1 +1 @@
1
- {"version":3,"file":"depostisFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/depostisFetcher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;YAC3B,CAAC,CAAC,SAAS,CAAC;QAEhB,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,SAAS;QAE1C,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;QAErE,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,IAAI,EACJ,MAAM,CAAC,QAAQ,EAAE,EACjB,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE3C,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5E,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChB,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"depostisFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/depostisFetcher.ts"],"names":[],"mapp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3
  export declare const airdropFetcherSolana: AirdropFetcher;
4
+ export declare const fetcher: import("../..").Fetcher;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.airdropFetcherSolana = exports.airdropFetcherEvm = void 0;
15
+ exports.fetcher = exports.airdropFetcherSolana = exports.airdropFetcherEvm = void 0;
16
16
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
18
  const axios_1 = __importDefault(require("axios"));
@@ -23,9 +23,9 @@ const realDistributions = [
23
23
  'Claim 50% vested with bonus in 6 months after TGE',
24
24
  'First distribution',
25
25
  ];
26
- const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
26
+ const executorSolana = (owner) => __awaiter(void 0, void 0, void 0, function* () {
27
27
  const apiRes = yield axios_1.default.get(constants_1.apiUrl + owner, {
28
- timeout: 1000,
28
+ timeout: 3000,
29
29
  });
30
30
  if (!apiRes.data.distributions || apiRes.data.distributions.length === 0) {
31
31
  return (0, AirdropFetcher_1.getAirdropRaw)({
@@ -59,20 +59,51 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
59
59
  items,
60
60
  });
61
61
  });
62
+ const executorEvm = (owner) => __awaiter(void 0, void 0, void 0, function* () {
63
+ const apiRes = yield axios_1.default.get(constants_1.apiUrl + owner, {
64
+ timeout: 3000,
65
+ });
66
+ if (!apiRes.data.distributions || apiRes.data.distributions.length === 0) {
67
+ return (0, AirdropFetcher_1.getAirdropRaw)({
68
+ statics: constants_1.firstDistribStatics,
69
+ items: [
70
+ {
71
+ amount: 0,
72
+ isClaimed: false,
73
+ label: 'DBR',
74
+ address: undefined,
75
+ imageUri: constants_1.dbrMint ? undefined : constants_1.platform.image,
76
+ },
77
+ ],
78
+ });
79
+ }
80
+ const items = [];
81
+ for (const distribution of apiRes.data.distributions) {
82
+ if (!realDistributions.includes(distribution.title))
83
+ continue;
84
+ const tokens = new bignumber_js_1.default(distribution.tokens).div(dbrFactor);
85
+ items.push({
86
+ amount: tokens.toNumber(),
87
+ isClaimed: false,
88
+ label: 'DBR',
89
+ address: undefined,
90
+ imageUri: constants_1.dbrMint ? undefined : constants_1.platform.image,
91
+ });
92
+ }
93
+ return (0, AirdropFetcher_1.getAirdropRaw)({
94
+ statics: constants_1.firstDistribStatics,
95
+ items,
96
+ });
97
+ });
62
98
  exports.airdropFetcherEvm = {
63
99
  id: `${constants_1.firstDistribStatics.id}-evm`,
64
100
  networkId: portfolio_core_1.NetworkId.ethereum,
65
- executor,
101
+ executor: executorEvm,
66
102
  };
67
103
  exports.airdropFetcherSolana = {
68
104
  id: `${constants_1.firstDistribStatics.id}-solana`,
69
105
  networkId: portfolio_core_1.NetworkId.solana,
70
- executor,
106
+ executor: executorSolana,
71
107
  };
72
- // export const fetcher = airdropFetcherToFetcher(
73
- // airdropFetcher,
74
- // platform.id,
75
- // 'deepbook-airdrop',
76
- // airdropStatics.claimEnd
77
- // );
108
+ exports.fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.airdropFetcherSolana, constants_1.platform.id, 'debridge-airdrop', constants_1.firstDistribStatics.claimEnd);
78
109
  //# sourceMappingURL=airdropFetcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,kDAA6C;AAC7C,yDAI8B;AAC9B,2CAMqB;AAGrB,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;AACnD,MAAM,iBAAiB,GAAG;IACxB,mDAAmD;IACnD,oBAAoB;CACrB,CAAC;AACF,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE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W,QAAA,iBAAiB,GAAmB;IAC/C,EAAE,EAAE,GAAG,+BAAmB,CAAC,EAAE,MAAM;IACnC,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEW,QAAA,oBAAoB,GAAmB;IAClD,EAAE,EAAE,GAAG,+BAAmB,CAAC,EAAE,SAAS;IACtC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AACF,kDAAkD;AAClD,oBAAoB;AACpB,iBAAiB;AACjB,wBAAwB;AACxB,4BAA4B;AAC5B,KAAK"}
1
+ {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,kDAA6C;AAC7C,yDAK8B;AAC9B,2CAOqB;AAGrB,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;AACnD,MAAM,iBAAiB,GAAG;IACxB,mDAAmD;IACnD,oBAAoB;CACrB,CAAC;AACF,MAAM,cAAc,GAA2B,CAAO,KAAa,EAAE,EAAE;IACrE,MAAM,MAAM,GAA+B,MAAM,eAAK,CAAC,GAAG,CAAC,kBAAM,GAAG,KAAK,EAAE;QACzE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO,IAAA,8BAAa,EAAC;YACnB,OAAO,EAAE,+BAAmB;YAC5B,KAAK,EAAE;gBACL;oBACE,MAAM,EAAE,CAAC;oBACT,SAAS,EAAE,KAAK;oBAChB,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,mBAAO;oBAChB,QAAQ,EAAE,mBAAO,CAAC,CAAC,CAAC,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@ -15,7 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
18
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
19
18
  const clients_1 = require("../../utils/clients");
20
19
  const constants_1 = require("./constants");
21
20
  const solana_1 = require("../../utils/solana");
@@ -25,31 +24,9 @@ const constants_2 = require("../meteora/constants");
25
24
  const slotTtl = 30000;
26
25
  let slot = null;
27
26
  let slotUpdate = 0;
27
+ const pricePerDbrToken = 0.025;
28
28
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
29
29
  const client = (0, clients_1.getClientSolana)();
30
- const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.escrowStruct, constants_1.dlmmVaultProgramId, [
31
- { dataSize: struct_1.escrowStruct.byteSize },
32
- {
33
- memcmp: {
34
- offset: 40,
35
- bytes: owner,
36
- },
37
- },
38
- // {
39
- // memcmp: {
40
- // offset: 8,
41
- // bytes: 'CGZvC5MWsu1bc3vRis619ZBEtvuPqoXrtBMeV9RrKFJp',
42
- // },
43
- // },
44
- // {
45
- // memcmp: {
46
- // offset: 96,
47
- // bytes: '1', // refunded === false
48
- // },
49
- // },
50
- ]);
51
- if (accounts.length === 0)
52
- return [];
53
30
  const vaults = yield cache.getItem(constants_2.dlmmVaultsKey, {
54
31
  prefix: constants_1.platformId,
55
32
  networkId: portfolio_core_1.NetworkId.solana,
@@ -62,6 +39,17 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
62
39
  }
63
40
  if (!slot)
64
41
  return [];
42
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.escrowStruct, constants_1.dlmmVaultProgramId, [
43
+ { dataSize: struct_1.escrowStruct.byteSize },
44
+ {
45
+ memcmp: {
46
+ offset: 40,
47
+ bytes: owner,
48
+ },
49
+ },
50
+ ]);
51
+ if (accounts.length === 0)
52
+ return [];
65
53
  const tokenPrices = yield cache.getTokenPricesAsMap(accounts
66
54
  .map((a) => {
67
55
  const v = vaults[a.dlmmVault.toString()];
@@ -69,70 +57,24 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
69
57
  })
70
58
  .flat(), portfolio_core_1.NetworkId.solana);
71
59
  const assets = [];
72
- accounts.forEach((escrow) => {
73
- if (!slot)
74
- return;
60
+ for (const escrow of accounts) {
75
61
  const vault = vaults[escrow.dlmmVault.toString()];
76
62
  if (!vault)
77
- return;
78
- // Vesting not started yet
79
- if (slot < Number(vault.startVestingSlot)) {
80
- const tpQuote = tokenPrices.get(vault.quoteMint);
81
- if (!tpQuote)
82
- return;
83
- assets.push((0, tokenPriceToAssetToken_1.default)(vault.quoteMint, new bignumber_js_1.default(escrow.totalDeposit)
84
- .div(Math.pow(10, tpQuote.decimals))
85
- .toNumber(), portfolio_core_1.NetworkId.solana, tpQuote, undefined, {}));
86
- }
87
- else {
88
- // Vesting started
89
- // If not refunded yet
90
- const filledRatio = new bignumber_js_1.default(vault.totalDeposit)
91
- .div(vault.maxCap)
92
- .toNumber();
93
- if (escrow.refunded === 0 && filledRatio > 1) {
94
- const tpQuote = tokenPrices.get(vault.quoteMint);
95
- if (!tpQuote)
96
- return;
97
- const amount = new bignumber_js_1.default(escrow.totalDeposit)
98
- .div(Math.pow(10, tpQuote.decimals))
99
- .times(1 - 1 / filledRatio)
100
- .toNumber();
101
- assets.push((0, tokenPriceToAssetToken_1.default)(vault.quoteMint, amount, portfolio_core_1.NetworkId.solana, tpQuote, undefined, {
102
- isClaimable: true,
103
- }));
104
- }
105
- const tpBase = tokenPrices.get(vault.baseMint);
106
- if (!tpBase)
107
- return;
108
- const shares = new bignumber_js_1.default(escrow.totalDeposit).div(vault.totalDeposit);
109
- const totalAmount = new bignumber_js_1.default(vault.boughtToken).times(shares);
110
- const remainingAmount = totalAmount.minus(escrow.claimedToken);
111
- if (remainingAmount.isZero())
112
- return;
113
- let claimableAmount = new bignumber_js_1.default(remainingAmount.toString());
114
- if (slot < Number(vault.endVestingSlot)) {
115
- const amountPerSlot = new bignumber_js_1.default(totalAmount).div(Number(vault.endVestingSlot) - Number(vault.startVestingSlot));
116
- let lastClaimedSlot = escrow.lastClaimedSlot.isZero()
117
- ? Number(vault.startVestingSlot)
118
- : escrow.lastClaimedSlot.toNumber();
119
- if (lastClaimedSlot > slot)
120
- lastClaimedSlot = slot;
121
- claimableAmount = amountPerSlot.times(Math.min(slot, Number(vault.endVestingSlot)) - lastClaimedSlot);
122
- }
123
- if (claimableAmount.isGreaterThan(0)) {
124
- assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, claimableAmount.div(Math.pow(10, tpBase.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tpBase, undefined, {
125
- isClaimable: true,
126
- }));
127
- }
128
- const vestingAmount = remainingAmount.minus(claimableAmount);
129
- if (vestingAmount.isGreaterThan(0)) {
130
- assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, vestingAmount.div(Math.pow(10, tpBase.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tpBase, undefined, {
131
- tags: ['Vesting'],
132
- }));
133
- }
134
- }
135
- });
63
+ continue;
64
+ const [quoteTokenPrice, baseTokenPrice] = [
65
+ tokenPrices.get(vault.quoteMint),
66
+ tokenPrices.get(vault.baseMint),
67
+ ];
68
+ if (!quoteTokenPrice)
69
+ continue;
70
+ const totalTokenEligible = escrow.totalDeposit
71
+ .dividedBy(Math.pow(10, quoteTokenPrice.decimals))
72
+ .dividedBy(pricePerDbrToken);
73
+ const remainingClaimableTokens = totalTokenEligible.minus(escrow.claimedToken.dividedBy(Math.pow(10, constants_1.dbrDecimals)));
74
+ if (remainingClaimableTokens.isLessThanOrEqualTo(0))
75
+ continue;
76
+ assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, remainingClaimableTokens.toNumber(), portfolio_core_1.NetworkId.solana, baseTokenPrice, undefined, { lockedUntil: 1744876800000 }));
77
+ }
136
78
  if (assets.length === 0)
137
79
  return [];
138
80
  return [
@@ -141,7 +83,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
141
83
  type: portfolio_core_1.PortfolioElementType.multiple,
142
84
  label: 'Vesting',
143
85
  platformId: constants_1.platformId,
144
- name: 'Alpha Vault',
86
+ name: 'LFG Vault',
145
87
  data: {
146
88
  assets,
147
89
  },
@@ -1 +1 @@
1
- {"version":3,"file":"dlmmVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/dlmmVaultsFetcher.ts"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,mBAAmB;;;;;;;;;;;;;;AAEnB,+DAKoC;AACpC,gEAAqC;AAGrC,iDAAsD;AACtD,2CAA6D;AAC7D,+CAA8D;AAC9D,qGAA6E;AAC7E,8CAAiD;AAEjD,oDAAqD;AAErD,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,IAAI,IAAI,GAAkB,IAAI,CAAC;AAC/B,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,qBAAY,EACZ,8BAAkB,EAClB;QACE,EAAE,QAAQ,EAAE,qBAAY,CAAC,QAAQ,EAAE;QACnC;YACE,MAAM,EAAE;gBACN,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,KAAK;aACb;SACF;QACD,IAAI;QACJ,cAAc;QACd,iBAAiB;QACjB,6DAA6D;QAC7D,OAAO;QACP,KAAK;QACL,IAAI;QACJ,cAAc;QACd,kBAAkB;QAClB,wCAAwC;QACxC,OAAO;QACP,KAAK;KACN,CACF,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MA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,MAAM,EAChB,cAAc,EACd,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B,CACF,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAClD;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -10,7 +10,7 @@ const dlmmVaultsJob_1 = __importDefault(require("./dlmmVaultsJob"));
10
10
  const dlmmVaultsFetcher_1 = __importDefault(require("./dlmmVaultsFetcher"));
11
11
  exports.platforms = [constants_1.platform];
12
12
  exports.jobs = [dlmmVaultsJob_1.default];
13
- exports.fetchers = [dlmmVaultsFetcher_1.default];
13
+ exports.fetchers = [dlmmVaultsFetcher_1.default, airdropFetcher_1.fetcher];
14
14
  exports.airdropFetchers = [
15
15
  airdropFetcher_1.airdropFetcherEvm,
16
16
  airdropFetcher_1.airdropFetcherSolana,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,qDAA2E;AAE3E,oEAA4C;AAC5C,4EAAoD;AAEvC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,uBAAa,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAc,CAAC,2BAAiB,CAAC,CAAC;AAC1C,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,qCAAoB;CACrB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,qDAI0B;AAE1B,oEAA4C;AAC5C,4EAAoD;AAEvC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,uBAAa,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAc,CAAC,2BAAiB,EAAE,wBAAO,CAAC,CAAC;AACnD,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,qCAAoB;CACrB,CAAC"}
@@ -12,7 +12,7 @@ export type Distribution = {
12
12
  distributionEndTimestamp: number;
13
13
  points: number;
14
14
  tokens: string;
15
- merkleTreeRoute: null;
15
+ merkleTreeRoute: string[];
16
16
  };
17
17
  export type Notification = {
18
18
  id: string;
@@ -25,7 +25,6 @@ const clients_1 = require("../../utils/clients");
25
25
  const struct_1 = require("./struct");
26
26
  const structs_1 = require("../save/structs");
27
27
  const constants_3 = require("../save/constants");
28
- const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
29
28
  const helpers_2 = require("../save/helpers");
30
29
  const MarginfiAccount_1 = require("../marginfi/structs/MarginfiAccount");
31
30
  const constants_4 = require("../marginfi/constants");
@@ -67,28 +66,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
67
66
  networkId: portfolio_core_1.NetworkId.solana,
68
67
  });
69
68
  if (reservesInfos.length !== 0) {
70
- const mints = [];
71
- const pythAddresses = [];
72
69
  const reserveByAddress = new Map();
73
70
  reservesInfos.forEach((reserve) => {
74
71
  if (!reserve)
75
72
  return;
76
- pythAddresses.push(new web3_js_1.PublicKey(reserve.reserve.liquidity.pythOracle));
77
- mints.push(reserve.reserve.liquidity.mintPubkey);
78
73
  reserveByAddress.set(reserve.pubkey, reserve);
79
74
  });
80
- const [pythAccounts, tokenPriceByAddress] = yield Promise.all([
81
- (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, pythAddresses),
82
- cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
83
- ]);
84
- const pythAccByAddress = new Map();
85
- for (let i = 0; i < pythAddresses.length; i++) {
86
- const account = pythAccounts[i];
87
- if (account === null)
88
- continue;
89
- pythAccByAddress.set(pythAddresses[i].toString(), account);
90
- }
91
- const solendElements = (0, helpers_2.getElementsFromObligations)([saveObligation], reserveByAddress, new Map([[constants_3.mainMarket, mainMarketInfo]]), tokenPriceByAddress, pythAccByAddress);
75
+ const solendElements = yield (0, helpers_2.getElementsFromObligations)([saveObligation], reserveByAddress, new Map([[constants_3.mainMarket, mainMarketInfo]]), owner, cache);
92
76
  portfolioElements.push(...solendElements);
93
77
  }
94
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAAyC;AACzC,uCAA8C;AAC9C,+EAA4D;AAC5D,0EAA8D;AAC9D,mFAA6D;AAC7D,mDAA2D;AAC3D,kFAA+E;AAC/E,iDAAsD;AACtD,qCAA6C;AAC7C,6CAAmD;AACnD,iDAA8E;AAE9E,gGAA6F;AAC7F,6CAA6D;AAC7D,yEAA4E;AAG5E,qDAA2D;AAC3D,iDAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,GAAG,GAA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9C,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,UAAU,CAAC,IAAI;YACb,UAAU,CAAC,UAAU,KAAK,gCAAoB,CAAC,EAAE;gBAC/C,CAAC,CAAC,gBAAgB;gBAClB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;oBAC/C,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,UAAU,CAAC,UAAU,GAAG,sBAAU,CAAC;QACnC,QAAQ,CAAC,IAAI,mBACR,UAAU,EACb,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -19,6 +19,7 @@ exports.leverageVaultsMints = [
19
19
  '27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4', // JLP
20
20
  'jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v', // JupSOL
21
21
  'vSoLxydx6akxyMD9XEcPvGYNGq6Nn66oqVb3UkGkei7', // vSOL
22
+ 'sSo14endRuUbvQaJS3dq36Q829a3A6BEfoeeRGJywEh', // sSOL
22
23
  ];
23
24
  exports.nxfinanceLeverageIdlItem = {
24
25
  programId: exports.leverageFiProgramID.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,+CAAqD;AACrD,uCAA6C;AAEhC,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,gCAAgC;IACzC,WAAW,EAAE,YAAY,EAAE,sCAAsC;CAClE,CAAC;AAEW,QAAA,EAAE,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,8CAA8C,EAAE,MAAM;IACtD,6CAA6C,EAAE,SAAS;IACxD,6CAA6C,EAAE,OAAO;CACvD,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,2BAAmB,CAAC,QAAQ,EAAE;IACzC,GAAG,EAAE,kCAAoB;IACzB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,0BAAgB;IACrB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,cAAc,GAAG,eAAe,CAAC;AAEjC,QAAA,YAAY,GAAG;IAC1B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,+CAAqD;AACrD,uCAA6C;AAEhC,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,gCAAgC;IACzC,WAAW,EAAE,YAAY,EAAE,sCAAsC;CAClE,CAAC;AAEW,QAAA,EAAE,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,8CAA8C,EAAE,MAAM;IACtD,6CAA6C,EAAE,SAAS;IACxD,6CAA6C,EAAE,OAAO;IACtD,6CAA6C,EAAE,OAAO;CACvD,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,2BAAmB,CAAC,QAAQ,EAAE;IACzC,GAAG,EAAE,kCAAoB;IACzB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,0BAAgB;IACrB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,cAAc,GAAG,eAAe,CAAC;AAEjC,QAAA,YAAY,GAAG;IAC1B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC"}
@@ -48,7 +48,6 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
48
48
  name: `JLP Leverage x${new bignumber_js_1.default(marginAccount.leverage)
49
49
  .dividedBy(100)
50
50
  .decimalPlaces(2)}`,
51
- leveraged: true,
52
51
  });
53
52
  marginAccount.deposits.forEach((deposit) => {
54
53
  const marginPool = marginPools.find((mp) => (mp === null || mp === void 0 ? void 0 : mp.tokenMint) === deposit.tokenMint);
@@ -61,6 +60,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
61
60
  amount,
62
61
  };
63
62
  if (constants_1.leverageVaultsMints.includes(deposit.tokenMint)) {
63
+ asset.amount = asset.amount
64
+ .multipliedBy(marginAccount.leverage)
65
+ .dividedBy(100);
64
66
  elementBorrowlend.addSuppliedAsset(asset);
65
67
  }
66
68
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,uCAAiE;AACjE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,mBAAS,CAAC,sBAAsB,CAC7D;QACE,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,cAAE,CAAC,QAAQ,EAAE,CAAC,EACf,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACf,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KACvB,EACD,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC;IAEL,MAAM,aAAa,GAAG,CACpB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,oCAAwB,EACxB,CAAC,sBAAsB,CAAC,CACzB,CACF,CAAC,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9D,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,C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0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,uCAAiE;AACjE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,mBAAS,CAAC,sBAAsB,CAC7D;QACE,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,cAAE,CAAC,QAAQ,EAAE,CAAC,EACf,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACf,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KACvB,EACD,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC;IAEL,MAAM,aAAa,GAAG,CACpB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,oCAAwB,EACxB,CAAC,sBAAsB,CAAC,CACzB,CACF,CAAC,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9D,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SA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CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  import { Platform } from '@sonarwatch/portfolio-core';
3
3
  export declare const platformId = "save";
4
+ export declare const platformDumpyId = "dumpy";
4
5
  export declare const platform: Platform;
6
+ export declare const platformDumpy: Platform;
5
7
  export declare const marketsPrefix = "save-markets";
6
8
  export declare const marketsKey = "markets";
7
9
  export declare const reservesPrefix = "save-reserves";
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slndMint = exports.externalRewardStatsEndpoint = exports.rewardProofsEndpoint = exports.mainMarket = exports.wadsDecimal = exports.reserveEndpoint = exports.marketsEndpoint = exports.merkleProgramId = exports.pid = exports.rewardStatsKey = exports.rewardStatsPrefix = exports.reservesPrefix = exports.marketsKey = exports.marketsPrefix = exports.platform = exports.platformId = void 0;
3
+ exports.slndMint = exports.externalRewardStatsEndpoint = exports.rewardProofsEndpoint = exports.mainMarket = exports.wadsDecimal = exports.reserveEndpoint = exports.marketsEndpoint = exports.merkleProgramId = exports.pid = exports.rewardStatsKey = exports.rewardStatsPrefix = exports.reservesPrefix = exports.marketsKey = exports.marketsPrefix = exports.platformDumpy = exports.platform = exports.platformDumpyId = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'save';
6
+ exports.platformDumpyId = 'dumpy';
6
7
  exports.platform = {
7
8
  id: exports.platformId,
8
9
  name: 'Save',
@@ -10,6 +11,13 @@ exports.platform = {
10
11
  defiLlamaId: 'save',
11
12
  website: 'https://save.finance/',
12
13
  };
14
+ exports.platformDumpy = {
15
+ id: exports.platformDumpyId,
16
+ name: 'Dumpy',
17
+ image: 'https://sonar.watch/img/platforms/dumpy.webp',
18
+ // defiLlamaId: 'dumpy',
19
+ website: 'https://dumpy.fun/',
20
+ };
13
21
  exports.marketsPrefix = `${exports.platformId}-markets`;
14
22
  exports.marketsKey = 'markets';
15
23
  exports.reservesPrefix = `${exports.platformId}-reserves`;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,uBAAuB;CACjC,CAAC;AACW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,cAAc,GAAG,GAAG,kBAAU,WAAW,CAAC;AAC1C,QAAA,iBAAiB,GAAG,GAAG,kBAAU,eAAe,CAAC;AACjD,QAAA,cAAc,GAAG,cAAc,CAAC;AAEhC,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AACnE,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,6CAA6C,CAC9C,CAAC;AACW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAChE,QAAA,eAAe,GAAG,4CAA4C,CAAC;AAC/D,QAAA,WAAW,GAAG,EAAE,CAAC;AACjB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAC5D,QAAA,oBAAoB,GAC/B,qEAAqE,CAAC;AAC3D,QAAA,2BAA2B,GACtC,8EAA8E,CAAC;AAEpE,QAAA,QAAQ,GAAG,6CAA6C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,eAAe,GAAG,OAAO,CAAC;AAE1B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,uBAAuB;CACjC,CAAC;AAEW,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,wBAAwB;IACxB,OAAO,EAAE,oBAAoB;CAC9B,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,cAAc,GAAG,GAAG,kBAAU,WAAW,CAAC;AAC1C,QAAA,iBAAiB,GAAG,GAAG,kBAAU,eAAe,CAAC;AACjD,QAAA,cAAc,GAAG,cAAc,CAAC;AAEhC,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AACnE,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,6CAA6C,CAC9C,CAAC;AACW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAChE,QAAA,eAAe,GAAG,4CAA4C,CAAC;AAC/D,QAAA,WAAW,GAAG,EAAE,CAAC;AACjB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAC5D,QAAA,oBAAoB,GAC/B,qEAAqE,CAAC;AAC3D,QAAA,2BAA2B,GACtC,8EAA8E,CAAC;AAEpE,QAAA,QAAQ,GAAG,6CAA6C,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" />
2
- import { PortfolioElement, TokenPrice } from '@sonarwatch/portfolio-core';
3
- import { AccountInfo } from '@solana/web3.js';
2
+ import { PortfolioElement } from '@sonarwatch/portfolio-core';
4
3
  import { Obligation } from './structs';
5
4
  import { ParsedAccount } from '../../utils/solana';
6
5
  import { MarketInfo, ReserveInfo } from './types';
6
+ import { Cache } from '../../Cache';
7
7
  export declare const upperFirst: (string: string) => string;
8
8
  export declare function getObligationSeed(marketAddress: string, accountId: number): string;
9
9
  export declare const parseDataflat: (dataFlat: Buffer, depositsLen: number, borrowsLen: number) => {
@@ -12,4 +12,4 @@ export declare const parseDataflat: (dataFlat: Buffer, depositsLen: number, borr
12
12
  borrows: import("./structs").ObligationLiquidity[];
13
13
  borrowsMap: Map<string, import("./structs").ObligationLiquidity>;
14
14
  };
15
- export declare function getElementsFromObligations(obligations: ParsedAccount<Obligation>[], reserveByAddress: Map<string, ReserveInfo>, marketByAddress: Map<string, MarketInfo>, tokenPriceByAddress: Map<string, TokenPrice>, pythAccountByAddress: Map<string, AccountInfo<Buffer>>): PortfolioElement[];
15
+ export declare function getElementsFromObligations(obligations: ParsedAccount<Obligation>[], reserveByAddress: Map<string, ReserveInfo>, marketByAddress: Map<string, MarketInfo>, owner: string, cache: Cache): Promise<PortfolioElement[]>;
@@ -1,4 +1,13 @@
1
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
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -6,10 +15,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
15
  exports.getElementsFromObligations = exports.parseDataflat = exports.getObligationSeed = exports.upperFirst = void 0;
7
16
  const beet_1 = require("@metaplex-foundation/beet");
8
17
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
18
+ const web3_js_1 = require("@solana/web3.js");
9
19
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
10
20
  const structs_1 = require("./structs");
11
21
  const constants_1 = require("./constants");
12
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
13
23
  const upperFirst = (string) => string ? string.charAt(0).toUpperCase() + string.slice(1) : '';
14
24
  exports.upperFirst = upperFirst;
15
25
  function getObligationSeed(marketAddress, accountId) {
@@ -34,132 +44,123 @@ const parseDataflat = (dataFlat, depositsLen, borrowsLen) => {
34
44
  };
35
45
  };
36
46
  exports.parseDataflat = parseDataflat;
37
- function getElementsFromObligations(obligations, reserveByAddress, marketByAddress, tokenPriceByAddress, pythAccountByAddress) {
38
- const elements = [];
39
- for (let i = 0; i < obligations.length; i += 1) {
40
- const obligation = obligations[i];
41
- if (!obligation)
42
- continue;
43
- const market = marketByAddress.get(obligation.lendingMarket.toString());
44
- if (!market)
45
- continue;
46
- const { depositsMap, borrowsMap } = (0, exports.parseDataflat)(obligation.dataFlat, obligation.depositsLen, obligation.borrowsLen);
47
- if (depositsMap.size === 0 && borrowsMap.size === 0)
48
- continue;
49
- const borrowedAssets = [];
50
- const borrowedYields = [];
51
- const suppliedAssets = [];
52
- const suppliedYields = [];
53
- const rewardAssets = [];
54
- const suppliedLtvs = [];
55
- const borrowedWeights = [];
56
- for (let j = 0; j < market.reserves.length; j += 1) {
57
- const { address: reserveAddress } = market.reserves[j];
58
- const reserveInfo = reserveByAddress.get(reserveAddress);
59
- if (!reserveInfo)
47
+ function getElementsFromObligations(obligations, reserveByAddress, marketByAddress, owner, cache) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const obligationAddressesRelatedToSavePlatform = yield getObligationAddressesRelatedToSavePlatform(owner, marketByAddress);
50
+ const elementRegistrySave = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
51
+ const elementRegistryDumpy = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformDumpyId);
52
+ for (let i = 0; i < obligations.length; i += 1) {
53
+ const obligation = obligations[i];
54
+ if (!obligation)
60
55
  continue;
61
- const { reserve } = reserveInfo;
62
- const { liquidity, collateral } = reserve;
63
- const lMint = liquidity.mintPubkey;
64
- const lTokenPrice = tokenPriceByAddress.get(lMint);
65
- let price;
66
- if (!lTokenPrice) {
56
+ const market = marketByAddress.get(obligation.lendingMarket.toString());
57
+ if (!market)
67
58
  continue;
68
- // const pythOracle = new PublicKey(reserve.liquidity.pythOracle);
69
- // const pythAccount = pythAccountByAddress.get(pythOracle.toString());
70
- // console.log('Account', pythAccount?.data.byteLength);
71
- // const pythPrice = pythAccount
72
- // ? parsePriceData(pythAccount.data)
73
- // : undefined;
74
- // if (pythPrice) price = pythPrice.price;
75
- }
76
- const decimals = liquidity.mintDecimals;
77
- const reserveBorrowAmount = new bignumber_js_1.default(liquidity.borrowedAmountWads)
78
- .dividedBy(Math.pow(10, (constants_1.wadsDecimal + decimals)))
79
- .toNumber();
80
- const reserveAvailableAmount = new bignumber_js_1.default(liquidity.availableAmount)
81
- .dividedBy(Math.pow(10, decimals))
82
- .toNumber();
83
- const collateralSupply = new bignumber_js_1.default(collateral.mintTotalSupply)
84
- .dividedBy(Math.pow(10, decimals))
85
- .toNumber();
86
- const reserveDepositAmount = reserveBorrowAmount + reserveAvailableAmount;
87
- // Deposit
88
- const deposit = depositsMap.get(reserveAddress);
89
- if (deposit) {
90
- if (!deposit.depositedAmount.isZero()) {
91
- const suppliedAmount = deposit.depositedAmount
92
- .div(Math.pow(10, decimals))
93
- .times(reserveDepositAmount / collateralSupply)
94
- .toNumber();
95
- suppliedLtvs.push(reserve.config.liquidationThreshold / 100);
96
- const apy = +reserveInfo.rates.supplyInterest / 100;
97
- const cSuppliedYields = [
98
- {
99
- apr: (0, portfolio_core_1.apyToApr)(apy),
100
- apy,
101
- },
102
- ];
103
- suppliedYields.push(cSuppliedYields);
104
- suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(lMint, suppliedAmount, portfolio_core_1.NetworkId.solana, lTokenPrice, price));
59
+ const { depositsMap, borrowsMap } = (0, exports.parseDataflat)(obligation.dataFlat, obligation.depositsLen, obligation.borrowsLen);
60
+ if (depositsMap.size === 0 && borrowsMap.size === 0)
61
+ continue;
62
+ const element = (obligationAddressesRelatedToSavePlatform === null || obligationAddressesRelatedToSavePlatform === void 0 ? void 0 : obligationAddressesRelatedToSavePlatform.includes(obligation.pubkey.toString()))
63
+ ? elementRegistrySave.addElementBorrowlend({
64
+ label: 'Lending',
65
+ })
66
+ : elementRegistryDumpy.addElementBorrowlend({
67
+ label: 'Lending',
68
+ });
69
+ for (let j = 0; j < market.reserves.length; j += 1) {
70
+ const { address: reserveAddress } = market.reserves[j];
71
+ const reserveInfo = reserveByAddress.get(reserveAddress);
72
+ if (!reserveInfo)
73
+ continue;
74
+ const { reserve } = reserveInfo;
75
+ const { liquidity, collateral } = reserve;
76
+ const lMint = liquidity.mintPubkey;
77
+ const decimals = liquidity.mintDecimals;
78
+ const reserveBorrowAmount = new bignumber_js_1.default(liquidity.borrowedAmountWads)
79
+ .dividedBy(Math.pow(10, (constants_1.wadsDecimal + decimals)))
80
+ .toNumber();
81
+ const reserveAvailableAmount = new bignumber_js_1.default(liquidity.availableAmount)
82
+ .dividedBy(Math.pow(10, decimals))
83
+ .toNumber();
84
+ const collateralSupply = new bignumber_js_1.default(collateral.mintTotalSupply)
85
+ .dividedBy(Math.pow(10, decimals))
86
+ .toNumber();
87
+ const reserveDepositAmount = reserveBorrowAmount + reserveAvailableAmount;
88
+ // Deposit
89
+ const deposit = depositsMap.get(reserveAddress);
90
+ if (deposit) {
91
+ if (!deposit.depositedAmount.isZero()) {
92
+ const suppliedAmount = deposit.depositedAmount
93
+ .div(Math.pow(10, decimals))
94
+ .times(reserveDepositAmount / collateralSupply)
95
+ .toNumber();
96
+ element.addSuppliedLtv(reserve.config.liquidationThreshold / 100);
97
+ const apy = +reserveInfo.rates.supplyInterest / 100;
98
+ const cSuppliedYields = [
99
+ {
100
+ apr: (0, portfolio_core_1.apyToApr)(apy),
101
+ apy,
102
+ },
103
+ ];
104
+ element.addSuppliedYield(cSuppliedYields);
105
+ element.addSuppliedAsset({
106
+ address: lMint,
107
+ amount: suppliedAmount,
108
+ alreadyShifted: true,
109
+ });
110
+ }
105
111
  }
106
- }
107
- // Borrow
108
- const borrow = borrowsMap.get(reserveAddress);
109
- if (borrow) {
110
- if (!borrow.borrowedAmountWads.isZero()) {
111
- const borrowedAmount = borrow.borrowedAmountWads
112
- .times(new bignumber_js_1.default(liquidity.cumulativeBorrowRateWads))
113
- .div(borrow.cumulativeBorrowRateWads)
114
- .dividedBy(new bignumber_js_1.default(Math.pow(10, (constants_1.wadsDecimal + decimals))))
115
- .toNumber();
116
- borrowedWeights.push(new bignumber_js_1.default(reserve.config.addedBorrowWeightBPS)
117
- .dividedBy(Math.pow(10, 4))
118
- .plus(1)
119
- .toNumber());
120
- const apy = +reserveInfo.rates.borrowInterest / 100;
121
- const cBorrowedYields = [
122
- {
123
- apr: -(0, portfolio_core_1.apyToApr)(apy),
124
- apy: -apy,
125
- },
126
- ];
127
- borrowedYields.push(cBorrowedYields);
128
- borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(lMint, borrowedAmount, portfolio_core_1.NetworkId.solana, lTokenPrice, price));
112
+ // Borrow
113
+ const borrow = borrowsMap.get(reserveAddress);
114
+ if (borrow) {
115
+ if (!borrow.borrowedAmountWads.isZero()) {
116
+ const borrowedAmount = borrow.borrowedAmountWads
117
+ .times(new bignumber_js_1.default(liquidity.cumulativeBorrowRateWads))
118
+ .div(borrow.cumulativeBorrowRateWads)
119
+ .dividedBy(new bignumber_js_1.default(Math.pow(10, (constants_1.wadsDecimal + decimals))))
120
+ .toNumber();
121
+ element.addBorrowedWeight(new bignumber_js_1.default(reserve.config.addedBorrowWeightBPS)
122
+ .dividedBy(Math.pow(10, 4))
123
+ .plus(1)
124
+ .toNumber());
125
+ const apy = +reserveInfo.rates.borrowInterest / 100;
126
+ const cBorrowedYields = [
127
+ {
128
+ apr: -(0, portfolio_core_1.apyToApr)(apy),
129
+ apy: -apy,
130
+ },
131
+ ];
132
+ element.addBorrowedYield(cBorrowedYields);
133
+ element.addSuppliedAsset({
134
+ address: lMint,
135
+ amount: borrowedAmount,
136
+ alreadyShifted: true,
137
+ });
138
+ }
129
139
  }
130
140
  }
131
141
  }
132
- if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
133
- continue;
134
- const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
135
- suppliedAssets,
136
- borrowedAssets,
137
- rewardAssets,
138
- suppliedLtvs,
139
- borrowedWeights,
140
- });
141
- elements.push({
142
- type: portfolio_core_1.PortfolioElementType.borrowlend,
143
- networkId: portfolio_core_1.NetworkId.solana,
144
- platformId: constants_1.platformId,
145
- label: 'Lending',
146
- value,
147
- name: market.name,
148
- data: {
149
- borrowedAssets,
150
- borrowedValue,
151
- borrowedYields,
152
- suppliedAssets,
153
- suppliedValue,
154
- suppliedYields,
155
- healthRatio,
156
- rewardAssets,
157
- rewardValue,
158
- value,
159
- },
160
- });
161
- }
162
- return elements;
142
+ const dumpyElements = yield elementRegistryDumpy.getElements(cache);
143
+ const saveElements = yield elementRegistrySave.getElements(cache);
144
+ return [...dumpyElements, ...saveElements];
145
+ });
163
146
  }
164
147
  exports.getElementsFromObligations = getElementsFromObligations;
148
+ const getObligationAddressesRelatedToSavePlatform = (owner, marketsByAddress) => __awaiter(void 0, void 0, void 0, function* () {
149
+ const obligationAddressesRelatedToSavePlatform = [];
150
+ for (const marketInfo of marketsByAddress.values()) {
151
+ if (!marketInfo)
152
+ continue;
153
+ const seeds = [
154
+ getObligationSeed(marketInfo.address, 0),
155
+ getObligationSeed(marketInfo.address, 1),
156
+ getObligationSeed(marketInfo.address, 2),
157
+ ];
158
+ for (let i = 0; i < seeds.length; i += 1) {
159
+ const seed = seeds[i];
160
+ const obligationAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), seed, constants_1.pid);
161
+ obligationAddressesRelatedToSavePlatform.push(obligationAddress.toString());
162
+ }
163
+ }
164
+ return obligationAddressesRelatedToSavePlatform;
165
+ });
165
166
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkE;AAClE,+DASoC;AAEpC,gEAAqC;AACrC,uCAImB;AAGnB,2CAAsD;AACtD,qGAA6E;AAGtE,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE,CAC3C,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AADpD,QAAA,UAAU,cAC0C;AAEjE,SAAgB,iBAAiB,CAAC,aAAqB,EAAE,SAAiB;IACxE,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,2EAA2E;IAC3E,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAJD,8CAIC;AAEM,MAAM,aAAa,GAAG,CAC3B,QAAgB,EAChB,WAAmB,EACnB,UAAkB,EAClB,EAAE;IACF,MAAM,yBAAyB,GAAG,IAAA,4BAAqB,EACrD,oCAA0B,EAC1B,WAAW,CACZ,CAAC;IACF,MAAM,QAAQ,GAAG,yBAAyB,CAAC,IAAI,CAAC,QAAQ,E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Ac,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC;YACtB,cAAc;YACd,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,eAAe;SAChB,CAAC,CAAC;QAEL,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,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;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AApKD,gEAoKC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAkE;AAClE,+DAKoC;AACpC,6CAA4C;AAC5C,gEAAqC;AACrC,uCAImB;AAGnB,2CAA4E;AAC5E,gFAA6E;AAGtE,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE,CAC3C,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AADpD,QAAA,UAAU,cAC0C;AAEjE,SAAgB,iBAAiB,CAAC,aAAqB,EAAE,SAAiB;IACxE,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC,K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AI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,iBAAiB,GAAG,MAAM,mBAAS,CAAC,cAAc,CACtD,IAAI,mBAAS,CAAC,KAAK,CAAC,EACpB,IAAI,EACJ,eAAG,CACJ,CAAC;YACF,wCAAwC,CAAC,IAAI,CAC3C,iBAAiB,CAAC,QAAQ,EAAE,CAC7B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,wCAAwC,CAAC;AAClD,CAAC,CAAA,CAAC"}
@@ -11,7 +11,7 @@ const constants_1 = require("./constants");
11
11
  const rewardsFetcher_1 = __importDefault(require("./rewardsFetcher"));
12
12
  const rewardStatsJob_1 = __importDefault(require("./rewardStatsJob"));
13
13
  const token2022wrapperJob_1 = __importDefault(require("./token2022wrapperJob"));
14
- exports.platforms = [constants_1.platform];
14
+ exports.platforms = [constants_1.platform, constants_1.platformDumpy];
15
15
  exports.jobs = [
16
16
  marketsJob_1.default,
17
17
  reservesJob_1.default,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,8DAAsC;AACtC,8EAAqD;AACrD,2CAAuC;AACvC,sEAA8C;AAC9C,sEAA8C;AAC9C,gFAAwD;AAE3C,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU;IACzB,oBAAU;IACV,qBAAW;IACX,wBAAc;IACd,6BAAmB;CACpB,CAAC;AACW,QAAA,QAAQ,GAAc,CAAC,4BAAiB,EAAE,wBAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,8DAAsC;AACtC,8EAAqD;AACrD,2CAAsD;AACtD,sEAA8C;AAC9C,sEAA8C;AAC9C,gFAAwD;AAE3C,QAAA,SAAS,GAAe,CAAC,oBAAQ,EAAE,yBAAa,CAAC,CAAC;AAClD,QAAA,IAAI,GAAU;IACzB,oBAAU;IACV,qBAAW;IACX,wBAAc;IACd,6BAAmB;CACpB,CAAC;AACW,QAAA,QAAQ,GAAc,CAAC,4BAAiB,EAAE,wBAAc,CAAC,CAAC"}
@@ -10,16 +10,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
- const web3_js_1 = require("@solana/web3.js");
14
13
  const constants_1 = require("./constants");
15
14
  const helpers_1 = require("./helpers");
16
15
  const solana_1 = require("../../utils/solana");
17
16
  const clients_1 = require("../../utils/clients");
18
17
  const structs_1 = require("./structs");
19
- const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
20
18
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
21
19
  const client = (0, clients_1.getClientSolana)();
22
- const obligationAddresses = [];
20
+ const obligationsRaw = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.obligationStruct, constants_1.pid, [
21
+ {
22
+ dataSize: 1300,
23
+ },
24
+ {
25
+ memcmp: {
26
+ offset: 42,
27
+ bytes: owner,
28
+ },
29
+ },
30
+ ]);
31
+ if (!obligationsRaw.length)
32
+ return [];
23
33
  const markets = yield cache.getItem(constants_1.marketsKey, {
24
34
  prefix: constants_1.platformId,
25
35
  networkId: portfolio_core_1.NetworkId.solana,
@@ -31,23 +41,6 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
31
41
  if (market)
32
42
  marketsByAddress.set(market.address.toString(), market);
33
43
  });
34
- for (const marketInfo of marketsByAddress.values()) {
35
- if (!marketInfo)
36
- continue;
37
- const seeds = [
38
- (0, helpers_1.getObligationSeed)(marketInfo.address, 0),
39
- (0, helpers_1.getObligationSeed)(marketInfo.address, 1),
40
- (0, helpers_1.getObligationSeed)(marketInfo.address, 2),
41
- ];
42
- for (let i = 0; i < seeds.length; i += 1) {
43
- const seed = seeds[i];
44
- const obligationAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), seed, constants_1.pid);
45
- obligationAddresses.push(obligationAddress);
46
- }
47
- }
48
- const obligationsRaw = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
49
- if (obligationsRaw.length === 0)
50
- return [];
51
44
  const obligations = [];
52
45
  const reserveAddresses = new Set();
53
46
  obligationsRaw.forEach((obligation) => {
@@ -70,25 +63,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
70
63
  if (!reservesInfos)
71
64
  return [];
72
65
  const reserveByAddress = new Map();
73
- const mints = new Set();
74
- const pythAddresses = [];
75
66
  reservesInfos.forEach((reserveInfo) => {
76
67
  if (!reserveInfo)
77
68
  return;
78
- mints.add(reserveInfo.reserve.liquidity.mintPubkey);
79
69
  reserveByAddress.set(reserveInfo.pubkey, reserveInfo);
80
- pythAddresses.push(new web3_js_1.PublicKey(reserveInfo.reserve.liquidity.pythOracle));
81
70
  });
82
- const tokenPriceByAddress = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
83
- const pythAccounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, pythAddresses);
84
- const pythAccByAddress = new Map();
85
- for (let i = 0; i < pythAddresses.length; i++) {
86
- const account = pythAccounts[i];
87
- if (account === null)
88
- continue;
89
- pythAccByAddress.set(pythAddresses[i].toString(), account);
90
- }
91
- return (0, helpers_1.getElementsFromObligations)(obligations, reserveByAddress, marketsByAddress, tokenPriceByAddress, pythAccByAddress);
71
+ return (0, helpers_1.getElementsFromObligations)(obligations, reserveByAddress, marketsByAddress, owner, cache);
92
72
  });
93
73
  const fetcher = {
94
74
  id: `${constants_1.platformId}-obligations`,
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","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;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA0E;AAC1E,uCAAuD;AAEvD,+CAA6E;AAC7E,iDAAsD;AACtD,uCAAyD;AAEzD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAwB,EACnD,MAAM,EACN,0BAAgB,EAChB,eAAG,EACH;QACE;YACE,QAAQ,EAAE,IAAI;SACf;QACD;YACE,MAAM,EAAE;gBACN,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,KAAK;aACb;SACF;KACF,CACF,CAAC;IAEF,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QAC5D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,MAAM;YAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,G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,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -75,7 +75,6 @@ class ElementBorrowlendBuilder extends ElementBuilder_1.ElementBuilder {
75
75
  ? this.borrowedWeights
76
76
  : undefined,
77
77
  unsettledAssets,
78
- leveraged: this.leveraged,
79
78
  });
80
79
  if (!suppliedValue && !borrowedValue && !rewardValue)
81
80
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ElementBorrowlendBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBorrowlendBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AACpC,qDAAkD;AAClD,iDAA8C;AAK9C,MAAa,wBAAyB,SAAQ,+BAAc;IAU1D,YAAY,MAAqB;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,gBAAgB,CAAC,MAA4B;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,gBAAgB,CAAC,MAA4B;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,cAAc,CAAC,MAA4B;QACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IA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AE,OAAO,IAAI,CAAC;QAElE,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS;YACT,UAAU;YACV,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,SAAS,EAAE;oBACT,MAAM,EAAE,eAAe;oBACvB,KAAK,EAAE,cAAc;iBACtB;gBACD,KAAK;aACN;YACD,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,OAAO,OAA2B,CAAC;IACrC,CAAC;CACF;AA9ID,4DA8IC"}
1
+ {"version":3,"file":"ElementBorrowlendBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBorrowlendBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AACpC,qDAAkD;AAClD,iDAA8C;AAK9C,MAAa,wBAAyB,SAAQ,+BAAc;IAU1D,YAAY,MAAqB;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,gBAAgB,CAAC,MAA4B;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,C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AAe,EACb,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM;gBACnD,CAAC,CAAC,IAAI,CAAC,eAAe;gBACtB,CAAC,CAAC,SAAS;YACf,eAAe;SAChB,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAElE,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS;YACT,UAAU;YACV,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,SAAS,EAAE;oBACT,MAAM,EAAE,eAAe;oBACvB,KAAK,EAAE,cAAc;iBACtB;gBACD,KAAK;aACN;YACD,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,OAAO,OAA2B,CAAC;IACrC,CAAC;CACF;AA7ID,4DA6IC"}
@@ -6,7 +6,6 @@ export declare abstract class ElementBuilder {
6
6
  readonly label: PortfolioElementLabel;
7
7
  readonly name?: string;
8
8
  readonly tags?: string[];
9
- readonly leveraged?: boolean;
10
9
  protected constructor(params: ElementParams);
11
10
  abstract mints(): string[];
12
11
  abstract get(networkId: NetworkIdType, platformId: string, tokenPrices: TokenPriceMap): PortfolioElement | null;
@@ -7,7 +7,6 @@ class ElementBuilder {
7
7
  this.label = params.label;
8
8
  this.name = params.name;
9
9
  this.tags = params.tags;
10
- this.leveraged = params.leveraged;
11
10
  }
12
11
  }
13
12
  exports.ElementBuilder = ElementBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"ElementBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBuilder.ts"],"names":[],"mappings":";;;AASA,MAAsB,cAAc;IAOlC,YAAsB,MAAqB;QACzC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACpC,CAAC;CASF;AAtBD,wCAsBC"}
1
+ {"version":3,"file":"ElementBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBuilder.ts"],"names":[],"mappings":";;;AASA,MAAsB,cAAc;IAMlC,YAAsB,MAAqB;QACzC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CASF;AApBD,wCAoBC"}
@@ -4,5 +4,4 @@ export type ElementParams = {
4
4
  label: PortfolioElementLabel;
5
5
  name?: string;
6
6
  tags?: string[];
7
- leveraged?: boolean;
8
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ElementRegistry.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAMoC;AAIpC,qEAAkE;AAClE,uEAAoE;AACpE,yEAAsE;AACtE,qEAAkE;AAElE,MAAa,eAAe;IAK1B,YAAY,SAAwB,EAAE,UAAkB;QACtD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU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,CAAC;YAE3E,OAAO,IAAI,CAAC,QAAQ;iBACjB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;iBAC/D,MAAM,CACL,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CACtB,CAAC;QAC5B,CAAC;KAAA;CACF;AAhED,0CAgEC"}
1
+ {"version":3,"file":"ElementRegistry.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAIoC;AAIpC,qEAAkE;AAClE,uEAAoE;AACpE,yEAAsE;AACtE,qEAAkE;AAElE,MAAa,eAAe;IAK1B,YAAY,SAAwB,EAAE,UAAkB;QACtD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IACD,kBAAkB,CAChB,MAAmC;QAEnC,MAAM,cAAc,GAAG,IAAI,+CAAsB,iBAC/C,IAAI,EAAE,qCAAoB,CAAC,QAAQ,IAChC,MAAM,EACT,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,mBAAmB,CACjB,MAAmC;QAEnC,MAAM,cAAc,GAAG,IAAI,iDAAuB,iBAChD,IAAI,EAAE,qCAAoB,CAAC,SAAS,IACjC,MAAM,EACT,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,oBAAoB,CAClB,MAAmC;QAEnC,MAA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