From 0d3f030ad214d19606a2b7b5b4452a93fabdffb8 Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 29 Sep 2022 13:36:39 -0700 Subject: [PATCH] update staleness check (#319) Co-authored-by: Jayant Krishnamurthy --- third_party/pyth/price-service/src/rest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/pyth/price-service/src/rest.ts b/third_party/pyth/price-service/src/rest.ts index b67b220a..48b8100a 100644 --- a/third_party/pyth/price-service/src/rest.ts +++ b/third_party/pyth/price-service/src/rest.ts @@ -220,7 +220,7 @@ export class RestAPI { let stalePrices: Record = {} for (let priceId of priceIds) { - const latency = currentTime - this.priceFeedVaaInfo.getLatestPriceInfo(priceId)!.priceFeed.publishTime + const latency = currentTime - this.priceFeedVaaInfo.getLatestPriceInfo(priceId)!.attestationTime if (latency > stalenessThresholdSeconds) { stalePrices[priceId] = latency }