From 49de41476c8b56db87acbff3a18419e3c3d68fd4 Mon Sep 17 00:00:00 2001 From: saml33 Date: Thu, 2 Feb 2023 14:41:32 +1100 Subject: [PATCH] fix perp stats open interest --- components/stats/PerpMarketDetails.tsx | 10 ++++------ components/stats/PerpMarketsTable.tsx | 15 ++++++++------- components/stats/TokenStats.tsx | 1 + 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/stats/PerpMarketDetails.tsx b/components/stats/PerpMarketDetails.tsx index b2e6d91c..b8b5e646 100644 --- a/components/stats/PerpMarketDetails.tsx +++ b/components/stats/PerpMarketDetails.tsx @@ -2,7 +2,6 @@ import { IconButton } from '@components/shared/Button' import SheenLoader from '@components/shared/SheenLoader' import { ChevronLeftIcon } from '@heroicons/react/20/solid' import mangoStore from '@store/mangoStore' -// import dayjs from 'dayjs' import { useTranslation } from 'next-i18next' import dynamic from 'next/dynamic' import { useMemo } from 'react' @@ -23,7 +22,6 @@ const PerpMarketDetails = ({ const { t } = useTranslation(['common', 'trade']) const perpStats = mangoStore((s) => s.perpStats.data) const loadingPerpStats = mangoStore((s) => s.perpStats.loading) - // const perpMarkets = mangoStore((s) => s.perpMarkets) const marketStats = useMemo(() => { if (!perpStats) return [] @@ -96,8 +94,8 @@ const PerpMarketDetails = ({ daysToShow={'999'} heightClass="h-64" suffix="%" - tickFormat={(x) => formatNumericValue(x)} - title={t('hourly-funding')} + tickFormat={(x) => formatNumericValue(x, 4)} + title={t('trade:hourly-funding')} xKey="date_hour" yKey={'funding_rate_hourly'} /> @@ -108,8 +106,8 @@ const PerpMarketDetails = ({ daysToShow={'999'} heightClass="h-64" suffix="%" - tickFormat={(x) => formatNumericValue(x)} - title={t('instantaneous-funding')} + tickFormat={(x) => formatNumericValue(x, 4)} + title={t('trade:instantaneous-funding')} xKey="date_hour" yKey={'instantaneous_funding_rate'} /> diff --git a/components/stats/PerpMarketsTable.tsx b/components/stats/PerpMarketsTable.tsx index 12dedc3d..9ec2c303 100644 --- a/components/stats/PerpMarketsTable.tsx +++ b/components/stats/PerpMarketsTable.tsx @@ -15,6 +15,7 @@ import { usePerpFundingRate } from '@components/trade/PerpFundingRate' import { IconButton } from '@components/shared/Button' import { ChevronRightIcon } from '@heroicons/react/20/solid' import FormatNumericValue from '@components/shared/FormatNumericValue' +import { getDecimalCount } from 'utils/numbers' const SimpleAreaChart = dynamic( () => import('@components/shared/SimpleAreaChart'), { ssr: false } @@ -76,6 +77,8 @@ const PerpMarketsTable = ({ fundingRate = '–' } + const openInterest = market.baseLotsToUi(market.openInterest) + return ( @@ -122,16 +125,14 @@ const PerpMarketsTable = ({

- {market.openInterest.toString()}{' '} - - {market.name.slice(0, -5)} - +

diff --git a/components/stats/TokenStats.tsx b/components/stats/TokenStats.tsx index 5dcdea41..0be85a37 100644 --- a/components/stats/TokenStats.tsx +++ b/components/stats/TokenStats.tsx @@ -144,6 +144,7 @@ const TokenStats = () => {