diff --git a/components/shared/PnlTooltipContent.tsx b/components/shared/PnlTooltipContent.tsx index 3eae7d0d..e8fcae90 100644 --- a/components/shared/PnlTooltipContent.tsx +++ b/components/shared/PnlTooltipContent.tsx @@ -1,16 +1,19 @@ import { useTranslation } from 'next-i18next' import { formatCurrencyValue } from 'utils/numbers' +import FormatNumericValue from './FormatNumericValue' const PnlTooltipContent = ({ unrealizedPnl, realizedPnl, totalPnl, unsettledPnl, + roe, }: { unrealizedPnl: number realizedPnl: number totalPnl: number unsettledPnl: number + roe: number }) => { const { t } = useTranslation(['common', 'trade']) return ( @@ -42,6 +45,13 @@ const PnlTooltipContent = ({ {formatCurrencyValue(totalPnl, 2)} +
+

{t('trade:return-on-equity')}

+ + + %{' '} + +
} delay={100} @@ -315,6 +316,7 @@ const PerpPositionsStatsTable = ({ realizedPnl={realizedPnl} totalPnl={totalPnl} unsettledPnl={unsettledPnl} + roe={roe} /> } delay={100} diff --git a/components/trade/PerpPositions.tsx b/components/trade/PerpPositions.tsx index 8aa85514..f87cbeb3 100644 --- a/components/trade/PerpPositions.tsx +++ b/components/trade/PerpPositions.tsx @@ -265,6 +265,7 @@ const PerpPositions = () => { realizedPnl={realizedPnl} totalPnl={totalPnl} unsettledPnl={unsettledPnl} + roe={roe} /> } delay={100} @@ -283,19 +284,6 @@ const PerpPositions = () => { /> - = 0 ? 'text-th-up' : 'text-th-down'} - > - - %{' '} - - (ROE) - - {!isUnownedAccount ? ( @@ -343,7 +331,7 @@ const PerpPositions = () => {
- + Total: { realizedPnl={totalPnlStats.realized} totalPnl={totalPnlStats.total} unsettledPnl={totalPnlStats.unsettled} + roe={totalPnlStats.roe} /> } delay={100} @@ -376,25 +365,8 @@ const PerpPositions = () => { {!isUnownedAccount ? ( - {/*
- = 0 - ? 'text-th-up' - : 'text-th-down' - } - > - - %{' '} - - (ROE) - - -
*/} + {' '} + <> ) : null} @@ -604,6 +576,7 @@ const PerpPositions = () => { realizedPnl={realizedPnl} totalPnl={totalPnl} unsettledPnl={unsettledPnl} + roe={roe} /> } delay={100} @@ -702,7 +675,7 @@ const PerpPositions = () => { Total ROE:
= 0 ? 'text-th-up' : 'text-th-down' diff --git a/public/locales/en/trade.json b/public/locales/en/trade.json index 29ffef05..3c3aead4 100644 --- a/public/locales/en/trade.json +++ b/public/locales/en/trade.json @@ -72,6 +72,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "return-on-equity": "Return on Equity", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", diff --git a/public/locales/es/trade.json b/public/locales/es/trade.json index 29ffef05..3c3aead4 100644 --- a/public/locales/es/trade.json +++ b/public/locales/es/trade.json @@ -72,6 +72,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "return-on-equity": "Return on Equity", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", diff --git a/public/locales/ru/trade.json b/public/locales/ru/trade.json index 29ffef05..3c3aead4 100644 --- a/public/locales/ru/trade.json +++ b/public/locales/ru/trade.json @@ -72,6 +72,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "return-on-equity": "Return on Equity", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", diff --git a/public/locales/zh/trade.json b/public/locales/zh/trade.json index 322ae6d4..af8dc387 100644 --- a/public/locales/zh/trade.json +++ b/public/locales/zh/trade.json @@ -71,6 +71,7 @@ "quote": "计价", "reduce": "Reduce", "reduce-only": "限减少", + "return-on-equity": "Return on Equity", "sells": "卖单", "settle-funds": "借清资金", "settle-funds-error": "借清出错", diff --git a/public/locales/zh_tw/trade.json b/public/locales/zh_tw/trade.json index 712236a3..266f82d6 100644 --- a/public/locales/zh_tw/trade.json +++ b/public/locales/zh_tw/trade.json @@ -72,6 +72,7 @@ "realized-pnl": "已實現的盈虧", "reduce": "Reduce", "reduce-only": "限減少", + "return-on-equity": "Return on Equity", "sells": "賣單", "settle-funds": "借清資金", "settle-funds-error": "借清出錯",