diff --git a/src/components/Charts/Density/index.tsx b/src/components/Charts/Density/index.tsx index 822cd5b..d61189c 100644 --- a/src/components/Charts/Density/index.tsx +++ b/src/components/Charts/Density/index.tsx @@ -118,7 +118,7 @@ function DensityChart({ address, client }: IProps) { borderColor: null, borderWidth: 2, }, - data: data?.formatData.map(({ isCurrent, activeLiquidity }) => (isCurrent ? 0 : activeLiquidity)).toReversed(), + data: data?.formatData.map(({ isCurrent, activeLiquidity }) => (isCurrent ? 0 : Math.max(activeLiquidity, 0))).toReversed(), }, { name: 'Active Tick', @@ -133,7 +133,7 @@ function DensityChart({ address, client }: IProps) { borderColor: null, borderWidth: 2, }, - data: data?.formatData.map(({ isCurrent, activeLiquidity }) => (isCurrent ? activeLiquidity : 0)).toReversed(), + data: data?.formatData.map(({ isCurrent, activeLiquidity }) => (isCurrent ? Math.max(activeLiquidity, 0) : 0)).toReversed(), }, ], }; diff --git a/src/components/Charts/Density/utils.ts b/src/components/Charts/Density/utils.ts index 395d08e..9143390 100644 --- a/src/components/Charts/Density/utils.ts +++ b/src/components/Charts/Density/utils.ts @@ -49,8 +49,8 @@ export const getRenderTooltip = const token1 = poolData?.token1; const price0 = tick?.price0; const price1 = tick?.price1; - const tvlToken0 = tick?.tvlToken0; - const tvlToken1 = tick?.tvlToken1; + const tvlToken0 = Math.max(tick?.tvlToken0 || 0, 0); + const tvlToken1 = Math.max(tick?.tvlToken1 || 0, 0); if (!tvlToken0 && !tvlToken1) { return ''; diff --git a/src/components/Charts/index.stories.tsx b/src/components/Charts/index.stories.tsx index 8e59d7c..d57ba8e 100644 --- a/src/components/Charts/index.stories.tsx +++ b/src/components/Charts/index.stories.tsx @@ -15,14 +15,14 @@ export const Terminal: React.FC = () => { return ; }; -const client = new GraphQLClient('https://metis.graph.wagmi.com/subgraphs/name/v3'); +const client = new GraphQLClient('https://kava.graph.wagmi.com/subgraphs/name/v3'); const queryClient = new QueryClient(); export const Density: React.FC = () => { return ( - + )