@sonarwatch/portfolio-plugins 0.11.188 → 0.11.189

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.189](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.188...plugins-0.11.189) (2024-04-25)
6
+
7
+
8
+
5
9
  ## [0.11.188](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.187...plugins-0.11.188) (2024-04-24)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.188",
3
+ "version": "0.11.189",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.188"
44
+ "@sonarwatch/portfolio-core": "0.11.189"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -22,6 +22,21 @@ const mints = [
22
22
  'BANXbTpN8U2cU41FjPxe2Ti37PiT5cCxLUKDQZuJeMMR', // Banx
23
23
  '4LLbsb5ReP3yEtYzmXewyGjcir5uXtKFURtaEUVC2AHs', // Parcl
24
24
  'SHARKSYJjqaNyxVfrpnBN9pjgkhwDhatnMyicWPnr1s', // Shark
25
+ 'DdFPRnccQqLD4zCHrBqdY95D6hvw6PLWp9DEXj1fLCL9', // Wrapped USDC (Allbridge from Ethereum)
26
+ 'eqKJTf1Do4MDPyKisMYqVaUFpkEFAs3riGF3ceDH2Ca', // Wrapped USDC (Allbridge from Polygon)
27
+ '8Yv9Jz4z7BUHP68dz8E8m3tMe6NKgpMUKn8KVqrPA6Fr', // Wrapped USDC (Allbridge from Avalanche)
28
+ 'FHfba3ov5P3RjaiLVgh8FTv4oirxQDoVXuoUUDvHuXax', // USDC (Wormhole from Avalanche)
29
+ 'Kz1csQA91WUGcQ2TB3o5kdGmWmMGp8eJcDEyHzNDVCX', // USDT (Wormhole from Avalanche)
30
+ '9EaLkQrbjmbbuZG9Wdpo8qfNUEjHATJFSycEmw6f1rGX', // pSOL (Parrot SOL)
31
+ '7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj', // stSOL
32
+ 'Bn113WT6rbdgwrm12UJtnmNqGqZjY4it2WoUQuQopFVn', // Wrapped USDT (Allbridge from Ethereum)
33
+ 'FwEHs3kJEdMa2qZHv7SgzCiFXUQPEycEXksfBkwmS8gj', // Wrapped USDT (Allbridge from Avalanche)
34
+ '8XSsNvaKU9FDhYWAv7Yc7qSNwuJSzVrXBNEk7AFiWF69', // Wrapped USDC (Allbridge from BSC)
35
+ 'E77cpQ4VncGmcAXX16LHFFzNBEBb2U7Ar7LBmZNfCgwL', // Wrapped USDT (Allbridge from BSC)
36
+ 'EjmyN6qEC1Tf1JxiG1ae7UTJhUxSwk1TCWNWqxWV4J6o', // DAI (Portal from Ethereum)
37
+ '5RpUwQ8wtdPCZHhu6MERp2RGrpobsbZ6MH5dDHkUjs2', // BUSD Token (Wormhole from BSC)
38
+ 'FCqfQSujuPxy6V42UvafBhsysWtEq1vhjfMN1PUbgaxA', // USD Coin (Wormhole from BSC)
39
+ '8qJSyQprMC57TWKaYEmetUR3UUiTP2M3hXdcvFhkZdmv', // Tether USD (Wormhole from BSC)
25
40
  ];
26
41
  const vsToken = portfolio_core_1.solanaNativeWrappedAddress;
27
42
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,oDAAkD;AAClD,uCAA6C;AAC7C,mDAA2D;AAC3D,0FAAuF;AACv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ACnC,MAAM,EAAE,GAAG;SACZ,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,WAAW;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,oDAAkD;AAClD,uCAA6C;AAC7C,mDAA2D;AAC3D,0FAAuF;AACvF,iDAAsD;AAEtD,MAAM,KAAK,GAAG;IACZ,8CAA8C,EAAE,uBAAuB;IACvE,6CAA6C,EAAE,YAAY;IAC3D,8CAA8C,EAAE,OAAO;IACvD,8CAA8C,EAAE,QAAQ;IACxD,6CAA6C,EAAE,QAAQ;IACvD,8CAA8C,EAAE,yCAAyC;IACzF,6CAA6C,EAAE,wCAAwC;IACvF,8CAA8C,EAAE,0CAA0C;IAC1F,8CAA8C,EAAE,iCAAiC;IACjF,6CAA6C,EAAE,iCAAiC;IAChF,8CAA8C,EAAE,oBAAoB;IACpE,8CAA8C,EAAE,QAAQ;IACxD,8CAA8C,EAAE,yCAAyC;IACzF,8CAA8C,EAAE,0CAA0C;IAC1F,8CAA8C,EAAE,oCAAoC;IACpF,8CAA8C,EAAE,oCAAoC;IACpF,8CAA8C,EAAE,6BAA6B;IAC7E,6CAA6C,EAAE,iCAAiC;IAChF,8CAA8C,EAAE,+BAA+B;IAC/E,8CAA8C,EAAE,iCAAiC;CAClF,CAAC;AACF,MAAM,OAAO,GAAG,2CAA0B,CAAC;AAE3C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,E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,EAAE,WAAW;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -17,27 +17,36 @@ const constants_1 = require("./constants");
17
17
  const clients_1 = require("../../utils/clients");
18
18
  const solana_1 = require("../../utils/solana");
19
19
  const struct_1 = require("./struct");
20
- const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
21
20
  const tokenPriceToAssetTokens_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetTokens"));
22
21
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
23
22
  const helpers_1 = require("./helpers");
24
23
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
24
  const client = (0, clients_1.getClientSolana)();
26
- const farmsInfo = yield cache.getItem(constants_1.farmsKey, {
25
+ const farms = yield cache.getItem(constants_1.farmsKey, {
27
26
  prefix: constants_1.platformId,
28
27
  networkId: portfolio_core_1.NetworkId.solana,
29
28
  });
30
- if (!farmsInfo)
29
+ if (!farms)
31
30
  return [];
32
- const farmById = new Map();
31
+ const farmsById = new Map();
33
32
  const farmsMint = [];
34
- farmsInfo.forEach((farm) => {
35
- farmById.set(farm.pubkey, farm);
33
+ farms.forEach((farm) => {
34
+ farmsById.set(farm.pubkey, farm);
36
35
  farmsMint.push(farm.pubkey);
37
36
  });
38
37
  const farmingAccountsAddresses = (0, helpers_1.getStakingAccounts)(owner, farmsMint);
39
38
  const farmingAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, struct_1.farmAccountStruct, farmingAccountsAddresses);
40
- const tokenPriceById = yield (0, getTokensPricesMap_1.default)(farmsInfo.map((f) => [f.stakingMint, f.rewardAMint, f.rewardBMint]).flat(), portfolio_core_1.NetworkId.solana, cache);
39
+ const neededMints = farmingAccounts
40
+ .map((fA, i) => {
41
+ if (!fA)
42
+ return [];
43
+ const farm = farms.at(i);
44
+ if (!farm)
45
+ return [];
46
+ return [farm.stakingMint, farm.rewardAMint, farm.rewardBMint];
47
+ })
48
+ .flat();
49
+ const tokenPrices = yield cache.getTokenPricesAsMap(neededMints, portfolio_core_1.NetworkId.solana);
41
50
  const liquidities = [];
42
51
  for (const farmingAccount of farmingAccounts) {
43
52
  if (!farmingAccount)
@@ -45,14 +54,14 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
45
54
  const rewardAssets = [];
46
55
  const assets = [];
47
56
  const { balanceStaked, rewardAPerTokenPending, rewardBPerTokenPending } = farmingAccount;
48
- const farmInfo = farmById.get(farmingAccount.pool.toString());
57
+ const farmInfo = farmsById.get(farmingAccount.pool.toString());
49
58
  if (!farmInfo)
50
59
  continue;
51
60
  const { stakingMint, rewardAMint, rewardBMint } = farmInfo;
52
61
  const [poolTokenPrice, rewardATokenPrice, rewardBTokenPrice] = [
53
- tokenPriceById.get(stakingMint),
54
- tokenPriceById.get(rewardAMint),
55
- tokenPriceById.get(rewardBMint),
62
+ tokenPrices.get(stakingMint),
63
+ tokenPrices.get(rewardAMint),
64
+ tokenPrices.get(rewardBMint),
56
65
  ];
57
66
  if (!poolTokenPrice)
58
67
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"farmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/farmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAmD;AACnD,iDAAsD;AACtD,+CAAmE;AACnE,qCAA6C;AAC7C,6FAAoE;AACpE,uGAA+E;AAE/E,qGAA6E;AAC7E,uCAA+C;AAE/C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAAS,oBAAQ,EAAE;QACtD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,SAAS;QAA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CAAC;IAExC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;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"}
@@ -15,10 +15,12 @@ const solana_1 = require("../../utils/solana");
15
15
  const filters_1 = require("../../utils/solana/filters");
16
16
  const constants_1 = require("./constants");
17
17
  const struct_1 = require("./struct");
18
+ const helpers_1 = require("./helpers");
18
19
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
20
  const client = (0, clients_1.getClientSolana)();
20
21
  const farms = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.farmStruct, constants_1.farmProgramId, (0, filters_1.dataSizeFilter)(502));
21
- yield cache.setItem(constants_1.farmsKey, farms, {
22
+ const fFarms = farms.map((f) => (0, helpers_1.formatFarm)(f));
23
+ yield cache.setItem(constants_1.farmsKey, fFarms, {
22
24
  prefix: constants_1.platformId,
23
25
  networkId: portfolio_core_1.NetworkId.solana,
24
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"farmsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/farmsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA8D;AAC9D,wDAA4D;AAC5D,2CAAkE;AAClE,qCAAsC;AAEtC,MAAM,QAAQ,GAAgB,CAAO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,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -1,2 +1,6 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
+ import { Farm } from './struct';
3
+ import { FormattedFarm } from './types';
4
+ import { ParsedAccount } from '../../utils/solana';
2
5
  export declare function getStakingAccounts(owner: string, farms: string[]): PublicKey[];
6
+ export declare function formatFarm(farm: ParsedAccount<Farm>): FormattedFarm;
@@ -1,10 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStakingAccounts = void 0;
3
+ exports.formatFarm = exports.getStakingAccounts = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const constants_1 = require("./constants");
6
6
  function getStakingAccounts(owner, farms) {
7
7
  return farms.map((farm) => web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(owner).toBuffer(), new web3_js_1.PublicKey(farm).toBuffer()], constants_1.farmProgramId)[0]);
8
8
  }
9
9
  exports.getStakingAccounts = getStakingAccounts;
10
+ function formatFarm(farm) {
11
+ return {
12
+ pubkey: farm.pubkey.toString(),
13
+ authority: farm.authority.toString(),
14
+ stakingMint: farm.stakingMint.toString(),
15
+ stakingVault: farm.stakingVault.toString(),
16
+ rewardAMint: farm.rewardAMint.toString(),
17
+ rewardAVault: farm.rewardAVault.toString(),
18
+ rewardBMint: farm.rewardBMint.toString(),
19
+ rewardBVault: farm.rewardBVault.toString(),
20
+ rewardDuration: farm.rewardDuration.toString(),
21
+ rewardDurationEnd: farm.rewardDurationEnd.toString(),
22
+ lastUpdateTime: farm.lastUpdateTime.toString(),
23
+ rewardARate: farm.rewardARate.toString(),
24
+ rewardBRate: farm.rewardBRate.toString(),
25
+ rewardAPerTokenStored: farm.rewardAPerTokenStored.toString(),
26
+ rewardBPerTokenStored: farm.rewardBPerTokenStored.toString(),
27
+ rewardARateU128: farm.rewardARateU128.toString(),
28
+ rewardBRateU128: farm.rewardBRateU128.toString(),
29
+ paused: farm.paused,
30
+ totalStaked: farm.totalStaked.toString(),
31
+ };
32
+ }
33
+ exports.formatFarm = formatFarm;
10
34
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4C;AAE5C,SAAgB,kBAAkB,CAChC,KAAa,EACb,KAAe;IAEf,OAAO,KAAK,CAAC,GAAG,CACd,CAAC,IAAI,EAAE,EAAE,CACP,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,EACjE,yBAAa,CACd,CAAC,CAAC,CAAC,CACP,CAAC;AACJ,CAAC;AAXD,gDAWC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4C;AAK5C,SAAgB,kBAAkB,CAChC,KAAa,EACb,KAAe;IAEf,OAAO,KAAK,CAAC,GAAG,CACd,CAAC,IAAI,EAAE,EAAE,CACP,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,EACjE,yBAAa,CACd,CAAC,CAAC,CAAC,CACP,CAAC;AACJ,CAAC;AAXD,gDAWC;AAED,SAAgB,UAAU,CAAC,IAAyB;IAClD,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QAC9B,SAAS,EAAE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LN5tooABpPFCrDwx5wcaTgXMragLwFim27mar",
142
+ "reserveAccounts": [
143
+ "66guLcMF3qXkrMyLqDfuNKcHc7B6B36id9ZDDww4hiMv",
144
+ "8KX8TLQHfq9UyqNvzUrUCLiECNBdMspMmU8mghdM2SAM",
145
+ "2vhaJumb3hbRLUSDDy3Qk8KGGfzqThdwo8ai4tAvztGh",
146
+ "CC3FtDKTueNP1pmgtNWvKHZwbznyigSaiGhKsQYAfufD"
147
+ ]
138
148
  }
139
149
  ]
@@ -1,10 +1,9 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  import BigNumber from 'bignumber.js';
3
3
  import { LbPair } from './struct';
4
- export type Farm = {
4
+ export type FormattedFarm = {
5
5
  pubkey: string;
6
6
  authority: string;
7
- paused: boolean;
8
7
  stakingMint: string;
9
8
  stakingVault: string;
10
9
  rewardAMint: string;
@@ -18,12 +17,10 @@ export type Farm = {
18
17
  rewardBRate: string;
19
18
  rewardAPerTokenStored: string;
20
19
  rewardBPerTokenStored: string;
21
- userStakeCount: number;
22
- funders: string[];
23
20
  rewardARateU128: string;
24
21
  rewardBRateU128: string;
25
- poolBump: number;
26
22
  totalStaked: string;
23
+ paused: boolean;
27
24
  };
28
25
  export declare enum PositionVersion {
29
26
  V1 = 0,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/types.ts"],"names":[],"mappings":";;;AA6BA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,iDAAE,CAAA;IACF,iDAAE,CAAA;AACJ,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,iDAAK,CAAA;IACL,mDAAM,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/types.ts"],"names":[],"mappings":";;;AA0BA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,iDAAE,CAAA;IACF,iDAAE,CAAA;AACJ,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,iDAAK,CAAA;IACL,mDAAM,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}