@sonarwatch/portfolio-core 0.12.27 → 0.12.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @sonarwatch/portfolio-core
2
-
3
- This library is @sonarwatch/portfolio-core
1
+ # @sonarwatch/portfolio-core
2
+
3
+ This library is @sonarwatch/portfolio-core
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-core",
3
- "version": "0.12.27",
3
+ "version": "0.12.29",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "dependencies": {
@@ -207,8 +207,8 @@ export type PortfolioElementLiquidity = PortfolioElementCommon & {
207
207
  data: PortfolioElementLiquidityData;
208
208
  };
209
209
  export declare enum LeverageSide {
210
- long = 0,
211
- short = 1
210
+ long = "long",
211
+ short = "short"
212
212
  }
213
213
  export type LeveragePosition = {
214
214
  name?: string;
@@ -219,6 +219,7 @@ export type LeveragePosition = {
219
219
  collateralValue: UsdValue;
220
220
  value: UsdValue;
221
221
  liquidationPrice: UsdValue;
222
+ pnlValue: UsdValue;
222
223
  leverage?: number;
223
224
  side: LeverageSide;
224
225
  };
@@ -229,7 +230,9 @@ export type PortfolioElementLeverageData = {
229
230
  value: UsdValue;
230
231
  leverage?: number;
231
232
  collateralAssets: PortfolioAsset[];
233
+ collateralValue: UsdValue;
232
234
  positions: LeveragePosition[];
235
+ positionsValue: UsdValue;
233
236
  };
234
237
  /**
235
238
  * Represents a leverage portfolio element.
package/src/Portfolio.js CHANGED
@@ -20,7 +20,7 @@ exports.PortfolioElementType = {
20
20
  };
21
21
  var LeverageSide;
22
22
  (function (LeverageSide) {
23
- LeverageSide[LeverageSide["long"] = 0] = "long";
24
- LeverageSide[LeverageSide["short"] = 1] = "short";
23
+ LeverageSide["long"] = "long";
24
+ LeverageSide["short"] = "short";
25
25
  })(LeverageSide || (exports.LeverageSide = LeverageSide = {}));
26
26
  //# sourceMappingURL=Portfolio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Portfolio.js","sourceRoot":"","sources":["../../../../packages/core/src/Portfolio.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACU,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;CAClB,CAAC;AAyCX;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACZ,CAAC;AA2LX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,iDAAK,CAAA;AACP,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}
1
+ {"version":3,"file":"Portfolio.js","sourceRoot":"","sources":["../../../../packages/core/src/Portfolio.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACU,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;CAClB,CAAC;AAyCX;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACZ,CAAC;AA2LX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}