@sonarwatch/portfolio-plugins 0.14.152 → 0.14.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +2232 -2228
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/balancer/helpers/pools.js +21 -21
  5. package/src/plugins/drift/spotMarketsJob.js +0 -1
  6. package/src/plugins/drift/spotMarketsJob.js.map +1 -1
  7. package/src/plugins/ensofi/index.js +2 -1
  8. package/src/plugins/ensofi/index.js.map +1 -1
  9. package/src/plugins/ensofi/solanaLoansJob.d.ts +3 -0
  10. package/src/plugins/ensofi/solanaLoansJob.js +63 -0
  11. package/src/plugins/ensofi/solanaLoansJob.js.map +1 -0
  12. package/src/plugins/ensofi/structs.js +2 -2
  13. package/src/plugins/ensofi/structs.js.map +1 -1
  14. package/src/plugins/kamino/reservesJob.js +35 -0
  15. package/src/plugins/kamino/reservesJob.js.map +1 -1
  16. package/src/plugins/loopscale/constants.d.ts +2 -3
  17. package/src/plugins/loopscale/constants.js +3 -4
  18. package/src/plugins/loopscale/constants.js.map +1 -1
  19. package/src/plugins/loopscale/helpers.d.ts +6 -33
  20. package/src/plugins/loopscale/helpers.js +39 -142
  21. package/src/plugins/loopscale/helpers.js.map +1 -1
  22. package/src/plugins/loopscale/index.js +10 -3
  23. package/src/plugins/loopscale/index.js.map +1 -1
  24. package/src/plugins/loopscale/lendFetcher.js +57 -0
  25. package/src/plugins/loopscale/lendFetcher.js.map +1 -0
  26. package/src/plugins/loopscale/lendVaultsFetcher.d.ts +6 -0
  27. package/src/plugins/loopscale/lendVaultsFetcher.js +68 -0
  28. package/src/plugins/loopscale/lendVaultsFetcher.js.map +1 -0
  29. package/src/plugins/loopscale/loansFetcher.d.ts +3 -0
  30. package/src/plugins/loopscale/loansFetcher.js +79 -0
  31. package/src/plugins/loopscale/loansFetcher.js.map +1 -0
  32. package/src/plugins/loopscale/structs.d.ts +116 -86
  33. package/src/plugins/loopscale/structs.js +101 -79
  34. package/src/plugins/loopscale/structs.js.map +1 -1
  35. package/src/plugins/loopscale/types.d.ts +6 -0
  36. package/src/plugins/loopscale/types.js +3 -0
  37. package/src/plugins/loopscale/types.js.map +1 -0
  38. package/src/plugins/loopscale/vaultsJob.d.ts +3 -0
  39. package/src/plugins/loopscale/vaultsJob.js +121 -0
  40. package/src/plugins/loopscale/vaultsJob.js.map +1 -0
  41. package/src/plugins/lulo/depositsFetcher.js +9 -29
  42. package/src/plugins/lulo/depositsFetcher.js.map +1 -1
  43. package/src/plugins/marginfi/banksJob.js +6 -2
  44. package/src/plugins/marginfi/banksJob.js.map +1 -1
  45. package/src/plugins/marginfi/constants.d.ts +5 -3
  46. package/src/plugins/marginfi/constants.js +8 -7
  47. package/src/plugins/marginfi/constants.js.map +1 -1
  48. package/src/plugins/marginfi/depositsFetcher.js +50 -27
  49. package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
  50. package/src/plugins/marginfi/getMarginFiAccounts.d.ts +6 -0
  51. package/src/plugins/marginfi/getMarginFiAccounts.js +44 -0
  52. package/src/plugins/marginfi/getMarginFiAccounts.js.map +1 -0
  53. package/src/plugins/marginfi/helpers.d.ts +0 -5
  54. package/src/plugins/marginfi/helpers.js +1 -81
  55. package/src/plugins/marginfi/helpers.js.map +1 -1
  56. package/src/plugins/marginfi/structs/MarginfiAccount.d.ts +5 -0
  57. package/src/plugins/marginfi/structs/MarginfiAccount.js.map +1 -1
  58. package/src/plugins/suilend/helpers.js +2 -0
  59. package/src/plugins/suilend/helpers.js.map +1 -1
  60. package/src/plugins/sushiswap/helpers.js +24 -24
  61. package/src/plugins/uniswap-v2/helpers.js +22 -22
  62. package/src/utils/misc/getLendingMarketAprs.d.ts +3 -1
  63. package/src/utils/misc/getLendingMarketAprs.js +24 -1
  64. package/src/utils/misc/getLendingMarketAprs.js.map +1 -1
  65. package/src/utils/sei/constants.js +8 -8
  66. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  67. package/src/plugins/loopscale/filters.d.ts +0 -9
  68. package/src/plugins/loopscale/filters.js +0 -62
  69. package/src/plugins/loopscale/filters.js.map +0 -1
  70. package/src/plugins/loopscale/positionsFetcher.js +0 -119
  71. package/src/plugins/loopscale/positionsFetcher.js.map +0 -1
  72. package/src/plugins/marginfi/filters.d.ts +0 -5
  73. package/src/plugins/marginfi/filters.js +0 -45
  74. package/src/plugins/marginfi/filters.js.map +0 -1
  75. /package/src/plugins/loopscale/{positionsFetcher.d.ts → lendFetcher.d.ts} +0 -0
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lockboxFilters = exports.loanVaultBorrowedFilters = exports.loanVaultLentFilters = exports.orderFilters = exports.escrowFilters = exports.roleFilters = void 0;
4
- const roleFilters = (owner) => [
5
- {
6
- memcmp: {
7
- offset: 8,
8
- bytes: owner,
9
- },
10
- },
11
- ];
12
- exports.roleFilters = roleFilters;
13
- const escrowFilters = (organization_identifier) => [
14
- {
15
- memcmp: {
16
- offset: 8,
17
- bytes: organization_identifier,
18
- },
19
- },
20
- { dataSize: 208 },
21
- ];
22
- exports.escrowFilters = escrowFilters;
23
- const orderFilters = (organization_identifier) => [
24
- {
25
- memcmp: {
26
- offset: 73,
27
- bytes: organization_identifier,
28
- },
29
- },
30
- { dataSize: 355 },
31
- ];
32
- exports.orderFilters = orderFilters;
33
- const loanVaultLentFilters = (borrower) => [
34
- {
35
- memcmp: {
36
- offset: 8 + 32,
37
- bytes: borrower,
38
- },
39
- },
40
- { dataSize: 338 },
41
- ];
42
- exports.loanVaultLentFilters = loanVaultLentFilters;
43
- const loanVaultBorrowedFilters = (borrower) => [
44
- {
45
- memcmp: {
46
- offset: 8 + 32 + 32,
47
- bytes: borrower,
48
- },
49
- },
50
- { dataSize: 338 },
51
- ];
52
- exports.loanVaultBorrowedFilters = loanVaultBorrowedFilters;
53
- const lockboxFilters = (nft) => [
54
- {
55
- memcmp: {
56
- offset: 52,
57
- bytes: nft,
58
- },
59
- },
60
- ];
61
- exports.lockboxFilters = lockboxFilters;
62
- //# sourceMappingURL=filters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAPW,QAAA,WAAW,eAOtB;AAEK,MAAM,aAAa,GAAG,CAC3B,uBAA+B,EACH,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,uBAAuB;SAC/B;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,MAAM,YAAY,GAAG,CAC1B,uBAA+B,EACH,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,uBAAuB;SAC/B;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,YAAY,gBAUvB;AAEK,MAAM,oBAAoB,GAAG,CAClC,QAAgB,EACY,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,QAAQ;SAChB;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,oBAAoB,wBAU/B;AAEK,MAAM,wBAAwB,GAAG,CACtC,QAAgB,EACY,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE;YACnB,KAAK,EAAE,QAAQ;SAChB;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,wBAAwB,4BAUnC;AAEK,MAAM,cAAc,GAAG,CAAC,GAAW,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,GAAG;SACX;KACF;CACF,CAAC;AAPW,QAAA,cAAc,kBAOzB"}
@@ -1,119 +0,0 @@
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 constants_1 = require("./constants");
17
- const clients_1 = require("../../utils/clients");
18
- const helpers_1 = require("./helpers");
19
- const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
20
- const depositsFetcher_1 = __importDefault(require("../marginfi/depositsFetcher"));
21
- const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
- const connection = (0, clients_1.getClientSolana)();
23
- const adminOrgs = yield (0, helpers_1.getAdminOrgs)(connection, owner);
24
- if (!adminOrgs.length)
25
- return [];
26
- const escrowAccounts = yield (0, helpers_1.getEscrows)(connection, adminOrgs);
27
- if (!escrowAccounts.length)
28
- return [];
29
- const { loansLent, loansBorrowed } = yield (0, helpers_1.getLoanVaults)(connection, escrowAccounts);
30
- const lenderLoanValues = [];
31
- const borrowerLoanValues = [];
32
- const borrowerCollateralValues = [];
33
- for (const escrowAccount of escrowAccounts) {
34
- const e = escrowAccounts.indexOf(escrowAccount);
35
- const data = yield (0, helpers_1.getOrdersForLoans)(connection, [
36
- ...loansLent[e],
37
- ...loansBorrowed[e],
38
- ]);
39
- const lenderOrders = [];
40
- for (let i = 0; i < loansLent[e].length; i++) {
41
- const loan = loansLent[e][i];
42
- const order = data.find((o) => o.orderAddress.toString() === loan.order.toString());
43
- if (order !== undefined &&
44
- order.order &&
45
- (order.order.status === 1 || order.order.status === 2))
46
- lenderOrders.push(order);
47
- }
48
- const borrowerOrders = [];
49
- for (let i = 0; i < loansBorrowed[e].length; i++) {
50
- const loan = loansBorrowed[e][i];
51
- const order = data.find((o) => o.orderAddress.toString() === loan.order.toString());
52
- if (order !== undefined &&
53
- order.order &&
54
- (order.order.status === 1 || order.order.status === 2))
55
- borrowerOrders.push(order);
56
- }
57
- lenderLoanValues.push((0, helpers_1.getLenderOrderValues)(lenderOrders));
58
- borrowerLoanValues.push((0, helpers_1.getBorrowerOrderValues)(borrowerOrders));
59
- borrowerCollateralValues.push(yield (0, helpers_1.getBorrowerCollateralValues)(connection, borrowerOrders));
60
- }
61
- const [escrowValues, escrowMarginfiElements] = yield Promise.all([
62
- Promise.all(escrowAccounts.map((escrowAccount) => (0, helpers_1.getTokensBalance)(escrowAccount.pubkey.toString()))),
63
- Promise.all(escrowAccounts.map((escrowAccount) => depositsFetcher_1.default.executor(escrowAccount.pubkey.toString(), cache))),
64
- ]);
65
- const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
66
- escrowAccounts.forEach((escrowAccount, i) => {
67
- const element = elementRegistry.addElementBorrowlend({
68
- label: 'Lending',
69
- name: Object.keys(borrowerLoanValues[i]).length > 0 ? 'Borrow' : 'Lend',
70
- ref: escrowAccount.pubkey.toString(),
71
- link: 'https://app.loopscale.com/portfolio',
72
- });
73
- escrowMarginfiElements[i].forEach((marginfiElement) => {
74
- if (marginfiElement.type === portfolio_core_1.PortfolioElementType.borrowlend) {
75
- marginfiElement.data.suppliedAssets.forEach((asset) => {
76
- if (asset.data.address && asset.data.amount) {
77
- element.addSuppliedAsset({
78
- address: asset.data.address,
79
- amount: asset.data.amount,
80
- alreadyShifted: true,
81
- });
82
- }
83
- });
84
- }
85
- });
86
- Object.keys(escrowValues[i]).forEach((address) => {
87
- element.addSuppliedAsset({
88
- address,
89
- amount: escrowValues[i][address],
90
- });
91
- });
92
- Object.keys(lenderLoanValues[i]).forEach((address) => {
93
- element.addSuppliedAsset({
94
- address,
95
- amount: lenderLoanValues[i][address],
96
- });
97
- });
98
- Object.keys(borrowerLoanValues[i]).forEach((address) => {
99
- element.addBorrowedAsset({
100
- address,
101
- amount: borrowerLoanValues[i][address],
102
- });
103
- });
104
- Object.keys(borrowerCollateralValues[i]).forEach((address) => {
105
- element.addSuppliedAsset({
106
- address,
107
- amount: borrowerCollateralValues[i][address],
108
- });
109
- });
110
- });
111
- return elementRegistry.getElements(cache);
112
- });
113
- const fetcher = {
114
- id: `${constants_1.platformId}-positions`,
115
- networkId: portfolio_core_1.NetworkId.solana,
116
- executor,
117
- };
118
- exports.default = fetcher;
119
- //# sourceMappingURL=positionsFetcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAE7E,2CAAyC;AAEzC,iDAAsD;AACtD,uCASmB;AACnB,gFAA6E;AAC7E,kFAA0D;AAE1D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,IAAA,sBAAY,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAExD,IAAI,CAAC,SAAS,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEjC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dk/node_modules/@solana/web3.js" />
2
- /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
- import { GetProgramAccountsFilter } from '@solana/web3.js';
4
- export declare const accountsFilter: (owner: string) => GetProgramAccountsFilter[];
5
- export declare const banksFilters: () => GetProgramAccountsFilter[];
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.banksFilters = exports.accountsFilter = void 0;
4
- const constants_1 = require("./constants");
5
- const Bank_1 = require("./structs/Bank");
6
- const accountsFilter = (owner) => [
7
- {
8
- memcmp: {
9
- bytes: 'CKkRR4La3xu',
10
- offset: 0,
11
- },
12
- },
13
- {
14
- memcmp: {
15
- bytes: constants_1.MarginfiAccountAddress,
16
- offset: 8,
17
- },
18
- },
19
- {
20
- memcmp: {
21
- bytes: owner,
22
- offset: 40,
23
- },
24
- },
25
- ];
26
- exports.accountsFilter = accountsFilter;
27
- const banksFilters = () => [
28
- {
29
- memcmp: {
30
- bytes: 'QnTef4UXSzF',
31
- offset: 0,
32
- },
33
- },
34
- {
35
- memcmp: {
36
- bytes: constants_1.MarginfiAccountAddress,
37
- offset: 41,
38
- },
39
- },
40
- {
41
- dataSize: Bank_1.bankStruct.byteSize,
42
- },
43
- ];
44
- exports.banksFilters = banksFilters;
45
- //# sourceMappingURL=filters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/filters.ts"],"names":[],"mappings":";;;AACA,2CAAqD;AACrD,yCAA4C;AAErC,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,CAAC;SACV;KACF;IACD;QACE,MAAM,EAAE;YACN,KAAK,EAAE,kCAAsB;YAC7B,MAAM,EAAE,CAAC;SACV;KACF;IACD;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC;AAnBW,QAAA,cAAc,kBAmBzB;AAEK,MAAM,YAAY,GAAG,GAA+B,EAAE,CAAC;IAC5D;QACE,MAAM,EAAE;YACN,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,CAAC;SACV;KACF;IACD;QACE,MAAM,EAAE;YACN,KAAK,EAAE,kCAAsB;YAC7B,MAAM,EAAE,EAAE;SACX;KACF;IACD;QACE,QAAQ,EAAE,iBAAU,CAAC,QAAQ;KAC9B;CACF,CAAC;AAhBW,QAAA,YAAY,gBAgBvB"}