diff --git a/src/components/visx/TimeSeriesChart.tsx b/src/components/visx/TimeSeriesChart.tsx index fd8421032..e06d27fb0 100644 --- a/src/components/visx/TimeSeriesChart.tsx +++ b/src/components/visx/TimeSeriesChart.tsx @@ -161,7 +161,7 @@ export const TimeSeriesChart = ({ return getClampedZoomDomain(defaultZoomDomain); } if (latestDatum != null && earliestDatum != null) { - return xAccessor(latestDatum) - xAccessor(earliestDatum); + return getClampedZoomDomain(xAccessor(latestDatum) - xAccessor(earliestDatum)); } return minZoomDomain; })() diff --git a/src/views/charts/FundingChart/index.tsx b/src/views/charts/FundingChart/index.tsx index 64de28a1a..9900ceff8 100644 --- a/src/views/charts/FundingChart/index.tsx +++ b/src/views/charts/FundingChart/index.tsx @@ -10,6 +10,7 @@ import { FundingRateResolution, type FundingChartDatum } from '@/constants/chart import { STRING_KEYS } from '@/constants/localization'; import { FundingDirection } from '@/constants/markets'; import { SMALL_PERCENT_DECIMALS, TINY_PERCENT_DECIMALS } from '@/constants/numbers'; +import { timeUnits } from '@/constants/time'; import { useBreakpoints } from '@/hooks/useBreakpoints'; import { useStringGetter } from '@/hooks/useStringGetter'; @@ -26,7 +27,7 @@ import { MustBigNumber } from '@/lib/numbers'; import { FundingChartTooltipContent } from './Tooltip'; -const FUNDING_RATE_TIME_RESOLUTION = 60 * 60 * 1000; // 1 hour +const FUNDING_RATE_TIME_RESOLUTION = timeUnits.hour; const getAllFundingRates = (oneHourRate: number = 0) => ({ [FundingRateResolution.OneHour]: oneHourRate,