From 74a56289f910bc5f41dc982798a333dfd6eac655 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Fri, 7 Jun 2024 14:54:50 +0500 Subject: [PATCH] chore: compute price change if sortedOracleDailyPrices > 2 --- src/widgets/TokenPrices.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/TokenPrices.tsx b/src/widgets/TokenPrices.tsx index 06b367c..84145d1 100644 --- a/src/widgets/TokenPrices.tsx +++ b/src/widgets/TokenPrices.tsx @@ -38,7 +38,7 @@ export function TokenPrices({ title = 'Summary', data, isLoading }: Props) { // Determine 24h change in oracle price const sortedOracleDailyPrices = token?.oracleDailyPrices?.sort((a, b) => b.dateKey - a.dateKey); const changeValue = - sortedOracleDailyPrices.length > 0 + sortedOracleDailyPrices.length > 2 ? (() => { const oraclePriceYesterday = sortedOracleDailyPrices[0].typeOutAmountLast / sortedOracleDailyPrices[0].typeInAmountLast;