@sonarwatch/portfolio-plugins 0.12.174 → 0.12.177

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/CHANGELOG.md +1510 -1498
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/index.js +4 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/bluemove/constants.js +1 -1
  8. package/src/plugins/bluemove/constants.js.map +1 -1
  9. package/src/plugins/cetus/constants.js +1 -1
  10. package/src/plugins/cetus/constants.js.map +1 -1
  11. package/src/plugins/drift/constants.js +1 -1
  12. package/src/plugins/drift/constants.js.map +1 -1
  13. package/src/plugins/elemental/constants.d.ts +6 -0
  14. package/src/plugins/elemental/constants.js +20 -0
  15. package/src/plugins/elemental/constants.js.map +1 -0
  16. package/src/plugins/elemental/depositFetcher.d.ts +5 -0
  17. package/src/plugins/elemental/depositFetcher.js +96 -0
  18. package/src/plugins/elemental/depositFetcher.js.map +1 -0
  19. package/src/plugins/elemental/elementalVaultIDL.d.ts +67 -0
  20. package/src/plugins/elemental/elementalVaultIDL.js +342 -0
  21. package/src/plugins/elemental/elementalVaultIDL.js.map +1 -0
  22. package/src/plugins/elemental/filters.d.ts +3 -0
  23. package/src/plugins/elemental/filters.js +21 -0
  24. package/src/plugins/elemental/filters.js.map +1 -0
  25. package/src/plugins/elemental/helpers.d.ts +5 -0
  26. package/src/plugins/elemental/helpers.js +29 -0
  27. package/src/plugins/elemental/helpers.js.map +1 -0
  28. package/src/plugins/elemental/index.d.ts +6 -0
  29. package/src/plugins/elemental/index.js +13 -0
  30. package/src/plugins/elemental/index.js.map +1 -0
  31. package/src/plugins/elemental/poolsJob.d.ts +3 -0
  32. package/src/plugins/elemental/poolsJob.js +35 -0
  33. package/src/plugins/elemental/poolsJob.js.map +1 -0
  34. package/src/plugins/elemental/structs.d.ts +48 -0
  35. package/src/plugins/elemental/structs.js +50 -0
  36. package/src/plugins/elemental/structs.js.map +1 -0
  37. package/src/plugins/elemental/types.d.ts +37 -0
  38. package/src/plugins/elemental/types.js +3 -0
  39. package/src/plugins/elemental/types.js.map +1 -0
  40. package/src/plugins/hawksight/constants.js +1 -1
  41. package/src/plugins/hawksight/constants.js.map +1 -1
  42. package/src/plugins/hedgehog/constants.js +1 -1
  43. package/src/plugins/hedgehog/constants.js.map +1 -1
  44. package/src/plugins/jewel/constants.js +1 -0
  45. package/src/plugins/jewel/constants.js.map +1 -1
  46. package/src/plugins/kriya/constants.js +1 -1
  47. package/src/plugins/kriya/constants.js.map +1 -1
  48. package/src/plugins/sandglass/depositFetcher.js +7 -2
  49. package/src/plugins/sandglass/depositFetcher.js.map +1 -1
  50. package/src/plugins/sandglass/marketsJob.js +22 -1
  51. package/src/plugins/sandglass/marketsJob.js.map +1 -1
  52. package/src/plugins/stabble/constants.js +1 -1
  53. package/src/plugins/sushiswap/helpers.js +24 -24
  54. package/src/plugins/typus/constants.js +1 -1
  55. package/src/plugins/typus/constants.js.map +1 -1
  56. package/src/plugins/uniswap-v2/helpers.js +22 -22
  57. package/src/plugins/zeta/airdropFetcher.js +14 -14
  58. package/src/utils/elementbuilder/AssetBuilder.d.ts +2 -1
  59. package/src/utils/elementbuilder/AssetBuilder.js +2 -1
  60. package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
  61. package/src/utils/elementbuilder/PortfolioAssetParams.d.ts +2 -0
  62. package/src/utils/sei/constants.js +8 -8
  63. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -9,7 +9,7 @@ exports.platform = {
9
9
  image: 'https://sonar.watch/img/platforms/hedgehog.webp',
10
10
  website: 'https://hedgehog.markets',
11
11
  twitter: 'https://twitter.com/HedgehogMarket',
12
- // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
12
+ defiLlamaId: 'hedgehog-markets', // from https://defillama.com/docs/api
13
13
  };
14
14
  exports.ammPid = new web3_js_1.PublicKey('Hr4whNgXr3yZsJvx3TVSwfsFgXuSEPB1xKmvgrtLhsrM');
15
15
  exports.swapPid = new web3_js_1.PublicKey('2ZznCMfx2XP43zaPw9R9wKnjXWiEeEexyhdBPv3UqDtD');
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,WAAW,EAAE,kBAAkB,EAAE,sCAAsC;CACxE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
@@ -8,6 +8,7 @@ exports.platform = {
8
8
  name: 'Jewel Swap',
9
9
  image: 'https://sonar.watch/img/platforms/jewel.webp',
10
10
  website: 'https://sui.jewelswap.io/',
11
+ defiLlamaId: 'parent#jewelswap',
11
12
  twitter: 'https://twitter.com/JewelSwapX',
12
13
  };
13
14
  exports.marketsCachePrefix = `${exports.platformId}-markets`;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jewel/constants.ts"],"names":[],"mappings":";;;AAAA,+DAAwE;AAE3D,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,gCAAgC;CAC1C,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC;AAE7C,QAAA,MAAM,GACjB,oFAAoF,CAAC;AAC1E,QAAA,oBAAoB,GAC/B,oEAAoE,CAAC;AAE1D,QAAA,oBAAoB,GAC/B,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GACjC,oEAAoE,CAAC;AAE1D,QAAA,gBAAgB,GAAG;IAC9B;QACE,KAAK,EACH,oFAAoF;QACtF,UAAU,EACR,8EAA8E;QAChF,QAAQ,EACN,oEAAoE;KACvE;IACD;QACE,KAAK,EAAE,cAAM;QACb,UAAU,EAAE,iCAAgB;QAC5B,QAAQ,EACN,oEAAoE;KACvE;IACD;QACE,KAAK,EACH,wFAAwF;QAC1F,UAAU,EACR,kFAAkF;QACpF,QAAQ,EACN,oEAAoE;KACvE;CACF,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jewel/constants.ts"],"names":[],"mappings":";;;AAAA,+DAAwE;AAE3D,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,gCAAgC;CAC1C,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC;AAE7C,QAAA,MAAM,GACjB,oFAAoF,CAAC;AAC1E,QAAA,oBAAoB,GAC/B,oEAAoE,CAAC;AAE1D,QAAA,oBAAoB,GAC/B,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GACjC,oEAAoE,CAAC;AAE1D,QAAA,gBAAgB,GAAG;IAC9B;QACE,KAAK,EACH,oFAAoF;QACtF,UAAU,EACR,8EAA8E;QAChF,QAAQ,EACN,oEAAoE;KACvE;IACD;QACE,KAAK,EAAE,cAAM;QACb,UAAU,EAAE,iCAAgB;QAC5B,QAAQ,EACN,oEAAoE;KACvE;IACD;QACE,KAAK,EACH,wFAAwF;QAC1F,UAAU,EACR,kFAAkF;QACpF,QAAQ,EACN,oEAAoE;KACvE;CACF,CAAC"}
@@ -6,7 +6,7 @@ exports.platform = {
6
6
  id: exports.platformId,
7
7
  name: 'Kriya',
8
8
  image: 'https://sonar.watch/img/platforms/kriya.webp',
9
- defiLlamaId: 'kriya-swap', // from https://defillama.com/docs/api
9
+ defiLlamaId: 'parent#kriyadex', // from https://defillama.com/docs/api
10
10
  website: 'https://www.app.kriya.finance/',
11
11
  twitter: 'https://twitter.com/KriyaDEX',
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,YAAY,EAAE,sCAAsC;IACjE,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAE1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,YAAY,GAAG,YAAY,CAAC;AAE5B,QAAA,SAAS,GACpB,4EAA4E,CAAC;AAClE,QAAA,QAAQ,GACnB,2EAA2E,CAAC;AACjE,QAAA,iBAAiB,GAC5B,4EAA4E,CAAC;AAElE,QAAA,iBAAiB,GAAG;IAC/B,wGAAwG;CACzG,CAAC;AAEW,QAAA,UAAU,GAAgB;IACrC;QACE,SAAS,EACP,wGAAwG;QAC1G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,4GAA4G;QAC9G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,8FAA8F;QAChG,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;CACF,CAAC;AAEW,QAAA,wBAAwB,GACnC,+HAA+H,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,iBAAiB,EAAE,sCAAsC;IACtE,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAE1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,YAAY,GAAG,YAAY,CAAC;AAE5B,QAAA,SAAS,GACpB,4EAA4E,CAAC;AAClE,QAAA,QAAQ,GACnB,2EAA2E,CAAC;AACjE,QAAA,iBAAiB,GAC5B,4EAA4E,CAAC;AAElE,QAAA,iBAAiB,GAAG;IAC/B,wGAAwG;CACzG,CAAC;AAEW,QAAA,UAAU,GAAgB;IACrC;QACE,SAAS,EACP,wGAAwG;QAC1G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,4GAA4G;QAC9G,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;IACD;QACE,SAAS,EACP,8FAA8F;QAChG,EAAE,EAAE,oEAAoE;QACxE,cAAc,EACZ,oEAAoE;KACvE;CACF,CAAC;AAEW,QAAA,wBAAwB,GACnC,+HAA+H,CAAC"}
@@ -36,7 +36,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
36
36
  .map((marketInfo) => [
37
37
  marketInfo.ptMint,
38
38
  marketInfo.ytMint,
39
- // marketInfo.lpMint,
39
+ marketInfo.lpMint,
40
40
  // marketInfo.syMint,
41
41
  ])
42
42
  .flat();
@@ -46,9 +46,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
46
46
  const market = marketInfoById.get(account.marketAccount.toString());
47
47
  if (!market)
48
48
  continue;
49
- const { stakePtAmount, stakeYtAmount } = account.stakeInfo;
49
+ const { stakePtAmount, stakeYtAmount, stakeLpAmount } = account.stakeInfo;
50
50
  const ptPrice = tokenPriceById.get(market.ptMint);
51
51
  const ytPrice = tokenPriceById.get(market.ytMint);
52
+ const lpPrice = tokenPriceById.get(market.lpMint);
52
53
  if (ptPrice && !stakePtAmount.isZero()) {
53
54
  const amount = stakePtAmount.dividedBy(Math.pow(10, ptPrice.decimals)).toNumber();
54
55
  assets.push((0, tokenPriceToAssetToken_1.default)(market.ptMint, amount, portfolio_core_1.NetworkId.solana, ptPrice));
@@ -57,6 +58,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
57
58
  const amount = stakeYtAmount.dividedBy(Math.pow(10, ytPrice.decimals)).toNumber();
58
59
  assets.push((0, tokenPriceToAssetToken_1.default)(market.ytMint, amount, portfolio_core_1.NetworkId.solana, ytPrice));
59
60
  }
61
+ if (lpPrice && !stakeLpAmount.isZero()) {
62
+ const amount = stakeLpAmount.dividedBy(Math.pow(10, lpPrice.decimals)).toNumber();
63
+ assets.push((0, tokenPriceToAssetToken_1.default)(market.lpMint, amount, portfolio_core_1.NetworkId.solana, lpPrice));
64
+ }
60
65
  }
61
66
  if (assets.length === 0)
62
67
  return [];
@@ -1 +1 @@
1
- {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAmD;AACnD,uCAA+C;AAE/C,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,gCAAsB,EACtB,qBAAS,EACT,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAC1B,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,0BAAc,EAAE;QACrE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,cAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC1D,YAAY,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAClC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC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C,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC1E,MAAM,CAAC,IAAI,CACT,IAAA,gCAAsB,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,0BAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CACzE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzD,IAAI,EAAE;gBACJ,MAAM;aACP;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAmD;AACnD,uCAA+C;AAE/C,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,gCAAsB,EACtB,qBAAS,EACT,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAC1B,CAAC;IAEF,IAAI,QAA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AU,EAAV,sBAAU;YACV,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzD,IAAI,EAAE;gBACJ,MAAM;aACP;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -20,8 +20,9 @@ const constants_1 = require("./constants");
20
20
  const structs_1 = require("./structs");
21
21
  const filters_1 = require("./filters");
22
22
  const constants_2 = require("../tokens/constants");
23
+ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
23
24
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
24
- var _a, _b;
25
+ var _a, _b, _c;
25
26
  const client = (0, clients_1.getClientSolana)();
26
27
  const markets = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.marketStruct, constants_1.programId, filters_1.marketAccountFilters);
27
28
  const mints = markets
@@ -50,8 +51,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
50
51
  const ytPrice = new bignumber_js_1.default(1).minus(ptPrice);
51
52
  const ptMint = market.tokenPtMintAddress;
52
53
  const ytMint = market.tokenYtMintAddress;
54
+ const lpMint = market.tokenLpMintAddress;
53
55
  const ptDecimals = (_a = mintsInfoById.get(ptMint.toString())) === null || _a === void 0 ? void 0 : _a.decimals;
54
56
  const ytDecimals = (_b = mintsInfoById.get(ytMint.toString())) === null || _b === void 0 ? void 0 : _b.decimals;
57
+ const lpDecimals = (_c = mintsInfoById.get(lpMint.toString())) === null || _c === void 0 ? void 0 : _c.decimals;
55
58
  if (ptDecimals)
56
59
  sources.push({
57
60
  address: ptMint.toString(),
@@ -74,6 +77,24 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
74
77
  timestamp: Date.now(),
75
78
  weight: 1,
76
79
  });
80
+ const lpSupply = (yield client.getTokenSupply(lpMint)).value.uiAmount;
81
+ const lpUnderlyingTokenAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, solana_1.tokenAccountStruct, market.vaultLpTokenAccount);
82
+ if (lpSupply && lpUnderlyingTokenAccount && lpDecimals) {
83
+ const lpPrice = lpUnderlyingTokenAccount.amount
84
+ .dividedBy(Math.pow(10, baseTokenPrice.decimals))
85
+ .times(baseTokenPrice.price)
86
+ .dividedBy(lpSupply);
87
+ sources.push({
88
+ address: lpMint.toString(),
89
+ decimals: lpDecimals,
90
+ id: market.pubkey.toString(),
91
+ networkId: portfolio_core_1.NetworkId.solana,
92
+ platformId: constants_2.walletTokensPlatform.id,
93
+ price: lpPrice.toNumber(),
94
+ timestamp: Date.now(),
95
+ weight: 1,
96
+ });
97
+ }
77
98
  marketsInfos.push({
78
99
  pubkey: market.pubkey.toString(),
79
100
  ytMint: market.tokenYtMintAddress.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAyE;AAGzE,iDAAsD;AACtD,+CAK4B;AAC5B,2CAAoE;AACpE,uCAAyC;AACzC,uCAAiD;AAEjD,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAwB,EAC5C,MAAM,EACN,sBAAY,EACZ,qBAAS,EACT,8BAAoB,CACrB,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO;SAClB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,kBAAkB;Q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AU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -6,7 +6,7 @@ const weightedIdl_1 = require("./weightedIdl");
6
6
  exports.platformId = 'stabble';
7
7
  exports.platform = {
8
8
  id: exports.platformId,
9
- name: 'Stabble',
9
+ name: 'stabble',
10
10
  image: 'https://sonar.watch/img/platforms/stabble.webp',
11
11
  website: 'https://app.stabble.org/',
12
12
  twitter: 'https://x.com/stabbleorg',
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -6,7 +6,7 @@ exports.platform = {
6
6
  id: exports.platformId,
7
7
  name: 'Typus',
8
8
  image: 'https://sonar.watch/img/platforms/typus.webp',
9
- defiLlamaId: 'typus-finance', // from https://defillama.com/docs/api
9
+ defiLlamaId: 'parent#typus-finance', // from https://defillama.com/docs/api
10
10
  website: 'https://typus.finance/',
11
11
  twitter: 'https://twitter.com/TypusFinance',
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/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,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC;AAEzF,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,QAAA,eAAe,GAA8B;IACxD,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,kBAAkB;CACxB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/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,WAAW,EAAE,sBAAsB,EAAE,sCAAsC;IAC3E,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC;AAEzF,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,QAAA,eAAe,GAA8B;IACxD,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,kBAAkB;CACxB,CAAC"}
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,10 +1,11 @@
1
- import { NetworkIdType, PortfolioAsset } from '@sonarwatch/portfolio-core';
1
+ import { NetworkIdType, PortfolioAsset, PortfolioAssetAttributes } from '@sonarwatch/portfolio-core';
2
2
  import BigNumber from 'bignumber.js';
3
3
  import { PortfolioAssetParams } from './PortfolioAssetParams';
4
4
  import { TokenPriceMap } from '../../TokenPriceMap';
5
5
  export declare class AssetBuilder {
6
6
  address: string;
7
7
  amount: number | BigNumber | string;
8
+ attributes: PortfolioAssetAttributes;
8
9
  alreadyShifted: boolean;
9
10
  constructor(params: PortfolioAssetParams);
10
11
  get(networkId: NetworkIdType, tokenPrices: TokenPriceMap): PortfolioAsset | null;
@@ -10,6 +10,7 @@ class AssetBuilder {
10
10
  constructor(params) {
11
11
  this.address = params.address.toString();
12
12
  this.amount = params.amount;
13
+ this.attributes = params.attributes || {};
13
14
  this.alreadyShifted = params.alreadyShifted || false;
14
15
  }
15
16
  get(networkId, tokenPrices) {
@@ -21,7 +22,7 @@ class AssetBuilder {
21
22
  return null;
22
23
  if (!this.alreadyShifted)
23
24
  amount = amount.dividedBy(Math.pow(10, tokenPrice.decimals));
24
- return (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice);
25
+ return (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes);
25
26
  }
26
27
  }
27
28
  exports.AssetBuilder = AssetBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AACA,gEAAqC;AAErC,4FAAoE;AAGpE,MAAa,YAAY;IAKvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B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OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,gCAAsB,EAC3B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;CACF;AAlCD,oCAkCC"}
@@ -1,7 +1,9 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { PublicKey } from '@solana/web3.js';
3
+ import { PortfolioAssetAttributes } from '@sonarwatch/portfolio-core';
3
4
  export type PortfolioAssetParams = {
4
5
  address: string | PublicKey;
5
6
  amount: number | BigNumber | string;
7
+ attributes?: PortfolioAssetAttributes;
6
8
  alreadyShifted?: boolean;
7
9
  };
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;