@sonarwatch/portfolio-plugins 0.12.35 → 0.12.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/package.json +1 -1
  3. package/src/index.js +8 -0
  4. package/src/index.js.map +1 -1
  5. package/src/orphanPlatorms.js +0 -8
  6. package/src/orphanPlatorms.js.map +1 -1
  7. package/src/plugins/01/depostisFetcher.js +1 -1
  8. package/src/plugins/01/depostisFetcher.js.map +1 -1
  9. package/src/plugins/aave/helpers.js +6 -1
  10. package/src/plugins/aave/helpers.js.map +1 -1
  11. package/src/plugins/allbridge/constants.d.ts +11 -0
  12. package/src/plugins/allbridge/constants.js +25 -0
  13. package/src/plugins/allbridge/constants.js.map +1 -0
  14. package/src/plugins/allbridge/helpers.d.ts +5 -0
  15. package/src/plugins/allbridge/helpers.js +25 -0
  16. package/src/plugins/allbridge/helpers.js.map +1 -0
  17. package/src/plugins/allbridge/idl.d.ts +58 -0
  18. package/src/plugins/allbridge/idl.js +476 -0
  19. package/src/plugins/allbridge/idl.js.map +1 -0
  20. package/src/plugins/allbridge/index.d.ts +6 -0
  21. package/src/plugins/allbridge/index.js +13 -0
  22. package/src/plugins/allbridge/index.js.map +1 -0
  23. package/src/plugins/allbridge/poolsJob.d.ts +3 -0
  24. package/src/plugins/allbridge/poolsJob.js +40 -0
  25. package/src/plugins/allbridge/poolsJob.js.map +1 -0
  26. package/src/plugins/allbridge/positionsFetcher.js +92 -0
  27. package/src/plugins/allbridge/positionsFetcher.js.map +1 -0
  28. package/src/plugins/allbridge/types.d.ts +38 -0
  29. package/src/plugins/allbridge/types.js +3 -0
  30. package/src/plugins/allbridge/types.js.map +1 -0
  31. package/src/plugins/aptin/depositsFetcher.js +6 -1
  32. package/src/plugins/aptin/depositsFetcher.js.map +1 -1
  33. package/src/plugins/aries/depositsFetcher.js +7 -1
  34. package/src/plugins/aries/depositsFetcher.js.map +1 -1
  35. package/src/plugins/banx/constants.d.ts +0 -1
  36. package/src/plugins/banx/constants.js +1 -2
  37. package/src/plugins/banx/constants.js.map +1 -1
  38. package/src/plugins/banx/{calculateLoanRepayValue.d.ts → helpers.d.ts} +1 -0
  39. package/src/plugins/banx/{calculateLoanRepayValue.js → helpers.js} +29 -2
  40. package/src/plugins/banx/helpers.js.map +1 -0
  41. package/src/plugins/banx/idl.d.ts +15 -7
  42. package/src/plugins/banx/idl.js +199 -268
  43. package/src/plugins/banx/idl.js.map +1 -1
  44. package/src/plugins/banx/loansFetcher.js +33 -28
  45. package/src/plugins/banx/loansFetcher.js.map +1 -1
  46. package/src/plugins/banx/offersFetcher.js +15 -16
  47. package/src/plugins/banx/offersFetcher.js.map +1 -1
  48. package/src/plugins/bucket/collateralFetcher.js +1 -1
  49. package/src/plugins/bucket/collateralFetcher.js.map +1 -1
  50. package/src/plugins/citrus/collectionsJob.js.map +1 -1
  51. package/src/plugins/citrus/constants.d.ts +0 -1
  52. package/src/plugins/citrus/constants.js +1 -2
  53. package/src/plugins/citrus/constants.js.map +1 -1
  54. package/src/plugins/citrus/loansFetcher.js +18 -20
  55. package/src/plugins/citrus/loansFetcher.js.map +1 -1
  56. package/src/plugins/clone/depositsFetcher.js +2 -2
  57. package/src/plugins/clone/depositsFetcher.js.map +1 -1
  58. package/src/plugins/compound/getPositionsV2Fetcher.js +1 -1
  59. package/src/plugins/compound/getPositionsV2Fetcher.js.map +1 -1
  60. package/src/plugins/compound/getPositionsV3Fetcher.js +5 -1
  61. package/src/plugins/compound/getPositionsV3Fetcher.js.map +1 -1
  62. package/src/plugins/drift/depositsFetcher.d.ts +3 -0
  63. package/src/plugins/drift/{deposits.js → depositsFetcher.js} +4 -4
  64. package/src/plugins/drift/depositsFetcher.js.map +1 -0
  65. package/src/plugins/drift/index.js +2 -2
  66. package/src/plugins/drift/index.js.map +1 -1
  67. package/src/plugins/flash/perpetualFetcher.js +1 -1
  68. package/src/plugins/flash/perpetualFetcher.js.map +1 -1
  69. package/src/plugins/flexlend/depositsFetcher.js +2 -2
  70. package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
  71. package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
  72. package/src/plugins/jupiter/exchange/constants.js +2 -1
  73. package/src/plugins/jupiter/exchange/constants.js.map +1 -1
  74. package/src/plugins/jupiter/exchange/limitFetcher.js +9 -6
  75. package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -1
  76. package/src/plugins/jupiter/exchange/perpetualFetcher.js +8 -8
  77. package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
  78. package/src/plugins/jupiter/exchange/structs.d.ts +21 -0
  79. package/src/plugins/jupiter/exchange/structs.js +21 -1
  80. package/src/plugins/jupiter/exchange/structs.js.map +1 -1
  81. package/src/plugins/jupiter/pricingJob.js +7 -22
  82. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  83. package/src/plugins/kamino/lendsFetcher.js +21 -3
  84. package/src/plugins/kamino/lendsFetcher.js.map +1 -1
  85. package/src/plugins/maker/vaultsFetcher.js +1 -1
  86. package/src/plugins/maker/vaultsFetcher.js.map +1 -1
  87. package/src/plugins/mango/boostFetcher.js +1 -1
  88. package/src/plugins/mango/boostFetcher.js.map +1 -1
  89. package/src/plugins/mango/collateralFetcher.js +1 -1
  90. package/src/plugins/mango/collateralFetcher.js.map +1 -1
  91. package/src/plugins/mango/redeemFetcher.js +1 -1
  92. package/src/plugins/mango/redeemFetcher.js.map +1 -1
  93. package/src/plugins/maple/ethereumFetcher.js +1 -1
  94. package/src/plugins/maple/ethereumFetcher.js.map +1 -1
  95. package/src/plugins/marginfi/helpers.js +7 -1
  96. package/src/plugins/marginfi/helpers.js.map +1 -1
  97. package/src/plugins/mole/farmsFetcher.js +5 -1
  98. package/src/plugins/mole/farmsFetcher.js.map +1 -1
  99. package/src/plugins/morpho/aaveV3CollateralFetcher.js +1 -1
  100. package/src/plugins/morpho/aaveV3CollateralFetcher.js.map +1 -1
  101. package/src/plugins/native-stake/solana/solanaFetcher.js +2 -0
  102. package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
  103. package/src/plugins/navi/collateralFetcher.js +6 -1
  104. package/src/plugins/navi/collateralFetcher.js.map +1 -1
  105. package/src/plugins/nosana/stakingFetcher.js +8 -2
  106. package/src/plugins/nosana/stakingFetcher.js.map +1 -1
  107. package/src/plugins/port/obligationsFetcher.js +1 -1
  108. package/src/plugins/port/obligationsFetcher.js.map +1 -1
  109. package/src/plugins/rain/collectionsJob.js +6 -10
  110. package/src/plugins/rain/collectionsJob.js.map +1 -1
  111. package/src/plugins/rain/helpers.js +3 -1
  112. package/src/plugins/rain/helpers.js.map +1 -1
  113. package/src/plugins/rain/index.js +2 -1
  114. package/src/plugins/rain/index.js.map +1 -1
  115. package/src/plugins/rain/loansFetcher.js +61 -26
  116. package/src/plugins/rain/loansFetcher.js.map +1 -1
  117. package/src/plugins/rain/poolsFetcher.js +1 -1
  118. package/src/plugins/rain/poolsFetcher.js.map +1 -1
  119. package/src/plugins/rain/types.d.ts +3 -0
  120. package/src/plugins/sanctum/constants.d.ts +4 -0
  121. package/src/plugins/sanctum/constants.js +14 -0
  122. package/src/plugins/sanctum/constants.js.map +1 -0
  123. package/src/plugins/sanctum/index.d.ts +6 -0
  124. package/src/plugins/sanctum/index.js +12 -0
  125. package/src/plugins/sanctum/index.js.map +1 -0
  126. package/src/plugins/sanctum/lstsJob.d.ts +3 -0
  127. package/src/plugins/sanctum/lstsJob.js +36 -0
  128. package/src/plugins/sanctum/lstsJob.js.map +1 -0
  129. package/src/plugins/scallop/lendingsFetcher.js +1 -1
  130. package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
  131. package/src/plugins/scallop/obligationsFetcher.js +1 -1
  132. package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
  133. package/src/plugins/sharky/constants.d.ts +0 -1
  134. package/src/plugins/sharky/constants.js +3 -4
  135. package/src/plugins/sharky/constants.js.map +1 -1
  136. package/src/plugins/sharky/loansFetcher.js +21 -20
  137. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  138. package/src/plugins/solend/helpers.js +7 -1
  139. package/src/plugins/solend/helpers.js.map +1 -1
  140. package/src/plugins/suilend/obligationsFetcher.js +7 -1
  141. package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
  142. package/src/plugins/thala/vaultsFetcher.js +1 -1
  143. package/src/plugins/thala/vaultsFetcher.js.map +1 -1
  144. package/src/plugins/zeta/airdropFetcher.d.ts +3 -0
  145. package/src/plugins/zeta/airdropFetcher.js +105 -0
  146. package/src/plugins/zeta/airdropFetcher.js.map +1 -0
  147. package/src/plugins/zeta/constants.d.ts +3 -0
  148. package/src/plugins/zeta/constants.js +4 -1
  149. package/src/plugins/zeta/constants.js.map +1 -1
  150. package/src/plugins/zeta/index.js +2 -1
  151. package/src/plugins/zeta/index.js.map +1 -1
  152. package/src/plugins/zeta/types.d.ts +14 -0
  153. package/src/plugins/zeta/types.js +3 -0
  154. package/src/plugins/zeta/types.js.map +1 -0
  155. package/src/utils/misc/MemoizedCache.d.ts +12 -0
  156. package/src/utils/misc/MemoizedCache.js +35 -0
  157. package/src/utils/misc/MemoizedCache.js.map +1 -0
  158. package/src/utils/misc/arrayToMap.d.ts +1 -0
  159. package/src/utils/misc/arrayToMap.js +12 -0
  160. package/src/utils/misc/arrayToMap.js.map +1 -0
  161. package/src/utils/misc/pick.d.ts +2 -0
  162. package/src/utils/misc/pick.js +16 -0
  163. package/src/utils/misc/pick.js.map +1 -0
  164. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +8 -3
  165. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -1
  166. package/src/plugins/banx/calculateLoanRepayValue.js.map +0 -1
  167. package/src/plugins/drift/deposits.js.map +0 -1
  168. /package/src/plugins/{drift/deposits.d.ts → allbridge/positionsFetcher.d.ts} +0 -0
@@ -21,58 +21,93 @@ const solana_1 = require("../../utils/solana");
21
21
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
22
  const pool_1 = require("./structs/pool");
23
23
  const helpers_1 = require("./helpers");
24
+ const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
25
+ const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
26
+ const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
27
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
28
+ const collectionMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsKey, {
29
+ prefix: constants_1.platformId,
30
+ networkId: portfolio_core_1.NetworkId.solana,
31
+ });
24
32
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
33
  const client = (0, clients_1.getClientSolana)();
26
- // const loans = await getParsedProgramAccounts(
27
- // client,
28
- // loanStruct,
29
- // programId,
30
- // loanBorrowerFilter(owner)
31
- // );
32
- // if (loans.length === 0) return [];
34
+ const dasUrl = (0, getSolanaDasEndpoint_1.default)();
33
35
  const loans = yield (0, helpers_1.getLoans)(owner);
34
36
  if (loans.length === 0)
35
37
  return [];
36
- const mints = new Set();
38
+ const tokenMints = new Set();
39
+ const nftMints = new Set();
37
40
  const pools = new Set();
41
+ tokenMints.add(portfolio_core_1.solanaNativeAddress);
38
42
  loans.forEach((loan) => {
39
43
  pools.add(loan.pool.toString());
40
- mints.add(loan.currency.toString());
41
- mints.add(loan.mint.toString());
44
+ tokenMints.add(loan.currency.toString());
45
+ if (loan.isDefi)
46
+ tokenMints.add(loan.mint.toString());
47
+ else
48
+ nftMints.add(loan.mint.toString());
42
49
  });
43
- const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
44
- const poolsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool)));
50
+ const [tokenPriceById, heliusAssets, collections, poolsAccounts] = yield Promise.all([
51
+ cache.getTokenPricesAsMap(Array.from(tokenMints), portfolio_core_1.NetworkId.solana),
52
+ (0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, Array.from(nftMints)),
53
+ collectionMemo.getItem(cache),
54
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool))),
55
+ ]);
45
56
  const poolById = new Map();
46
57
  poolsAccounts.forEach((account) => account ? poolById.set(account.pubkey.toString(), account) : undefined);
47
58
  const elements = [];
48
59
  for (const loan of loans) {
49
60
  if (new bignumber_js_1.default(loan.amount).isZero())
50
61
  continue;
51
- if (loan.status !== 'Ongoing')
52
- continue;
53
- if (!loan.isDefi)
54
- continue;
55
- const collateraMint = loan.mint.toString();
62
+ const collateralMint = loan.mint.toString();
56
63
  const borrowMint = loan.currency.toString();
57
- const collatTokenPrice = tokenPriceById.get(collateraMint);
58
- const borrowTokenPrice = tokenPriceById.get(borrowMint);
59
- if (!collatTokenPrice || !borrowTokenPrice)
60
- continue;
61
64
  const borrowedAssets = [];
62
65
  const borrowedYields = [];
63
66
  const suppliedAssets = [];
64
67
  const suppliedYields = [];
65
68
  const rewardAssets = [];
66
- const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
67
69
  const daysRemaining = (0, helpers_1.daysBetweenDates)(new Date(), new Date(loan.expiredAt));
70
+ const borrowTokenPrice = tokenPriceById.get(borrowMint);
71
+ if (!borrowTokenPrice)
72
+ continue;
73
+ if (loan.isDefi) {
74
+ // mint is a token
75
+ const collatTokenPrice = tokenPriceById.get(collateralMint);
76
+ if (!collatTokenPrice)
77
+ continue;
78
+ const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
79
+ if (!amountDeposited.isZero())
80
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
81
+ }
82
+ else {
83
+ // mint is a nft
84
+ const heliusAsset = heliusAssets.get(loan.mint);
85
+ if (heliusAsset && collections) {
86
+ const collection = collections.find((c) => c.collectionId === loan.collectionId);
87
+ const solTokenPrice = tokenPriceById.get(portfolio_core_1.solanaNativeAddress);
88
+ const assetValue = collection && solTokenPrice
89
+ ? new bignumber_js_1.default(collection.floorPrice)
90
+ .dividedBy(Math.pow(10, solTokenPrice.decimals))
91
+ .multipliedBy(solTokenPrice.price)
92
+ .toNumber()
93
+ : undefined;
94
+ const asset = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(heliusAsset, {
95
+ tags: [portfolio_core_1.collectibleFreezedTag],
96
+ collection: {
97
+ name: collection === null || collection === void 0 ? void 0 : collection.name,
98
+ floorPrice: assetValue,
99
+ },
100
+ });
101
+ if (asset)
102
+ suppliedAssets.push(asset);
103
+ }
104
+ }
105
+ const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
68
106
  if (!amountBorrowed.isZero())
69
107
  borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(borrowTokenPrice.address, amountBorrowed.toNumber(), portfolio_core_1.NetworkId.solana, borrowTokenPrice, undefined, { tags: [`Refund in ${daysRemaining} days`] }));
70
- const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
71
- if (!amountDeposited.isZero())
72
- suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
73
108
  if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
74
109
  continue;
75
- const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
110
+ const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
76
111
  elements.push({
77
112
  type: portfolio_core_1.PortfolioElementType.borrowlend,
78
113
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyC;AACzC,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AAEvD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,gDAAgD;IAChD,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,8BAA8B;IAC9B,KAAK;IAEL,qCAAqC;IAErC,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,aAAa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,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,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyD;AACzD,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AACvD,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AAErG,kEAA+D;AAE/D,MAAM,cAAc,GAAG,IAAI,6BAAa,CAAqB,0BAAc,EAAE;IAC3E,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAEtC,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,UAAU,GAAgB,IAAI,GAAG,EAAE,CA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C;QACF,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC1B,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,gBAAgB,CAAC,OAAO,EACxB,cAAc,CAAC,QAAQ,EAAE,EACzB,0BAAS,CAAC,MAAM,EAChB,gBAAgB,EAChB,SAAS,EACT,EAAE,IAAI,EAAE,CAAC,aAAa,aAAa,OAAO,CAAC,EAAE,CAC9C,CACF,CAAC;QAEJ,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QAE5E,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;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -39,7 +39,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
39
39
  suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, portfolio_core_1.NetworkId.solana, tokenPrice));
40
40
  if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
41
41
  return [];
42
- const { borrowedValue, healthRatio, rewardValue, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
42
+ const { borrowedValue, healthRatio, rewardValue, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
43
43
  return [
44
44
  {
45
45
  type: portfolio_core_1.PortfolioElementType.borrowlend,
@@ -1 +1 @@
1
- {"version":3,"file":"poolsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/poolsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAyC;AACzC,iDAAsD;AACtD,yCAA4C;AAC5C,qGAA6E;AAC7E,uCAAuC;AACvC,kFAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,wFAAwF;IAExF,MAAM,WAAW,GAAG,MAAM,IAAA,2CAAoB,EAC5C,MAAM,EACN,iBAAU,EACV,IAAA,oBAAU,EAAC,KAAK,CAAC,CAClB,CAAC;IACF,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAEhE,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAC1C,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAC/B,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAE1C,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW;SACnC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC;SACpC,QAAQ,EAAE,CAAC;IACd,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1E,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAExE,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,WAAW;gBACX,WAAW;gBACX,YAAY;gBACZ,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"poolsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/poolsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAyC;AACzC,iDAAsD;AACtD,yCAA4C;AAC5C,qGAA6E;AAC7E,uCAAuC;AACvC,kFAA+E;AAE/E,MAAM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O;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,WAAW;gBACX,WAAW;gBACX,YAAY;gBACZ,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -96,7 +96,10 @@ export type Collection = {
96
96
  updatedAt: string;
97
97
  deletedAt: string;
98
98
  version: number;
99
+ mintIn: string;
100
+ isDefi: boolean;
99
101
  };
102
+ export type PickedCollection = Pick<Collection, 'collectionId' | 'name' | 'floorPrice'>;
100
103
  export type LoansResponse = {
101
104
  user: string;
102
105
  platform: string;
@@ -0,0 +1,4 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ export declare const platformId = "sanctum";
3
+ export declare const platform: Platform;
4
+ export declare const lstsKey = "lsts";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lstsKey = exports.platform = exports.platformId = void 0;
4
+ exports.platformId = 'sanctum';
5
+ exports.platform = {
6
+ id: exports.platformId,
7
+ defiLlamaId: 'parent#sanctum', // from https://defillama.com/docs/api
8
+ name: 'Sanctum',
9
+ image: 'https://sonar.watch/img/platforms/sanctum.webp',
10
+ website: 'https://www.sanctum.so/',
11
+ twitter: 'https://twitter.com/sanctumso',
12
+ };
13
+ exports.lstsKey = 'lsts';
14
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,WAAW,EAAE,gBAAgB,EAAE,sCAAsC;IACrE,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,+BAA+B;CACzC,CAAC;AACW,QAAA,OAAO,GAAG,MAAM,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,12 @@
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 lstsJob_1 = __importDefault(require("./lstsJob"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [lstsJob_1.default];
11
+ exports.fetchers = [];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wDAAgC;AAEnB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,iBAAO,CAAC,CAAC;AACxB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const axios_1 = __importDefault(require("axios"));
16
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
+ const constants_1 = require("./constants");
18
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
+ const res = yield axios_1.default.get('https://raw.githubusercontent.com/igneous-labs/sanctum-lst-list/master/sanctum-lst-list.toml');
20
+ const regex = /(?<=mint = ").{44}/g;
21
+ const rawMints = String(res.data).match(regex);
22
+ if (rawMints) {
23
+ const mints = rawMints.map((mint) => mint.replace('"', ''));
24
+ yield cache.setItem(constants_1.lstsKey, mints, {
25
+ prefix: constants_1.platformId,
26
+ networkId: portfolio_core_1.NetworkId.solana,
27
+ });
28
+ }
29
+ });
30
+ const job = {
31
+ id: `${constants_1.platformId}-lsts`,
32
+ executor,
33
+ label: 'normal',
34
+ };
35
+ exports.default = job;
36
+ //# sourceMappingURL=lstsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lstsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/lstsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+DAAuD;AAGvD,2CAAkD;AAElD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,8FAA8F,CAC/F,CAAC;IAEF,MAAM,KAAK,GAAG,qBAAqB,CAAC;IACpC,MAAM,QAAQ,GAAoB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEhE,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,KAAK,CAAC,OAAO,CAAC,mBAAO,EAAE,KAAK,EAAE;YAClC,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -155,7 +155,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
155
155
  borrowedAssets.length === 0 &&
156
156
  rewardAssets.length === 0)
157
157
  return [];
158
- const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
158
+ const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
159
159
  elements.push({
160
160
  type: portfolio_core_1.PortfolioElementType.borrowlend,
161
161
  networkId: portfolio_core_1.NetworkId.sui,
@@ -1 +1 @@
1
- {"version":3,"file":"lendingsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/lendingsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gD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AAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -173,7 +173,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
173
173
  borrowedAssets.length === 0 &&
174
174
  rewardAssets.length === 0)
175
175
  continue;
176
- const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
176
+ const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
177
177
  elements.push({
178
178
  type: portfolio_core_1.PortfolioElementType.borrowlend,
179
179
  networkId: portfolio_core_1.NetworkId.sui,
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gDAA0D;AAC1D,gEAAqC;AAIrC,2CAOqB;AAQrB,uCAA2C;AAC3C,iDAAmD;AACnD,qGAA6E;AAC7E,6EAAqD;AAErD,qEAAkE;AAClE,yDAAsD;AACtD,iFAA8E;AAE9E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;I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AAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QACxE,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,GAAG,IAAA,wBAAc,EAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,cAAc;YACpD,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gDAA0D;AAC1D,gEAAqC;AAIrC,2CAOqB;AAQrB,uCAA2C;AAC3C,iDAAmD;AACnD,qGAA6E;AAC7E,6EAAqD;AAErD,qEAAkE;AAClE,yDAAsD;AACtD,iFAA8E;AAE9E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAE1C,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAQ,oBAAQ,EAAE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V,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,GAAG,IAAA,wBAAc,EAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,cAAc;YACpD,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -8,5 +8,4 @@ export declare const cachePrefix = "sharky";
8
8
  export declare const sharkyProgram: PublicKey;
9
9
  export declare const loanDataSize = 338;
10
10
  export declare const orderBookDataSize = 10240;
11
- export declare const collectionRefreshInterval = 3600000;
12
11
  export declare const sharkyIdlItem: IdlItem;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sharkyIdlItem = exports.collectionRefreshInterval = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
3
+ exports.sharkyIdlItem = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const idl_1 = require("./idl");
6
6
  exports.platformId = 'sharky';
7
7
  exports.platform = {
8
8
  id: exports.platformId,
9
9
  name: 'Sharky',
10
- image: 'https://sonar.watch/img/platforms/sharki.webp',
11
- website: 'https://sharki.fi/',
10
+ image: 'https://sonar.watch/img/platforms/sharky.webp',
11
+ website: 'https://sharky.fi/',
12
12
  twitter: 'https://twitter.com/SharkyFi',
13
13
  defiLlamaId: 'sharky', // from https://defillama.com/docs/api
14
14
  };
@@ -17,7 +17,6 @@ exports.cachePrefix = `${exports.platformId}`;
17
17
  exports.sharkyProgram = new web3_js_1.PublicKey('SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP');
18
18
  exports.loanDataSize = 338;
19
19
  exports.orderBookDataSize = 10240;
20
- exports.collectionRefreshInterval = 3600000;
21
20
  exports.sharkyIdlItem = {
22
21
  programId: exports.sharkyProgram.toString(),
23
22
  idl: idl_1.SharkyIDL,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAC1B,QAAA,yBAAyB,GAAG,OAAO,CAAC;AAEpC,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,eAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAE1B,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,eAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC"}
@@ -22,8 +22,12 @@ const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
22
22
  const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
23
23
  const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
24
24
  const filters_1 = require("./filters");
25
- const collections = new Map();
26
- let collectionLastUpdate = 0;
25
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
26
+ const arrayToMap_1 = require("../../utils/misc/arrayToMap");
27
+ const collectionsMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsCacheKey, {
28
+ prefix: constants_1.cachePrefix,
29
+ networkId: portfolio_core_1.NetworkId.solana,
30
+ }, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'orderBook'));
27
31
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
28
32
  const dasUrl = (0, getSolanaDasEndpoint_1.default)();
29
33
  const connection = (0, clients_1.getClientSolana)();
@@ -35,26 +39,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
35
39
  ])).flat();
36
40
  if (accounts.length === 0)
37
41
  return [];
38
- const [solTokenPrice, heliusAssets] = yield Promise.all([
42
+ const [solTokenPrice, heliusAssets, collections] = yield Promise.all([
39
43
  cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana),
40
44
  (0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, accounts
41
45
  .map((acc) => { var _a; return (_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint; })
42
46
  .filter((mint) => mint)),
47
+ collectionsMemo.getItem(cache),
43
48
  ]);
44
- if (!solTokenPrice)
49
+ if (!solTokenPrice || !collections)
45
50
  return [];
46
- if (collectionLastUpdate + constants_1.collectionRefreshInterval < Date.now()) {
47
- const collectionsArr = yield cache.getItem(constants_1.collectionsCacheKey, {
48
- prefix: constants_1.cachePrefix,
49
- networkId: portfolio_core_1.NetworkId.solana,
50
- });
51
- if (collectionsArr) {
52
- collectionsArr.forEach((cc) => {
53
- collections.set(cc.orderBook, cc);
54
- });
55
- }
56
- collectionLastUpdate = Date.now();
57
- }
58
51
  const elements = [];
59
52
  accounts.forEach((acc) => {
60
53
  var _a;
@@ -107,13 +100,21 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
107
100
  }
108
101
  if (suppliedAssets.length === 0)
109
102
  return;
110
- const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, []);
103
+ const { borrowedValue, suppliedValue, rewardValue, value } = (0, portfolio_core_1.getElementNFTLendingValues)({
104
+ suppliedAssets,
105
+ borrowedAssets,
106
+ rewardAssets: [],
107
+ lender: acc.loanState.offer !== undefined ||
108
+ (acc.loanState.taken
109
+ ? acc.loanState.taken.taken.lenderNoteMint === owner.toString()
110
+ : false),
111
+ });
111
112
  elements.push({
112
113
  networkId: portfolio_core_1.NetworkId.solana,
113
114
  label: 'Lending',
114
115
  platformId: constants_1.platformId,
115
116
  type: portfolio_core_1.PortfolioElementType.borrowlend,
116
- value: suppliedValue,
117
+ value,
117
118
  name,
118
119
  data: {
119
120
  borrowedAssets,
@@ -124,8 +125,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
124
125
  suppliedYields: [],
125
126
  rewardAssets: [],
126
127
  rewardValue,
127
- healthRatio,
128
- value: suppliedValue,
128
+ healthRatio: null,
129
+ value,
129
130
  expireOn: acc.loanState.taken
130
131
  ? Number(acc.loanState.taken.taken.terms.time.start) +
131
132
  Number(acc.loanState.taken.taken.terms.time.duration)
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAkE;AAElE,qGAA6E;AAC7E,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AACrG,uCAA2C;AAE3C,MAAM,WAAW,GAA4B,IAAI,GAAG,EAAE,CAAC;AACvD,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,CACf,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAAO,UAAU,EAAE,yBAAa,EAAE,OAAO,CAAC;QACtE,I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,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK;oBAC3B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;wBAClD,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;oBACvD,CAAC,CAAC,SAAS;aACd;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -132,7 +132,13 @@ function getElementsFromObligations(obligations, reserveByAddress, marketByAddre
132
132
  }
133
133
  if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
134
134
  continue;
135
- const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
135
+ const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
136
+ suppliedAssets,
137
+ borrowedAssets,
138
+ rewardAssets,
139
+ suppliedLtvs,
140
+ borrowedWeights,
141
+ });
136
142
  elements.push({
137
143
  type: portfolio_core_1.PortfolioElementType.borrowlend,
138
144
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkE;AAClE,+DASoC;AACpC,6CAAyD;AACzD,gEAAqC;AACrC,uCAImB;AAGnB,2CAAsD;AACtD,qGAA6E;AAC7E,6DAA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,eAAe,CAChB,CAAC;QAEJ,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;AAlKD,gEAkKC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkE;AAClE,+DASoC;AACpC,6CAAyD;AACzD,gEAAqC;AACrC,uCAImB;AAGnB,2CAAsD;AACtD,qGAA6E;AAC7E,6DAAiE;AAE1D,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,C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AAG,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,GAAG,GAAG,CAAC;oBACpD,MAAM,eAAe,GAAY;wBAC/B;4BACE,GAAG,EAAE,CAAC,IAAA,yBAAQ,EAAC,GAAG,CAAC;4BACnB,GAAG,EAAE,CAAC,GAAG;yBACV;qBACF,CAAC;oBACF,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;oBACrC,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,KAAK,EACL,cAAc,EACd,0BAAS,CAAC,MAAM,EAChB,WAAW,EACX,KAAK,CACN,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,cAAc,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;AAlKD,gEAkKC"}
@@ -171,7 +171,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
171
171
  borrowedAssets.length === 0 &&
172
172
  rewardAssets.length === 0)
173
173
  return [];
174
- const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
174
+ const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
175
+ suppliedAssets,
176
+ borrowedAssets,
177
+ rewardAssets,
178
+ suppliedLtvs,
179
+ borrowedWeights,
180
+ });
175
181
  const element = {
176
182
  type: portfolio_core_1.PortfolioElementType.borrowlend,
177
183
  networkId: portfolio_core_1.NetworkId.sui,