fix swap chart hover calculation

This commit is contained in:
tjs 2022-07-29 13:57:12 -04:00
parent 1f3b88a079
commit 0249efba5c
1 changed files with 1 additions and 2 deletions

View File

@ -146,8 +146,7 @@ const SwapTokenChart: FunctionComponent<SwapTokenChartProps> = ({
if (mouseData) {
const index = chartData.findIndex((d: any) => d.time === mouseData.time)
return (
((chartData[chartData.length - 1]['price'] -
chartData[index]['price']) /
((chartData[index]['price'] - chartData[0]['price']) /
chartData[0]['price']) *
100
)