From 24b2b406b7bb6215ec34c524fef40b63e209cac2 Mon Sep 17 00:00:00 2001 From: Riordan Panayides Date: Thu, 27 Apr 2023 19:01:52 +0100 Subject: [PATCH] Fix oracle warning for BONK --- components/trade/OraclePrice.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/trade/OraclePrice.tsx b/components/trade/OraclePrice.tsx index f010ff7f..6283e5d1 100644 --- a/components/trade/OraclePrice.tsx +++ b/components/trade/OraclePrice.tsx @@ -102,10 +102,11 @@ const OraclePrice = () => { oracleWriteSlot, accountSlot ) + const maxStalenessSlots = marketOrBank.oracleConfig.maxStalenessSlots.toNumber() setHighestSlot(highestSlot) setIsStale( - highestSlot - lastUpdatedSlot > - marketOrBank.oracleConfig.maxStalenessSlots.toNumber() + maxStalenessSlots > 0 && + highestSlot - lastUpdatedSlot > maxStalenessSlots ) if (selectedMarket instanceof PerpMarket) {