@sonarwatch/portfolio-plugins 0.12.21 → 0.12.23

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.12.23](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.22...plugins-0.12.23) (2024-06-10)
6
+
7
+
8
+
9
+ ## [0.12.22](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.21...plugins-0.12.22) (2024-06-10)
10
+
11
+
12
+
5
13
  ## [0.12.21](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.20...plugins-0.12.21) (2024-06-10)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.12.21",
3
+ "version": "0.12.23",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -51,6 +51,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
51
51
  type: portfolio_core_1.PortfolioElementType.multiple,
52
52
  label: 'Deposit',
53
53
  networkId: portfolio_core_1.NetworkId.sui,
54
+ name: 'Free Collateral',
54
55
  platformId: constants_1.platformId,
55
56
  data: { assets },
56
57
  value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
@@ -1 +1 @@
1
- {"version":3,"file":"bankFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/bankFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAuD;AACvD,iDAAmD;AACnD,yDAAsD;AACtD,iFAA8E;AAE9E,qGAA6E;AAC7E,yDAAwD;AAExD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,M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A,CAAC;aAClB,QAAQ,EAAE,EACb,0BAAS,CAAC,GAAG,EACb,UAAU,CACX,CACF,CAAC;IAEJ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"bankFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/bankFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAuD;AACvD,iDAAmD;AACnD,yDAAsD;AACtD,iFAA8E;AAE9E,qGAA6E;AAC7E,yDAAwD;AAExD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC3C,IAAA,qBAAS,EAAO,MAAM,EAAE,wBAAY,CAAC;QACrC,KAAK,CAAC,aAAa,CAAC,IAAA,uCAAsB,EAAC,uBAAW,CAAC,EAAE,0BAAS,CAAC,GAAG,CAAC;KACxE,CAAC,CAAC;IAEH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E,0BAAS,CAAC,GAAG;YACxB,IAAI,EAAE,iBAAiB;YACvB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -20,6 +20,7 @@ const clients_1 = require("../../utils/clients");
20
20
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
21
21
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
22
  const constants_2 = require("../../utils/sui/constants");
23
+ const constants_3 = require("../../utils/misc/constants");
23
24
  const perpsTtl = 20000;
24
25
  const perps = new Map();
25
26
  let lastPerpsUpdate = 0;
@@ -89,13 +90,23 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
89
90
  suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, positionSizeUsd.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
90
91
  if (positionSizeUsd.times(leverage).isPositive())
91
92
  borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, positionSizeUsd.times(leverage).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
92
- if (!pnl.isZero())
93
- rewardAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, pnl.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
93
+ const pnlAsset = {
94
+ type: portfolio_core_1.PortfolioAssetType.generic,
95
+ networkId: portfolio_core_1.NetworkId.solana,
96
+ value: pnl.toNumber(),
97
+ attributes: {},
98
+ data: {
99
+ amount: pnl.toNumber(),
100
+ price: 1,
101
+ name: 'PnL',
102
+ imageUri: constants_3.usdcLogoUri,
103
+ },
104
+ };
105
+ rewardAssets.push(pnlAsset);
94
106
  if (suppliedAssets.length === 0 &&
95
107
  borrowedAssets.length === 0 &&
96
108
  rewardAssets.length === 0)
97
109
  return;
98
- const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
99
110
  const value = positionSizeUsd.plus(pnl).toNumber();
100
111
  const side = ((_3 = (_2 = (_1 = (_0 = position.data) === null || _0 === void 0 ? void 0 : _0.content) === null || _1 === void 0 ? void 0 : _1.fields) === null || _2 === void 0 ? void 0 : _2.value) === null || _3 === void 0 ? void 0 : _3.fields.isPosPositive)
101
112
  ? 'Long'
@@ -109,15 +120,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
109
120
  name: `${perp.name} ${side} ${leverage.decimalPlaces(2)}x`,
110
121
  data: {
111
122
  borrowedAssets,
112
- borrowedValue,
123
+ borrowedValue: (0, portfolio_core_1.getUsdValueSum)(borrowedAssets.map((a) => a.value)),
113
124
  borrowedYields,
114
125
  suppliedAssets,
115
- suppliedValue,
126
+ suppliedValue: (0, portfolio_core_1.getUsdValueSum)(suppliedAssets.map((a) => a.value)),
116
127
  suppliedYields,
117
128
  collateralRatio: null,
118
129
  rewardAssets,
119
- rewardValue,
120
- healthRatio,
130
+ rewardValue: (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value)),
131
+ healthRatio: null,
121
132
  value,
122
133
  },
123
134
  });
@@ -1 +1 @@
1
- {"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAA0D;AAC1D,iFAA8E;AAC9E,iDAAmD;AAEnD,qEAAkE;A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CAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,UAAU;YACjB,KAAK;YACL,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;YAC1D,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBACrB,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,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"}
1
+ {"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bluefin/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA0D;AAC1D,iFAA8E;AAC9E,iDAAmD;AAEnD,qEAAkE;AAClE,qGAA6E;AAC7E,yDAAwD;AACxD,0DAAyD;AAEzD,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB,MAAM,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;AAClD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,oBAAoB;IACpB,IAAI,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,M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AAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACjE,cAAc;gBACd,cAAc;gBACd,aAAa,EAAE,IAAA,+BAAc,EAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACjE,cAAc;gBACd,eAAe,EAAE,IAAI;gBACrB,YAAY;gBACZ,WAAW,EAAE,IAAA,+BAAc,EAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC7D,WAAW,EAAE,IAAI;gBACjB,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,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"}
@@ -1,5 +1,2 @@
1
1
  import { GetProgramAccountsFilter } from '@solana/web3.js';
2
- export declare const lpAccountFilter: (owner: string) => GetProgramAccountsFilter[];
3
- export declare const lpPositionFilter: (owner: string) => GetProgramAccountsFilter[];
4
- export declare const settlementRequestFilter: (owner: string) => GetProgramAccountsFilter[];
5
2
  export declare const marginAccountFilter: (owner: string) => GetProgramAccountsFilter[];
@@ -1,43 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marginAccountFilter = exports.settlementRequestFilter = exports.lpPositionFilter = exports.lpAccountFilter = void 0;
3
+ exports.marginAccountFilter = void 0;
4
4
  const structs_1 = require("./structs");
5
- const lpAccountFilter = (owner) => [
6
- {
7
- memcmp: {
8
- offset: 64,
9
- bytes: owner,
10
- },
11
- },
12
- {
13
- dataSize: structs_1.lpAccountStruct.byteSize,
14
- },
15
- ];
16
- exports.lpAccountFilter = lpAccountFilter;
17
- const lpPositionFilter = (owner) => [
18
- {
19
- memcmp: {
20
- offset: 72,
21
- bytes: owner,
22
- },
23
- },
24
- {
25
- dataSize: structs_1.lpPositionStruct.byteSize,
26
- },
27
- ];
28
- exports.lpPositionFilter = lpPositionFilter;
29
- const settlementRequestFilter = (owner) => [
30
- {
31
- memcmp: {
32
- offset: 72,
33
- bytes: owner,
34
- },
35
- },
36
- {
37
- dataSize: structs_1.settlementRequestStruct.byteSize,
38
- },
39
- ];
40
- exports.settlementRequestFilter = settlementRequestFilter;
5
+ // export const lpAccountFilter = (owner: string): GetProgramAccountsFilter[] => [
6
+ // {
7
+ // memcmp: {
8
+ // offset: 64,
9
+ // bytes: owner,
10
+ // },
11
+ // },
12
+ // {
13
+ // dataSize: lpAccountStruct.byteSize,
14
+ // },
15
+ // ];
16
+ // export const lpPositionFilter = (owner: string): GetProgramAccountsFilter[] => [
17
+ // {
18
+ // memcmp: {
19
+ // offset: 72,
20
+ // bytes: owner,
21
+ // },
22
+ // },
23
+ // {
24
+ // dataSize: lpPositionStruct.byteSize,
25
+ // },
26
+ // ];
27
+ // export const settlementRequestFilter = (
28
+ // owner: string
29
+ // ): GetProgramAccountsFilter[] => [
30
+ // {
31
+ // memcmp: {
32
+ // offset: 72,
33
+ // bytes: owner,
34
+ // },
35
+ // },
36
+ // {
37
+ // dataSize: settlementRequestStruct.byteSize,
38
+ // },
39
+ // ];
41
40
  const marginAccountFilter = (owner) => [
42
41
  {
43
42
  memcmp: {
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/filters.ts"],"names":[],"mappings":";;;AACA,uCAKmB;AAEZ,MAAM,eAAe,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC5E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,yBAAe,CAAC,QAAQ;KACnC;CACF,CAAC;AAVW,QAAA,eAAe,mBAU1B;AAEK,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC7E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,0BAAgB,CAAC,QAAQ;KACpC;CACF,CAAC;AAVW,QAAA,gBAAgB,oBAU3B;AAEK,MAAM,uBAAuB,GAAG,CACrC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,iCAAuB,CAAC,QAAQ;KAC3C;CACF,CAAC;AAZW,QAAA,uBAAuB,2BAYlC;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,6BAAmB,CAAC,QAAQ;KACvC;CACF,CAAC;AAZW,QAAA,mBAAmB,uBAY9B"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/filters.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAEhD,kFAAkF;AAClF,MAAM;AACN,gBAAgB;AAChB,oBAAoB;AACpB,sBAAsB;AACtB,SAAS;AACT,OAAO;AACP,MAAM;AACN,0CAA0C;AAC1C,OAAO;AACP,KAAK;AAEL,mFAAmF;AACnF,MAAM;AACN,gBAAgB;AAChB,oBAAoB;AACpB,sBAAsB;AACtB,SAAS;AACT,OAAO;AACP,MAAM;AACN,2CAA2C;AAC3C,OAAO;AACP,KAAK;AAEL,2CAA2C;AAC3C,kBAAkB;AAClB,qCAAqC;AACrC,MAAM;AACN,gBAAgB;AAChB,oBAAoB;AACpB,sBAAsB;AACtB,SAAS;AACT,OAAO;AACP,MAAM;AACN,kDAAkD;AAClD,OAAO;AACP,KAAK;AAEE,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,6BAAmB,CAAC,QAAQ;KACvC;CACF,CAAC;AAZW,QAAA,mBAAmB,uBAY9B"}
@@ -2,3 +2,4 @@ import BigNumber from 'bignumber.js';
2
2
  export declare const zeroBigInt: bigint;
3
3
  export declare const zeroBigNumber: BigNumber;
4
4
  export declare const lpAddressesCachePrefix = "lp-addresses";
5
+ export declare const usdcLogoUri = "https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.png";
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.lpAddressesCachePrefix = exports.zeroBigNumber = exports.zeroBigInt = void 0;
6
+ exports.usdcLogoUri = exports.lpAddressesCachePrefix = exports.zeroBigNumber = exports.zeroBigInt = void 0;
7
7
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
8
  exports.zeroBigInt = BigInt(0);
9
9
  exports.zeroBigNumber = (0, bignumber_js_1.default)(0);
10
10
  exports.lpAddressesCachePrefix = 'lp-addresses';
11
+ exports.usdcLogoUri = 'https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.png';
11
12
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAExB,QAAA,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,QAAA,aAAa,GAAG,IAAA,sBAAS,EAAC,CAAC,CAAC,CAAC;AAC7B,QAAA,sBAAsB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAExB,QAAA,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,QAAA,aAAa,GAAG,IAAA,sBAAS,EAAC,CAAC,CAAC,CAAC;AAC7B,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,WAAW,GACtB,sFAAsF,CAAC"}