@loafmarkets/ui 0.1.365 → 0.1.366
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -912,6 +912,7 @@ interface PortfolioPosition {
|
|
|
912
912
|
readonly propertyId: number;
|
|
913
913
|
readonly tokenName: string;
|
|
914
914
|
readonly quantity: number;
|
|
915
|
+
readonly totalQuantity: number;
|
|
915
916
|
readonly totalTokens: number;
|
|
916
917
|
readonly averageEntryPrice: number;
|
|
917
918
|
readonly marketPrice: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -912,6 +912,7 @@ interface PortfolioPosition {
|
|
|
912
912
|
readonly propertyId: number;
|
|
913
913
|
readonly tokenName: string;
|
|
914
914
|
readonly quantity: number;
|
|
915
|
+
readonly totalQuantity: number;
|
|
915
916
|
readonly totalTokens: number;
|
|
916
917
|
readonly averageEntryPrice: number;
|
|
917
918
|
readonly marketPrice: number;
|
package/dist/index.js
CHANGED
|
@@ -13643,9 +13643,9 @@ function PortfolioActivityPanel({
|
|
|
13643
13643
|
case "asset":
|
|
13644
13644
|
return dir * a.tokenName.localeCompare(b.tokenName);
|
|
13645
13645
|
case "units":
|
|
13646
|
-
return dir * (a.
|
|
13646
|
+
return dir * (a.totalQuantity - b.totalQuantity);
|
|
13647
13647
|
case "value":
|
|
13648
|
-
return dir * (a.
|
|
13648
|
+
return dir * (a.totalQuantity * a.marketPrice - b.totalQuantity * b.marketPrice);
|
|
13649
13649
|
case "avgPrice":
|
|
13650
13650
|
return dir * (a.averageEntryPrice - b.averageEntryPrice);
|
|
13651
13651
|
case "currentPrice":
|
|
@@ -13814,8 +13814,8 @@ function PortfolioActivityPanel({
|
|
|
13814
13814
|
] })
|
|
13815
13815
|
] }),
|
|
13816
13816
|
sortedPositions.map((pos) => {
|
|
13817
|
-
const currentValue = pos.
|
|
13818
|
-
const costBasis = pos.
|
|
13817
|
+
const currentValue = pos.totalQuantity * pos.marketPrice;
|
|
13818
|
+
const costBasis = pos.totalQuantity * pos.averageEntryPrice;
|
|
13819
13819
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
13820
13820
|
const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
|
|
13821
13821
|
const isPositive = pnl >= 0;
|
|
@@ -13832,7 +13832,7 @@ function PortfolioActivityPanel({
|
|
|
13832
13832
|
] }),
|
|
13833
13833
|
/* @__PURE__ */ jsxRuntime.jsxs(CUnitsCell, { children: [
|
|
13834
13834
|
/* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "Units" }),
|
|
13835
|
-
formatNumber2(pos.
|
|
13835
|
+
formatNumber2(pos.totalQuantity, pos.totalQuantity >= 100 ? 0 : 2),
|
|
13836
13836
|
" ",
|
|
13837
13837
|
ticker
|
|
13838
13838
|
] }),
|
|
@@ -13905,15 +13905,15 @@ function PortfolioActivityPanel({
|
|
|
13905
13905
|
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
|
|
13906
13906
|
] }),
|
|
13907
13907
|
sortedPositions.map((pos) => {
|
|
13908
|
-
const currentValue = pos.
|
|
13909
|
-
const costBasis = pos.
|
|
13908
|
+
const currentValue = pos.totalQuantity * pos.marketPrice;
|
|
13909
|
+
const costBasis = pos.totalQuantity * pos.averageEntryPrice;
|
|
13910
13910
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
13911
13911
|
const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
|
|
13912
13912
|
const isPositive = pnl >= 0;
|
|
13913
13913
|
return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
|
|
13914
13914
|
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }) }),
|
|
13915
13915
|
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: [
|
|
13916
|
-
formatNumber2(pos.
|
|
13916
|
+
formatNumber2(pos.totalQuantity),
|
|
13917
13917
|
" ",
|
|
13918
13918
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "0.7rem" }, children: pos.tokenName.toUpperCase() })
|
|
13919
13919
|
] }) }),
|