From d7ddd2d324b17b21e768cfb96cd274d29edfd196 Mon Sep 17 00:00:00 2001
From: jackburrus
Date: Thu, 7 Nov 2024 15:31:52 -0700
Subject: [PATCH] adds total value to lp table
---
.../LpAndWithdrawalSharesTable.tsx | 2 +
.../TotalLpValue.tsx | 67 +++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 apps/hyperdrive-trading/src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/TotalLpValue.tsx
diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/LpAndWithdrawalSharesTable.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/LpAndWithdrawalSharesTable.tsx
index 24ff604b1..91e07783f 100644
--- a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/LpAndWithdrawalSharesTable.tsx
+++ b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/LpAndWithdrawalSharesTable.tsx
@@ -20,6 +20,7 @@ import { ConnectWalletButton } from "src/ui/compliance/ConnectWallet";
import { LpCurrentValueCell } from "src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/LpCurrentValueCell";
import { ManageLpAndWithdrawalSharesButton } from "src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/ManageLpAndWithdrawalSharesButton";
import { SizeAndPoolShareCell } from "src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/SizeAndPoolShareCell";
+import { TotalLpValue } from "src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/TotalLpValue";
import { WithdrawalQueueCell } from "src/ui/hyperdrive/lp/LpAndWithdrawalSharesTable/WithdrawalQueueCell";
import { AssetStack } from "src/ui/markets/AssetStack";
import { usePortfolioLpData } from "src/ui/portfolio/usePortfolioLpData";
@@ -128,6 +129,7 @@ export function LpAndWithdrawalSharesContainer(): ReactElement {
{hyperdrive.name.replace(/\d{1,3}d/, "")}
+
+
+
+ {openLpPositionStatus === "loading" ? (
+
+ ) : isFiatPriceEnabled ? (
+ `$${formatBalance({
+ balance: fiatPrice
+ ? fixed(baseValue, baseToken.decimals).mul(
+ fiatPrice,
+ baseToken.decimals,
+ ).bigint
+ : 0n,
+ decimals: hyperdrive.decimals,
+ places: baseToken?.places,
+ })}`
+ ) : (
+ `${formatBalance({
+ balance: baseValue,
+ decimals: hyperdrive.decimals,
+ places: baseToken?.places,
+ })} ${baseToken.symbol}`
+ )}{" "}
+
+
+ );
+}