@sonarwatch/portfolio-plugins 0.11.160 → 0.11.162

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/CHANGELOG.md +1375 -1367
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +8 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/banx/constants.d.ts +8 -0
  8. package/src/plugins/banx/constants.js +18 -0
  9. package/src/plugins/banx/constants.js.map +1 -0
  10. package/src/plugins/banx/filters.d.ts +2 -0
  11. package/src/plugins/banx/filters.js +14 -0
  12. package/src/plugins/banx/filters.js.map +1 -0
  13. package/src/plugins/banx/index.d.ts +6 -0
  14. package/src/plugins/banx/index.js +12 -0
  15. package/src/plugins/banx/index.js.map +1 -0
  16. package/src/plugins/banx/stakingFetcher.js +65 -0
  17. package/src/plugins/banx/stakingFetcher.js.map +1 -0
  18. package/src/plugins/banx/structs.d.ts +26 -0
  19. package/src/plugins/banx/structs.js +29 -0
  20. package/src/plugins/banx/structs.js.map +1 -0
  21. package/src/plugins/banx/types.d.ts +65 -0
  22. package/src/plugins/banx/types.js +3 -0
  23. package/src/plugins/banx/types.js.map +1 -0
  24. package/src/plugins/flash/custodiesJob.js +1 -1
  25. package/src/plugins/flash/custodiesJob.js.map +1 -1
  26. package/src/plugins/flash/perpetualFetcher.js +3 -3
  27. package/src/plugins/flash/perpetualFetcher.js.map +1 -1
  28. package/src/plugins/flash/structs.d.ts +1 -1
  29. package/src/plugins/flash/types.d.ts +1 -1
  30. package/src/plugins/jupiter/exchange/constants.d.ts +11 -0
  31. package/src/plugins/jupiter/exchange/constants.js +21 -0
  32. package/src/plugins/jupiter/exchange/constants.js.map +1 -0
  33. package/src/plugins/jupiter/{custodiesJob.d.ts → exchange/custodiesJob.d.ts} +1 -1
  34. package/src/plugins/jupiter/{custodiesJob.js → exchange/custodiesJob.js} +5 -5
  35. package/src/plugins/jupiter/exchange/custodiesJob.js.map +1 -0
  36. package/src/plugins/{orders/jupiter → jupiter/exchange}/dcaFetcher.js +7 -10
  37. package/src/plugins/jupiter/exchange/dcaFetcher.js.map +1 -0
  38. package/src/plugins/jupiter/exchange/filters.d.ts +4 -0
  39. package/src/plugins/jupiter/exchange/filters.js +46 -0
  40. package/src/plugins/jupiter/exchange/filters.js.map +1 -0
  41. package/src/plugins/{orders/jupiter → jupiter/exchange}/limitFetcher.js +10 -20
  42. package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -0
  43. package/src/plugins/jupiter/{perpetualFetcher.d.ts → exchange/perpetualFetcher.d.ts} +1 -1
  44. package/src/plugins/jupiter/{perpetualFetcher.js → exchange/perpetualFetcher.js} +16 -16
  45. package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -0
  46. package/src/plugins/jupiter/{poolJob.d.ts → exchange/poolJob.d.ts} +1 -1
  47. package/src/plugins/jupiter/{poolJob.js → exchange/poolJob.js} +5 -5
  48. package/src/plugins/jupiter/exchange/poolJob.js.map +1 -0
  49. package/src/plugins/jupiter/{structs/perpetuals.d.ts → exchange/structs.d.ts} +71 -1
  50. package/src/plugins/jupiter/{structs/perpetuals.js → exchange/structs.js} +69 -2
  51. package/src/plugins/jupiter/exchange/structs.js.map +1 -0
  52. package/src/plugins/jupiter/{valueAverageFetcher.d.ts → exchange/valueAverageFetcher.d.ts} +1 -1
  53. package/src/plugins/jupiter/{valueAverageFetcher.js → exchange/valueAverageFetcher.js} +8 -8
  54. package/src/plugins/jupiter/exchange/valueAverageFetcher.js.map +1 -0
  55. package/src/plugins/jupiter/filters.d.ts +0 -1
  56. package/src/plugins/jupiter/filters.js +1 -11
  57. package/src/plugins/jupiter/filters.js.map +1 -1
  58. package/src/plugins/jupiter/governance/constants.d.ts +3 -0
  59. package/src/plugins/jupiter/governance/constants.js +12 -0
  60. package/src/plugins/jupiter/governance/constants.js.map +1 -0
  61. package/src/plugins/jupiter/{voteFetcher.d.ts → governance/voteFetcher.d.ts} +1 -1
  62. package/src/plugins/jupiter/{voteFetcher.js → governance/voteFetcher.js} +10 -9
  63. package/src/plugins/jupiter/governance/voteFetcher.js.map +1 -0
  64. package/src/plugins/jupiter/helpers.js +1 -1
  65. package/src/plugins/jupiter/helpers.js.map +1 -1
  66. package/src/plugins/jupiter/index.js +19 -9
  67. package/src/plugins/jupiter/index.js.map +1 -1
  68. package/src/plugins/jupiter/launchpad/allocationsFetcher.d.ts +3 -0
  69. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +79 -0
  70. package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -0
  71. package/src/plugins/jupiter/{constants.d.ts → launchpad/constants.d.ts} +10 -9
  72. package/src/plugins/jupiter/launchpad/constants.js +31 -0
  73. package/src/plugins/jupiter/launchpad/constants.js.map +1 -0
  74. package/src/plugins/jupiter/{structs/vote.d.ts → launchpad/structs.d.ts} +10 -0
  75. package/src/plugins/jupiter/{structs/vote.js → launchpad/structs.js} +11 -2
  76. package/src/plugins/jupiter/launchpad/structs.js.map +1 -0
  77. package/src/plugins/jupiter/pricingJob.js +1 -1
  78. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  79. package/src/plugins/meteora/dlmmHelper.d.ts +6 -5
  80. package/src/plugins/meteora/dlmmHelper.js +107 -83
  81. package/src/plugins/meteora/dlmmHelper.js.map +1 -1
  82. package/src/plugins/meteora/types.d.ts +8 -0
  83. package/src/plugins/orders/index.js +16 -23
  84. package/src/plugins/orders/index.js.map +1 -1
  85. package/src/plugins/sushiswap/helpers.js +24 -24
  86. package/src/plugins/uniswap-v2/helpers.js +22 -22
  87. package/src/plugins/wormhole/airdropFetcher.d.ts +3 -0
  88. package/src/plugins/wormhole/airdropFetcher.js +52 -0
  89. package/src/plugins/wormhole/airdropFetcher.js.map +1 -0
  90. package/src/plugins/wormhole/constants.d.ts +6 -0
  91. package/src/plugins/wormhole/constants.js +15 -0
  92. package/src/plugins/wormhole/constants.js.map +1 -0
  93. package/src/plugins/wormhole/helpers.d.ts +4 -0
  94. package/src/plugins/wormhole/helpers.js +45 -0
  95. package/src/plugins/wormhole/helpers.js.map +1 -0
  96. package/src/plugins/wormhole/index.d.ts +6 -0
  97. package/src/plugins/wormhole/index.js +8 -0
  98. package/src/plugins/wormhole/index.js.map +1 -0
  99. package/src/plugins/wormhole/types.d.ts +9 -0
  100. package/src/plugins/wormhole/types.js +3 -0
  101. package/src/plugins/wormhole/types.js.map +1 -0
  102. package/src/utils/sei/constants.js +8 -8
  103. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  104. package/src/plugins/jupiter/airdropFetcher.js +0 -63
  105. package/src/plugins/jupiter/airdropFetcher.js.map +0 -1
  106. package/src/plugins/jupiter/constants.js +0 -25
  107. package/src/plugins/jupiter/constants.js.map +0 -1
  108. package/src/plugins/jupiter/custodiesJob.js.map +0 -1
  109. package/src/plugins/jupiter/perpetualFetcher.js.map +0 -1
  110. package/src/plugins/jupiter/poolJob.js.map +0 -1
  111. package/src/plugins/jupiter/structs/aidrop.d.ts +0 -14
  112. package/src/plugins/jupiter/structs/aidrop.js +0 -16
  113. package/src/plugins/jupiter/structs/aidrop.js.map +0 -1
  114. package/src/plugins/jupiter/structs/perpetuals.js.map +0 -1
  115. package/src/plugins/jupiter/structs/valueAverage.d.ts +0 -31
  116. package/src/plugins/jupiter/structs/valueAverage.js +0 -33
  117. package/src/plugins/jupiter/structs/valueAverage.js.map +0 -1
  118. package/src/plugins/jupiter/structs/vote.js.map +0 -1
  119. package/src/plugins/jupiter/valueAverageFetcher.js.map +0 -1
  120. package/src/plugins/jupiter/voteFetcher.js.map +0 -1
  121. package/src/plugins/orders/jupiter/constants.d.ts +0 -3
  122. package/src/plugins/orders/jupiter/constants.js +0 -7
  123. package/src/plugins/orders/jupiter/constants.js.map +0 -1
  124. package/src/plugins/orders/jupiter/dcaFetcher.js.map +0 -1
  125. package/src/plugins/orders/jupiter/filters.d.ts +0 -3
  126. package/src/plugins/orders/jupiter/filters.js +0 -36
  127. package/src/plugins/orders/jupiter/filters.js.map +0 -1
  128. package/src/plugins/orders/jupiter/limitFetcher.js.map +0 -1
  129. package/src/plugins/orders/jupiter/struct.d.ts +0 -47
  130. package/src/plugins/orders/jupiter/struct.js +0 -48
  131. package/src/plugins/orders/jupiter/struct.js.map +0 -1
  132. /package/src/plugins/{jupiter/airdropFetcher.d.ts → banx/stakingFetcher.d.ts} +0 -0
  133. /package/src/plugins/{orders/jupiter → jupiter/exchange}/dcaFetcher.d.ts +0 -0
  134. /package/src/plugins/{orders/jupiter → jupiter/exchange}/limitFetcher.d.ts +0 -0
@@ -13,18 +13,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const constants_1 = require("../constants");
17
16
  const clients_1 = require("../../../utils/clients");
18
17
  const solana_1 = require("../../../utils/solana");
19
- const struct_1 = require("./struct");
20
- const constants_2 = require("./constants");
21
- const filters_1 = require("./filters");
22
- const getTokensPricesMap_1 = __importDefault(require("../../../utils/misc/getTokensPricesMap"));
23
18
  const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
24
- const constants_3 = require("../../jupiter/constants");
19
+ const constants_1 = require("./constants");
20
+ const structs_1 = require("./structs");
21
+ const filters_1 = require("./filters");
25
22
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
23
  const client = (0, clients_1.getClientSolana)();
27
- const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.dcaStruct, constants_2.dcaProgramId, (0, filters_1.jupiterDCAFilter)(owner));
24
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.dcaStruct, constants_1.dcaProgramId, (0, filters_1.DCAFilters)(owner));
28
25
  if (accounts.length === 0)
29
26
  return [];
30
27
  const amountByToken = new Map();
@@ -40,7 +37,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
40
37
  amountByToken.set(inputMint, newAmount);
41
38
  }
42
39
  }
43
- const tokenPriceById = yield (0, getTokensPricesMap_1.default)(Array.from(amountByToken.keys()), portfolio_core_1.NetworkId.solana, cache);
40
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(amountByToken.keys()), portfolio_core_1.NetworkId.solana);
44
41
  const assets = [];
45
42
  for (const token of amountByToken.keys()) {
46
43
  const tokenPrice = tokenPriceById.get(token);
@@ -56,7 +53,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
56
53
  {
57
54
  type: 'multiple',
58
55
  networkId: portfolio_core_1.NetworkId.solana,
59
- platformId: constants_3.jupiterPlatform.id,
56
+ platformId: constants_1.jupiterPlatform.id,
60
57
  value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
61
58
  label: 'Deposit',
62
59
  name: `DCA Orders (${accounts.length})`,
@@ -65,7 +62,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
65
62
  ];
66
63
  });
67
64
  const fetcher = {
68
- id: `${constants_1.platformId}-jupiter-dca`,
65
+ id: `${constants_1.platformId}-dca`,
69
66
  networkId: portfolio_core_1.NetworkId.solana,
70
67
  executor,
71
68
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dcaFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/dcaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAIpC,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,2CAAwE;AACxE,uCAAsC;AACtC,uCAAuC;AAEvC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,mBAAS,EACT,wBAAY,EACZ,IAAA,oBAAU,EAAC,KAAK,CAAC,CAClB,CAAC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I,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EACtD,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,2BAAe,CAAC,EAAE;YAC9B,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzD,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,eAAe,QAAQ,CAAC,MAAM,GAAG;YACvC,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
+ export declare const limitFilters: (owner: string) => GetProgramAccountsFilter[];
3
+ export declare const DCAFilters: (owner: string) => GetProgramAccountsFilter[];
4
+ export declare const valueAverageFilters: (owner: string) => GetProgramAccountsFilter[];
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.valueAverageFilters = exports.DCAFilters = exports.limitFilters = void 0;
4
+ const structs_1 = require("./structs");
5
+ const limitFilters = (owner) => [
6
+ {
7
+ memcmp: {
8
+ offset: 0,
9
+ bytes: 'PXZJQQ2HEmx',
10
+ },
11
+ },
12
+ {
13
+ memcmp: {
14
+ offset: 104,
15
+ bytes: '2',
16
+ },
17
+ },
18
+ {
19
+ memcmp: {
20
+ offset: 8,
21
+ bytes: owner,
22
+ },
23
+ },
24
+ ];
25
+ exports.limitFilters = limitFilters;
26
+ const DCAFilters = (owner) => [
27
+ {
28
+ memcmp: {
29
+ offset: 8,
30
+ bytes: owner,
31
+ },
32
+ },
33
+ { dataSize: structs_1.dcaStruct.byteSize },
34
+ ];
35
+ exports.DCAFilters = DCAFilters;
36
+ const valueAverageFilters = (owner) => [
37
+ {
38
+ memcmp: {
39
+ offset: 18,
40
+ bytes: owner,
41
+ },
42
+ },
43
+ { dataSize: 339 },
44
+ ];
45
+ exports.valueAverageFilters = valueAverageFilters;
46
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/filters.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,aAAa;SACrB;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;SACX;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAnBW,QAAA,YAAY,gBAmBvB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,mBAAS,CAAC,QAAQ,EAAE;CACjC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,mBAAmB,uBAU9B"}
@@ -13,30 +13,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const constants_1 = require("../constants");
17
16
  const clients_1 = require("../../../utils/clients");
18
- const struct_1 = require("./struct");
19
17
  const solana_1 = require("../../../utils/solana");
20
- const filters_1 = require("./filters");
21
18
  const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
22
- const constants_2 = require("./constants");
23
- const constants_3 = require("../../jupiter/constants");
19
+ const constants_1 = require("./constants");
20
+ const structs_1 = require("./structs");
21
+ const filters_1 = require("./filters");
24
22
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
23
  const client = (0, clients_1.getClientSolana)();
26
- const limitOrdersAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.limitOrderStruct, constants_2.limitProgramId, (0, filters_1.jupiterLimitsFilter)(owner));
24
+ const limitOrdersAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.limitOrderStruct, constants_1.limitProgramId, (0, filters_1.limitFilters)(owner));
27
25
  if (limitOrdersAccounts.length === 0)
28
26
  return [];
29
- const tokensMints = new Set();
30
- for (let i = 0; i < limitOrdersAccounts.length; i += 1) {
31
- tokensMints.add(limitOrdersAccounts[i].inputMint.toString());
32
- }
33
- const tokenPriceResults = yield cache.getTokenPrices(Array.from(tokensMints), portfolio_core_1.NetworkId.solana);
34
- const tokenPriceById = new Map();
35
- tokenPriceResults.forEach((tP) => {
36
- if (!tP)
37
- return;
38
- tokenPriceById.set(tP.address, tP);
39
- });
27
+ const mints = new Set();
28
+ limitOrdersAccounts.forEach((account) => mints.add(account.inputMint.toString()));
29
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
40
30
  const rawAmountByMint = new Map();
41
31
  for (let i = 0; i < limitOrdersAccounts.length; i += 1) {
42
32
  const limOrder = limitOrdersAccounts[i];
@@ -63,16 +53,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
63
53
  const element = {
64
54
  type: 'multiple',
65
55
  networkId: portfolio_core_1.NetworkId.solana,
66
- platformId: constants_3.jupiterPlatform.id,
56
+ platformId: constants_1.platformId,
67
57
  value,
68
58
  label: 'Deposit',
69
- name: 'Limit Orders',
59
+ name: `Limit Orders (${limitOrdersAccounts.length})`,
70
60
  data: { assets },
71
61
  };
72
62
  return [element];
73
63
  });
74
64
  const fetcher = {
75
- id: `${constants_1.platformId}-jupiter-limit`,
65
+ id: `${constants_1.platformId}-limit`,
76
66
  networkId: portfolio_core_1.NetworkId.solana,
77
67
  executor,
78
68
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limitFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/limitFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAIpC,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,2CAAyD;AACzD,uCAA6C;AAC7C,uCAAyC;AAEzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,mBAAmB,GAAG,MAAM,IAAA,iCAAwB,EACxD,MAAM,EACN,0BAAgB,EAChB,0BAAc,EACd,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB,CAAC;IACF,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEhD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CACtC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CACxC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CAAC;QACnB,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,OAAO,GAA6B;QACxC,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,UAAU,EAAV,sBAAU;QACV,KAAK;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,iBAAiB,mBAAmB,CAAC,MAAM,GAAG;QACpD,IAAI,EAAE,EAAE,MAAM,EAAE;KACjB,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,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,3 +1,3 @@
1
- import { Fetcher } from '../../Fetcher';
1
+ import { Fetcher } from '../../../Fetcher';
2
2
  declare const fetcher: Fetcher;
3
3
  export default fetcher;
@@ -15,23 +15,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const web3_js_1 = require("@solana/web3.js");
18
- const constants_1 = require("./constants");
19
- const clients_1 = require("../../utils/clients");
20
- const solana_1 = require("../../utils/solana");
21
- const filters_1 = require("./filters");
22
- const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
23
- const helpers_1 = require("../../utils/solana/pyth/helpers");
24
- const constants_2 = require("../tokens/constants");
25
- const perpetuals_1 = require("./structs/perpetuals");
18
+ const clients_1 = require("../../../utils/clients");
19
+ const solana_1 = require("../../../utils/solana");
20
+ const filters_1 = require("../filters");
21
+ const getMultipleAccountsInfoSafe_1 = require("../../../utils/solana/getMultipleAccountsInfoSafe");
22
+ const helpers_1 = require("../../../utils/solana/pyth/helpers");
23
+ const constants_1 = require("../../tokens/constants");
24
+ const constants_2 = require("./constants");
25
+ const structs_1 = require("./structs");
26
26
  const usdFactor = new bignumber_js_1.default(Math.pow(10, 6));
27
27
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
28
28
  const client = (0, clients_1.getClientSolana)();
29
- const perpetualsPositions = yield (0, solana_1.getParsedProgramAccounts)(client, perpetuals_1.positionStruct, constants_1.perpsProgramId, (0, filters_1.perpetualsPositionsFilter)(owner));
29
+ const perpetualsPositions = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.positionStruct, constants_2.perpsProgramId, (0, filters_1.perpetualsPositionsFilter)(owner));
30
30
  if (perpetualsPositions.length === 0 ||
31
31
  !perpetualsPositions.some((perp) => perp.sizeUsd.isGreaterThan(0)))
32
32
  return [];
33
- const custodiesAccounts = yield cache.getItem(constants_1.custodiesKey, {
34
- prefix: constants_1.platformId,
33
+ const custodiesAccounts = yield cache.getItem(constants_2.custodiesKey, {
34
+ prefix: constants_2.platformId,
35
35
  networkId: portfolio_core_1.NetworkId.solana,
36
36
  });
37
37
  if (!custodiesAccounts)
@@ -45,15 +45,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
45
45
  const oracleAccounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, oraclesPubkeys);
46
46
  const pythPricesByAccount = (0, helpers_1.getPythPricesDatasMap)(oraclesPubkeys, oracleAccounts);
47
47
  const tokensDetailsById = new Map();
48
- const tokensDetails = yield cache.getItems(custodiesAccounts.map((acc) => acc.mint), { prefix: constants_2.tokenListsDetailsPrefix, networkId: portfolio_core_1.NetworkId.solana });
48
+ const tokensDetails = yield cache.getItems(custodiesAccounts.map((acc) => acc.mint), { prefix: constants_1.tokenListsDetailsPrefix, networkId: portfolio_core_1.NetworkId.solana });
49
49
  tokensDetails.forEach((tD) => tD ? tokensDetailsById.set(tD.address, tD) : undefined);
50
50
  const elements = [];
51
51
  for (const position of perpetualsPositions) {
52
52
  if (position.sizeUsd.isLessThanOrEqualTo(0))
53
53
  continue;
54
- if (position.side === perpetuals_1.Side.None)
54
+ if (position.side === structs_1.Side.None)
55
55
  continue;
56
- const isLong = position.side === perpetuals_1.Side.Long;
56
+ const isLong = position.side === structs_1.Side.Long;
57
57
  const custody = custodyById.get(position.custody.toString());
58
58
  const collateralCustody = custodyById.get(position.collateralCustody.toString());
59
59
  if (!custody || !collateralCustody)
@@ -137,7 +137,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
137
137
  elements.push({
138
138
  type: portfolio_core_1.PortfolioElementType.borrowlend,
139
139
  networkId: portfolio_core_1.NetworkId.solana,
140
- platformId: constants_1.platformId,
140
+ platformId: constants_2.platformId,
141
141
  label: 'Leverage',
142
142
  value,
143
143
  name: `${custodyName} ${side} ${leverage.decimalPlaces(2)}x`,
@@ -159,7 +159,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
159
159
  return elements;
160
160
  });
161
161
  const fetcher = {
162
- id: `${constants_1.platformId}-perpetual`,
162
+ id: `${constants_2.platformId}-perpetual`,
163
163
  networkId: portfolio_core_1.NetworkId.solana,
164
164
  executor,
165
165
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,oDAAyD;AACzD,kDAAiE;AACjE,wCAAuD;AAEvD,mGAAgG;AAChG,gEAA2E;AAC3E,sDAAiE;AACjE,2CAAuE;AACvE,uCAAiD;AAEjD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,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AAE,IAAI;gBAErB,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Job } from '../../Job';
1
+ import { Job } from '../../../Job';
2
2
  declare const job: Job;
3
3
  export default job;
@@ -14,16 +14,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
- const clients_1 = require("../../utils/clients");
18
- const solana_1 = require("../../utils/solana");
17
+ const clients_1 = require("../../../utils/clients");
18
+ const solana_1 = require("../../../utils/solana");
19
+ const structs_1 = require("./structs");
19
20
  const constants_1 = require("./constants");
20
- const perpetuals_1 = require("./structs/perpetuals");
21
21
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  const client = (0, clients_1.getClientSolana)();
23
- const poolAccount = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, perpetuals_1.perpetualPoolStruct, [constants_1.jlpPool]))[0];
23
+ const poolAccount = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.perpetualPoolStruct, [constants_1.jlpPool]))[0];
24
24
  if (!poolAccount)
25
25
  return;
26
- const custodiesAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, perpetuals_1.custodyStruct, poolAccount.custodies);
26
+ const custodiesAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.custodyStruct, poolAccount.custodies);
27
27
  const mints = [];
28
28
  const tokensAccountsAddresses = [];
29
29
  custodiesAccounts.forEach((acc) => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poolJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/poolJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAIrC,oDAAyD;AACzD,kDAG+B;AAC/B,uCAA+D;AAC/D,2CAA4D;AAE5D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,CAClB,MAAM,IAAA,sCAA6B,EAAC,MAAM,EAAE,6BAAmB,EAAE,CAAC,mBAAO,CAAC,CAAC,CAC5E,CAAC,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,iBAAiB,GAAG,MAAM,IAAA,sCAA6B,EAC3D,MAAM,EACN,uBAAa,EACb,WAAW,CAAC,SAAS,CACtB,CAAC;IAEF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,uBAAuB,GAAgB,EAAE,CAAC;IAChD,iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,IAAI,GAAG,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAChC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IAAI,WAAW,CAAC,SAAS,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO;IAE1D,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE5E,MAAM,YAAY,GAAiB,EAAE,CAAC;IACtC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,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AC9D,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;SAC7D,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEvB,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,WAAW,GAAG,IAAA,0DAAyC,EAC3D,YAAY,EACZ,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CACjE,CAAC;IACF,MAAM,KAAK,CAAC,mBAAmB,CAAC;QAC9B,OAAO,EAAE,oBAAQ,CAAC,QAAQ,EAAE;QAC5B,QAAQ,EAAE,CAAC;QACX,EAAE,EAAE,sBAAU;QACd,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,WAAW,EAAE,UAAU;QACvB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;QACvB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,MAAM,EAAE,CAAC;QACT,WAAW;KACZ,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -1,7 +1,77 @@
1
1
  /// <reference types="node" />
2
2
  import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
3
- import { PublicKey } from '@solana/web3.js';
4
3
  import BigNumber from 'bignumber.js';
4
+ import { PublicKey } from '@solana/web3.js';
5
+ export type LimitOrder = {
6
+ buffer: Buffer;
7
+ maker: PublicKey;
8
+ inputMint: PublicKey;
9
+ outputMint: PublicKey;
10
+ waiting: boolean;
11
+ oriMakingAmount: BigNumber;
12
+ oriTakingAmount: BigNumber;
13
+ makingAmount: BigNumber;
14
+ takingAmount: BigNumber;
15
+ makerInputAccount: PublicKey;
16
+ makerOutputAccount: PublicKey;
17
+ reserve: PublicKey;
18
+ uid: BigNumber;
19
+ expiredAt: BigNumber;
20
+ referral: PublicKey;
21
+ };
22
+ export declare const limitOrderStruct: BeetStruct<LimitOrder, Partial<LimitOrder>>;
23
+ export type DCA = {
24
+ buffer: Buffer;
25
+ user: PublicKey;
26
+ inputMint: PublicKey;
27
+ outputMint: PublicKey;
28
+ idx: BigNumber;
29
+ nextCycleAt: BigNumber;
30
+ inDeposited: BigNumber;
31
+ inWithdrawn: BigNumber;
32
+ outWithdrawn: BigNumber;
33
+ inUsed: BigNumber;
34
+ outReceived: BigNumber;
35
+ inAmountPerCycle: BigNumber;
36
+ cycleFrequency: BigNumber;
37
+ nextCycleAmountLeft: BigNumber;
38
+ inAccount: PublicKey;
39
+ outAccount: PublicKey;
40
+ minOutAmount: BigNumber;
41
+ maxOutAmount: BigNumber;
42
+ keeperInBalanceBeforeBorrow: BigNumber;
43
+ dcaOutBalanceBeforeSwap: BigNumber;
44
+ createdAt: BigNumber;
45
+ bump: number;
46
+ };
47
+ export declare const dcaStruct: BeetStruct<DCA, Partial<DCA>>;
48
+ export type ValueAverage = {
49
+ buffer: Buffer;
50
+ isStale: boolean;
51
+ idx: BigNumber;
52
+ bump: number;
53
+ user: PublicKey;
54
+ inputMint: PublicKey;
55
+ outputMint: PublicKey;
56
+ incrementUsdcValue: BigNumber;
57
+ orderInterval: BigNumber;
58
+ inputVault: PublicKey;
59
+ outputVault: PublicKey;
60
+ autoWithdraw: boolean;
61
+ feeDataAccount: PublicKey;
62
+ referralFeeAccount: PublicKey;
63
+ createdAt: BigNumber;
64
+ inDeposited: BigNumber;
65
+ inLeft: BigNumber;
66
+ inUsed: BigNumber;
67
+ inWithdrawn: BigNumber;
68
+ outReceived: BigNumber;
69
+ outWithdrawn: BigNumber;
70
+ supposedUsdcValue: BigNumber;
71
+ nextOrderAt: BigNumber;
72
+ outBalanceBeforeSwap: BigNumber;
73
+ };
74
+ export declare const valueAverageStruct: BeetStruct<ValueAverage, Partial<ValueAverage>>;
5
75
  export type Limit = {
6
76
  maxAumUsd: BigNumber;
7
77
  maxIndividualLpToken: BigNumber;
@@ -1,9 +1,76 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = void 0;
3
+ exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../../utils/solana");
7
+ exports.limitOrderStruct = new beet_1.BeetStruct([
8
+ ['buffer', (0, solana_1.blob)(8)],
9
+ ['maker', beet_solana_1.publicKey],
10
+ ['inputMint', beet_solana_1.publicKey],
11
+ ['outputMint', beet_solana_1.publicKey],
12
+ ['waiting', beet_1.bool],
13
+ ['oriMakingAmount', solana_1.u64],
14
+ ['oriTakingAmount', solana_1.u64],
15
+ ['makingAmount', solana_1.u64],
16
+ ['takingAmount', solana_1.u64],
17
+ ['makerInputAccount', beet_solana_1.publicKey],
18
+ ['makerOutputAccount', beet_solana_1.publicKey],
19
+ ['reserve', beet_solana_1.publicKey],
20
+ ['uid', solana_1.u64],
21
+ ['expiredAt', solana_1.i64],
22
+ ['referral', beet_solana_1.publicKey],
23
+ ], (args) => args);
24
+ exports.dcaStruct = new beet_1.BeetStruct([
25
+ ['buffer', (0, solana_1.blob)(8)],
26
+ ['user', beet_solana_1.publicKey],
27
+ ['inputMint', beet_solana_1.publicKey],
28
+ ['outputMint', beet_solana_1.publicKey],
29
+ ['idx', solana_1.u64],
30
+ ['nextCycleAt', solana_1.i64],
31
+ ['inDeposited', solana_1.u64],
32
+ ['inWithdrawn', solana_1.u64],
33
+ ['outWithdrawn', solana_1.u64],
34
+ ['inUsed', solana_1.u64],
35
+ ['outReceived', solana_1.u64],
36
+ ['inAmountPerCycle', solana_1.u64],
37
+ ['cycleFrequency', solana_1.i64],
38
+ ['nextCycleAmountLeft', solana_1.u64],
39
+ ['inAccount', beet_solana_1.publicKey],
40
+ ['outAccount', beet_solana_1.publicKey],
41
+ ['minOutAmount', solana_1.u64],
42
+ ['maxOutAmount', solana_1.u64],
43
+ ['keeperInBalanceBeforeBorrow', solana_1.u64],
44
+ ['dcaOutBalanceBeforeSwap', solana_1.u64],
45
+ ['createdAt', solana_1.i64],
46
+ ['bump', beet_1.u8],
47
+ ], (args) => args);
48
+ exports.valueAverageStruct = new beet_1.BeetStruct([
49
+ ['buffer', (0, solana_1.blob)(8)],
50
+ ['isStale', beet_1.bool],
51
+ ['idx', solana_1.u64],
52
+ ['bump', beet_1.u8],
53
+ ['user', beet_solana_1.publicKey],
54
+ ['inputMint', beet_solana_1.publicKey],
55
+ ['outputMint', beet_solana_1.publicKey],
56
+ ['incrementUsdcValue', solana_1.u64],
57
+ ['orderInterval', solana_1.i64],
58
+ ['inputVault', beet_solana_1.publicKey],
59
+ ['outputVault', beet_solana_1.publicKey],
60
+ ['autoWithdraw', beet_1.bool],
61
+ ['feeDataAccount', beet_solana_1.publicKey],
62
+ ['referralFeeAccount', beet_solana_1.publicKey],
63
+ ['createdAt', solana_1.i64],
64
+ ['inDeposited', solana_1.u64],
65
+ ['inLeft', solana_1.u64],
66
+ ['inUsed', solana_1.u64],
67
+ ['inWithdrawn', solana_1.u64],
68
+ ['outReceived', solana_1.u64],
69
+ ['outWithdrawn', solana_1.u64],
70
+ ['supposedUsdcValue', solana_1.u64],
71
+ ['nextOrderAt', solana_1.i64],
72
+ ['outBalanceBeforeSwap', solana_1.u64],
73
+ ], (args) => args);
7
74
  exports.limitStruct = new beet_1.BeetStruct([
8
75
  ['maxAumUsd', solana_1.u128],
9
76
  ['maxIndividualLpToken', solana_1.u128],
@@ -120,4 +187,4 @@ exports.positionStruct = new beet_1.BeetStruct([
120
187
  ['lockedAmount', solana_1.u64],
121
188
  ['bump', beet_1.u8],
122
189
  ], (args) => args);
123
- //# sourceMappingURL=perpetuals.js.map
190
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAoBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,KAAK,EAAE,YAAG,CAAC;IACZ,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,UAAU,EAAE,uBAAS,CAAC;CACxB,EAC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,EAAE,uBAAS,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Fetcher } from '../../Fetcher';
1
+ import { Fetcher } from '../../../Fetcher';
2
2
  declare const fetcher: Fetcher;
3
3
  export default fetcher;
@@ -14,15 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const constants_1 = require("./constants");
17
- const clients_1 = require("../../utils/clients");
18
- const solana_1 = require("../../utils/solana");
19
- const valueAverage_1 = require("./structs/valueAverage");
17
+ const clients_1 = require("../../../utils/clients");
18
+ const solana_1 = require("../../../utils/solana");
19
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
20
+ const helpers_1 = require("../helpers");
21
+ const structs_1 = require("./structs");
20
22
  const filters_1 = require("./filters");
21
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
- const helpers_1 = require("./helpers");
23
23
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  const client = (0, clients_1.getClientSolana)();
25
- const valueAverageAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, valueAverage_1.valueAverageStruct, constants_1.valueAverageProgramId, (0, filters_1.valueAverageFilter)(owner));
25
+ const valueAverageAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.valueAverageStruct, constants_1.valueAverageProgramId, (0, filters_1.valueAverageFilters)(owner));
26
26
  if (valueAverageAccounts.length === 0)
27
27
  return [];
28
28
  const mints = new Set();
@@ -60,7 +60,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
60
60
  elements.push({
61
61
  type: 'multiple',
62
62
  networkId: portfolio_core_1.NetworkId.solana,
63
- platformId: constants_1.jupiterPlatform.id,
63
+ platformId: constants_1.platformId,
64
64
  value: (0, portfolio_core_1.getUsdValueSum)(accountAssets.map((a) => a.value)),
65
65
  label: 'Deposit',
66
66
  name: `VA Order`,
@@ -75,7 +75,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
75
75
  {
76
76
  type: 'multiple',
77
77
  networkId: portfolio_core_1.NetworkId.solana,
78
- platformId: constants_1.jupiterPlatform.id,
78
+ platformId: constants_1.platformId,
79
79
  value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
80
80
  label: 'Deposit',
81
81
  name: `VA Orders (${elements.length})`,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,wCAA6C;AAC7C,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAwB,EACzD,M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ED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEtC,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,SAAS,CAAC,CAAC;QAC1C,OAAO;YACL;gBACE,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACzD,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,cAAc,QAAQ,CAAC,MAAM,GAAG;gBACtC,IAAI,EAAE,EAAE,MAAM,EAAE;aACjB;SACF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import { GetProgramAccountsFilter } from '@solana/web3.js';
2
2
  export declare const perpetualsPositionsFilter: (owner: string) => GetProgramAccountsFilter[];
3
3
  export declare const escrowFilter: (owner: string) => GetProgramAccountsFilter[];
4
- export declare const valueAverageFilter: (owner: string) => GetProgramAccountsFilter[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.valueAverageFilter = exports.escrowFilter = exports.perpetualsPositionsFilter = void 0;
3
+ exports.escrowFilter = exports.perpetualsPositionsFilter = void 0;
4
4
  const perpetualsPositionsFilter = (owner) => [
5
5
  {
6
6
  memcmp: {
@@ -21,14 +21,4 @@ const escrowFilter = (owner) => [
21
21
  { dataSize: 322 },
22
22
  ];
23
23
  exports.escrowFilter = escrowFilter;
24
- const valueAverageFilter = (owner) => [
25
- {
26
- memcmp: {
27
- offset: 18,
28
- bytes: owner,
29
- },
30
- },
31
- { dataSize: 339 },
32
- ];
33
- exports.valueAverageFilter = valueAverageFilter;
34
24
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,CACvC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,yBAAyB,6BAUpC;AAEK,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,YAAY,gBAQvB;AAEK,MAAM,kBAAkB,GAAG,CAChC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,kBAAkB,sBAU7B"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,CACvC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,yBAAyB,6BAUpC;AAEK,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,YAAY,gBAQvB"}
@@ -0,0 +1,3 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ export declare const jupGovernancePlatformId = "jupiter-governance";
3
+ export declare const jupGovernancePlatform: Platform;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jupGovernancePlatform = exports.jupGovernancePlatformId = void 0;
4
+ exports.jupGovernancePlatformId = 'jupiter-governance';
5
+ exports.jupGovernancePlatform = {
6
+ id: exports.jupGovernancePlatformId,
7
+ name: 'Jupiter Governance',
8
+ image: 'https://sonar.watch/img/platforms/jupiter.png',
9
+ website: 'https://vote.jup.ag/',
10
+ twitter: 'https://twitter.com/JupiterExchange',
11
+ };
12
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,uBAAuB,GAAG,oBAAoB,CAAC;AAC/C,QAAA,qBAAqB,GAAa;IAC7C,EAAE,EAAE,+BAAuB;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,qCAAqC;CAC/C,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Fetcher } from '../../Fetcher';
1
+ import { Fetcher } from '../../../Fetcher';
2
2
  declare const fetcher: Fetcher;
3
3
  export default fetcher;