@sonarwatch/portfolio-plugins 0.12.178 → 0.12.180

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/CHANGELOG.md +1514 -1506
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/index.js +12 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/joule/constants.d.ts +6 -0
  8. package/src/plugins/joule/constants.js +16 -0
  9. package/src/plugins/joule/constants.js.map +1 -0
  10. package/src/plugins/joule/depositFetcher.d.ts +3 -0
  11. package/src/plugins/joule/depositFetcher.js +71 -0
  12. package/src/plugins/joule/depositFetcher.js.map +1 -0
  13. package/src/plugins/joule/index.d.ts +6 -0
  14. package/src/plugins/joule/index.js +13 -0
  15. package/src/plugins/joule/index.js.map +1 -0
  16. package/src/plugins/{loopscale → joule}/marketsJob.js +10 -3
  17. package/src/plugins/joule/marketsJob.js.map +1 -0
  18. package/src/plugins/joule/structs.d.ts +19 -0
  19. package/src/plugins/joule/structs.js +22 -0
  20. package/src/plugins/joule/structs.js.map +1 -0
  21. package/src/plugins/joule/types.d.ts +50 -0
  22. package/src/plugins/joule/types.js +3 -0
  23. package/src/plugins/joule/types.js.map +1 -0
  24. package/src/plugins/loopscale/constants.d.ts +3 -1
  25. package/src/plugins/loopscale/constants.js +4 -4
  26. package/src/plugins/loopscale/constants.js.map +1 -1
  27. package/src/plugins/loopscale/filters.d.ts +7 -0
  28. package/src/plugins/loopscale/filters.js +62 -0
  29. package/src/plugins/loopscale/filters.js.map +1 -0
  30. package/src/plugins/loopscale/helpers.d.ts +33 -0
  31. package/src/plugins/loopscale/helpers.js +162 -0
  32. package/src/plugins/loopscale/helpers.js.map +1 -0
  33. package/src/plugins/loopscale/index.js +1 -2
  34. package/src/plugins/loopscale/index.js.map +1 -1
  35. package/src/plugins/loopscale/positionsFetcher.js +89 -40
  36. package/src/plugins/loopscale/positionsFetcher.js.map +1 -1
  37. package/src/plugins/loopscale/structs.d.ts +95 -14
  38. package/src/plugins/loopscale/structs.js +87 -13
  39. package/src/plugins/loopscale/structs.js.map +1 -1
  40. package/src/plugins/meso/constants.d.ts +7 -0
  41. package/src/plugins/meso/constants.js +17 -0
  42. package/src/plugins/meso/constants.js.map +1 -0
  43. package/src/plugins/meso/depositFetcher.d.ts +3 -0
  44. package/src/plugins/meso/depositFetcher.js +93 -0
  45. package/src/plugins/meso/depositFetcher.js.map +1 -0
  46. package/src/plugins/meso/index.d.ts +6 -0
  47. package/src/plugins/meso/index.js +13 -0
  48. package/src/plugins/meso/index.js.map +1 -0
  49. package/src/plugins/meso/marketsJob.d.ts +3 -0
  50. package/src/plugins/meso/marketsJob.js +37 -0
  51. package/src/plugins/meso/marketsJob.js.map +1 -0
  52. package/src/plugins/meso/structs.d.ts +19 -0
  53. package/src/plugins/meso/structs.js +22 -0
  54. package/src/plugins/meso/structs.js.map +1 -0
  55. package/src/plugins/meso/types.d.ts +100 -0
  56. package/src/plugins/meso/types.js +9 -0
  57. package/src/plugins/meso/types.js.map +1 -0
  58. package/src/plugins/orca/getWhirlpoolPositions.js +4 -0
  59. package/src/plugins/orca/getWhirlpoolPositions.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/plugins/zeta/airdropFetcher.js +14 -14
  63. package/src/utils/sei/constants.js +8 -8
  64. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  65. package/src/plugins/loopscale/marketsJob.js.map +0 -1
  66. /package/src/plugins/{loopscale → joule}/marketsJob.d.ts +0 -0
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.178",
3
+ "version": "0.12.180",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
package/src/index.js CHANGED
@@ -144,6 +144,9 @@ const francium_1 = require("./plugins/francium");
144
144
  const adrastea_1 = require("./plugins/adrastea");
145
145
  const elemental_1 = require("./plugins/elemental");
146
146
  const adrena_1 = require("./plugins/adrena");
147
+ const joule_1 = require("./plugins/joule");
148
+ const meso_1 = require("./plugins/meso");
149
+ const loopscale_1 = require("./plugins/loopscale");
147
150
  var constants_1 = require("./plugins/tokens/constants");
148
151
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
149
152
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -281,6 +284,9 @@ exports.platforms = [
281
284
  ...adrastea_1.platforms,
282
285
  ...elemental_1.platforms,
283
286
  ...adrena_1.platforms,
287
+ ...joule_1.platforms,
288
+ ...meso_1.platforms,
289
+ ...loopscale_1.platforms,
284
290
  ];
285
291
  // JOBS //
286
292
  exports.jobs = [
@@ -401,6 +407,9 @@ exports.jobs = [
401
407
  ...adrastea_1.jobs,
402
408
  ...elemental_1.jobs,
403
409
  ...adrena_1.jobs,
410
+ ...joule_1.jobs,
411
+ ...meso_1.jobs,
412
+ ...loopscale_1.jobs,
404
413
  ];
405
414
  // FETCHERS //
406
415
  exports.fetchers = [
@@ -523,6 +532,9 @@ exports.fetchers = [
523
532
  ...adrastea_1.fetchers,
524
533
  ...elemental_1.fetchers,
525
534
  ...adrena_1.fetchers,
535
+ ...joule_1.fetchers,
536
+ ...meso_1.fetchers,
537
+ ...loopscale_1.fetchers,
526
538
  ];
527
539
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
528
540
  exports.airdropFetchers = [
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/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gB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;CAClB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,wEAAgD;AAChD,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,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oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;CACrB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
@@ -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;
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ export declare const platformId = "joule";
3
+ export declare const platform: Platform;
4
+ export declare const marketsCacheKey = "markets";
5
+ export declare const api = "https://app.joule.finance/api/market";
6
+ export declare const userPositionMapType = "0x2fe576faa841347a9b1b32c869685deb75a15e3f62dfe37cbd6d52cc403a16f6::pool::UserPositionsMap";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userPositionMapType = exports.api = exports.marketsCacheKey = exports.platform = exports.platformId = void 0;
4
+ exports.platformId = 'joule';
5
+ exports.platform = {
6
+ id: exports.platformId,
7
+ name: 'Joule',
8
+ image: 'https://sonar.watch/img/platforms/joule.webp',
9
+ website: 'https://app.joule.finance/',
10
+ twitter: 'https://twitter.com/JouleFinance',
11
+ defiLlamaId: 'joule-finance', // from https://defillama.com/docs/api
12
+ };
13
+ exports.marketsCacheKey = `markets`;
14
+ exports.api = 'https://app.joule.finance/api/market';
15
+ exports.userPositionMapType = '0x2fe576faa841347a9b1b32c869685deb75a15e3f62dfe37cbd6d52cc403a16f6::pool::UserPositionsMap';
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;IAC3C,WAAW,EAAE,eAAe,EAAE,sCAAsC;CACrE,CAAC;AAEW,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,GAAG,GAAG,sCAAsC,CAAC;AAC7C,QAAA,mBAAmB,GAC9B,4FAA4F,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,71 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const aptos_1 = require("../../utils/aptos");
15
+ const clients_1 = require("../../utils/clients");
16
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
17
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
18
+ const marketsMemo = new MemoizedCache_1.MemoizedCache(constants_1.marketsCacheKey, {
19
+ prefix: constants_1.platformId,
20
+ networkId: portfolio_core_1.NetworkId.aptos,
21
+ });
22
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const client = (0, clients_1.getClientAptos)();
24
+ const positionMap = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.userPositionMapType);
25
+ const markets = yield marketsMemo.getItem(cache);
26
+ if (!positionMap)
27
+ return [];
28
+ const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.aptos, constants_1.platformId);
29
+ for (const position of positionMap.positions_map.data) {
30
+ const element = registry.addElementBorrowlend({
31
+ label: 'Lending',
32
+ name: position.value.position_name,
33
+ });
34
+ for (const lendingPos of position.value.lend_positions.data) {
35
+ const market = markets.find((m) => lendingPos.key.includes(m.assetsName));
36
+ element.addSuppliedAsset({
37
+ address: lendingPos.key,
38
+ amount: Number(lendingPos.value),
39
+ });
40
+ if (market)
41
+ element.addSuppliedYield([
42
+ {
43
+ apr: (0, portfolio_core_1.apyToApr)(market.depositApy / 100),
44
+ apy: market.depositApy / 100,
45
+ },
46
+ ]);
47
+ }
48
+ for (const borrowPos of position.value.borrow_positions.data) {
49
+ const market = markets.find((m) => borrowPos.key.includes(m.assetsName));
50
+ element.addBorrowedAsset({
51
+ address: borrowPos.key,
52
+ amount: Number(borrowPos.value.borrow_amount),
53
+ });
54
+ if (market)
55
+ element.addBorrowedYield([
56
+ {
57
+ apr: (0, portfolio_core_1.apyToApr)(market.borrowApy / 100),
58
+ apy: market.borrowApy / 100,
59
+ },
60
+ ]);
61
+ }
62
+ }
63
+ return registry.getElements(cache);
64
+ });
65
+ const fetcher = {
66
+ id: `${constants_1.platformId}-deposits`,
67
+ networkId: portfolio_core_1.NetworkId.aptos,
68
+ executor,
69
+ };
70
+ exports.default = fetcher;
71
+ //# sourceMappingURL=depositFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAiE;AAGjE,2CAA+E;AAE/E,6CAAuD;AACvD,iDAAqD;AACrD,gFAA6E;AAC7E,kEAA+D;AAE/D,MAAM,WAAW,GAAG,IAAI,6BAAa,CAAW,2BAAe,EAAE;IAC/D,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;CAC3B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,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,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YACzE,OAAO,CAAC,gBAAgB,CAAC;gBACvB,OAAO,EAAE,SAAS,CAAC,GAAG;gBACtB,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC;aAC9C,CAAC,CAAC;YACH,IAAI,MAAM;gBACR,OAAO,CAAC,gBAAgB,CAAC;oBACvB;wBACE,GAAG,EAAE,IAAA,yBAAQ,EAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC;wBACrC,GAAG,EAAE,MAAM,CAAC,SAAS,GAAG,GAAG;qBAC5B;iBACF,CAAC,CAAC;QACP,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const marketsJob_1 = __importDefault(require("./marketsJob"));
9
+ const depositFetcher_1 = __importDefault(require("./depositFetcher"));
10
+ exports.platforms = [constants_1.platform];
11
+ exports.jobs = [marketsJob_1.default];
12
+ exports.fetchers = [depositFetcher_1.default];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
@@ -8,13 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const axios_1 = __importDefault(require("axios"));
13
17
  const constants_1 = require("./constants");
14
18
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
15
- yield cache.setItem('market_id', 'market_object', {
16
- prefix: constants_1.marketsCachePrefix,
17
- networkId: portfolio_core_1.NetworkId.ethereum,
19
+ const markets = yield axios_1.default.get(constants_1.api);
20
+ if (!markets.data)
21
+ return;
22
+ yield cache.setItem(constants_1.marketsCacheKey, markets.data.res, {
23
+ prefix: constants_1.platformId,
24
+ networkId: portfolio_core_1.NetworkId.aptos,
18
25
  });
19
26
  });
20
27
  const job = {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAG7C,2CAA+D;AAG/D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,OAAO,GAAmC,MAAM,eAAK,CAAC,GAAG,CAAC,eAAG,CAAC,CAAC;IAErE,IAAI,CAAC,OAAO,CAAC,IAAI;QAAE,OAAO;IAE1B,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;QACrD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="node" />
2
+ import { BeetStruct } from '@metaplex-foundation/beet';
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import BigNumber from 'bignumber.js';
5
+ export declare enum State {
6
+ Uninitialized = 0,
7
+ StakePool = 1,
8
+ InactiveStakePool = 2,
9
+ StakeAccount = 3
10
+ }
11
+ export type Liquidity = {
12
+ buffer: Buffer;
13
+ state: State;
14
+ mint: PublicKey;
15
+ owner: PublicKey;
16
+ amountDeposited: BigNumber;
17
+ space: number[];
18
+ };
19
+ export declare const liquidityStruct: BeetStruct<Liquidity, Partial<Liquidity>>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liquidityStruct = exports.State = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ var State;
8
+ (function (State) {
9
+ State[State["Uninitialized"] = 0] = "Uninitialized";
10
+ State[State["StakePool"] = 1] = "StakePool";
11
+ State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
12
+ State[State["StakeAccount"] = 3] = "StakeAccount";
13
+ })(State || (exports.State = State = {}));
14
+ exports.liquidityStruct = new beet_1.BeetStruct([
15
+ ['buffer', (0, solana_1.blob)(8)],
16
+ ['state', beet_1.u8],
17
+ ['mint', beet_solana_1.publicKey],
18
+ ['owner', beet_solana_1.publicKey],
19
+ ['amountDeposited', solana_1.u64],
20
+ ['space', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
21
+ ], (args) => args);
22
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC1C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
@@ -0,0 +1,50 @@
1
+ export type UserPositionMap = {
2
+ positions_map: PositionsMap;
3
+ user_position_ids: string[];
4
+ };
5
+ export type PositionsMap = {
6
+ data: PositionsMapData[];
7
+ };
8
+ export type PositionsMapData = {
9
+ key: string;
10
+ value: PurpleValue;
11
+ };
12
+ export type PurpleValue = {
13
+ borrow_positions: BorrowPositions;
14
+ lend_positions: LendPositions;
15
+ position_name: string;
16
+ };
17
+ export type BorrowPositions = {
18
+ data: BorrowPositionsDatum[];
19
+ };
20
+ export type BorrowPositionsDatum = {
21
+ key: string;
22
+ value: FluffyValue;
23
+ };
24
+ export type FluffyValue = {
25
+ borrow_amount: string;
26
+ coin_name: string;
27
+ interest_accumulated: string;
28
+ last_interest_rate_index: LastInterestRateIndex;
29
+ };
30
+ export type LastInterestRateIndex = {
31
+ v: string;
32
+ };
33
+ export type LendPositions = {
34
+ data: LendPositionsDatum[];
35
+ };
36
+ export type LendPositionsDatum = {
37
+ key: string;
38
+ value: string;
39
+ };
40
+ export type MarketsResponse = {
41
+ res: Market[];
42
+ };
43
+ export type Market = {
44
+ assetsName: string;
45
+ ltv: string;
46
+ marketSize: string;
47
+ totalBorrowed: string;
48
+ depositApy: number;
49
+ borrowApy: number;
50
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/types.ts"],"names":[],"mappings":""}
@@ -1,5 +1,7 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { PublicKey } from '@solana/web3.js';
2
3
  export declare const platformId = "loopscale";
3
4
  export declare const platform: Platform;
4
5
  export declare const marketsCachePrefix = "loopscale-markets";
5
- export declare const programId = "abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp";
6
+ export declare const creditbookProgramId: PublicKey;
7
+ export declare const lockboxProgramId: PublicKey;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.programId = exports.marketsCachePrefix = exports.platform = exports.platformId = void 0;
3
+ exports.lockboxProgramId = exports.creditbookProgramId = exports.marketsCachePrefix = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
4
5
  exports.platformId = 'loopscale';
5
6
  exports.platform = {
6
7
  id: exports.platformId,
@@ -11,7 +12,6 @@ exports.platform = {
11
12
  // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
12
13
  };
13
14
  exports.marketsCachePrefix = `${exports.platformId}-markets`;
14
- exports.programId = 'abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp';
15
- // borrow tx : https://solana.fm/tx/3Fb3JYbPwJvWsgcE8ihdyuDuBeXiPe8ELJVed5VG9U9cjyEqDZuTWoboacaSawVPRGaCR4b5DSP2Grs8EHYq7tgu?cluster=mainnet-alpha
16
- // deposit lend tx : https://solana.fm/tx/2dRBwkQX3QArnMdEocYhRs3Drni2LR1cWDonsLKX3ks4dvjRXLSDzSx5T4ar5fTU1CjZDJT8kSJq5ADHyn7kRySM?cluster=mainnet-alpha
15
+ exports.creditbookProgramId = new web3_js_1.PublicKey('abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp');
16
+ exports.lockboxProgramId = new web3_js_1.PublicKey('1oCkVqJ2uk4SuHyCuZKi8q3J6gjoe9Pux3XvHnHFVy4');
17
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,6BAA6B;IACtC,qEAAqE;CACtE,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC;AAE7C,QAAA,SAAS,GAAG,6CAA6C,CAAC;AAEvE,kJAAkJ;AAClJ,wJAAwJ"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,6BAA6B;IACtC,qEAAqE;CACtE,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC;AAE7C,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,6CAA6C,CAC9C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
+ export declare const roleFilters: (owner: string) => GetProgramAccountsFilter[];
3
+ export declare const escrowFilters: (organization_identifier: string) => GetProgramAccountsFilter[];
4
+ export declare const orderFilters: (organization_identifier: string) => GetProgramAccountsFilter[];
5
+ export declare const loanVaultLentFilters: (borrower: string) => GetProgramAccountsFilter[];
6
+ export declare const loanVaultBorrowedFilters: (borrower: string) => GetProgramAccountsFilter[];
7
+ export declare const lockboxFilters: (nft: string) => GetProgramAccountsFilter[];
@@ -0,0 +1,62 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,33 @@
1
+ import { Connection, PublicKey } from '@solana/web3.js';
2
+ import { ParsedAccount } from '../../utils/solana';
3
+ import { EscrowAccount, Ledger, LoanVault, Order } from './structs';
4
+ export declare const getAdminOrgs: (connection: Connection, owner: string) => Promise<PublicKey[]>;
5
+ export declare const getEscrows: (connection: Connection, adminOrgs: PublicKey[]) => Promise<ParsedAccount<EscrowAccount>[]>;
6
+ export declare const getLoanVaults: (connection: Connection, escrowAccounts: ParsedAccount<EscrowAccount>[]) => Promise<{
7
+ loansLent: ParsedAccount<LoanVault>[][];
8
+ loansBorrowed: ParsedAccount<LoanVault>[][];
9
+ }>;
10
+ export declare const getOrdersForLoans: (connection: Connection, loans: ParsedAccount<LoanVault>[]) => Promise<{
11
+ order: ParsedAccount<Order> | null;
12
+ ledgers: Ledger[];
13
+ orderAddress: PublicKey;
14
+ }[]>;
15
+ export declare const getLenderOrderValues: (orders: {
16
+ order: ParsedAccount<Order> | null;
17
+ ledgers: Ledger[];
18
+ orderAddress: PublicKey;
19
+ }[]) => Balances;
20
+ export declare const getBorrowerOrderValues: (orders: {
21
+ order: ParsedAccount<Order> | null;
22
+ ledgers: Ledger[];
23
+ orderAddress: PublicKey;
24
+ }[]) => Balances;
25
+ export declare const getBorrowerCollateralValues: (connection: Connection, orders: {
26
+ order: ParsedAccount<Order> | null;
27
+ ledgers: Ledger[];
28
+ orderAddress: PublicKey;
29
+ }[]) => Promise<Balances>;
30
+ export declare const getTokensBalance: (owner: string) => Promise<Balances>;
31
+ export type Balances = {
32
+ [key: string]: number;
33
+ };