This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
pages/price-feeds/use-real-time-data Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ pub fn sample_with_twap(
285285 twap_window_seconds ,
286286 & feed_id ,
287287 )? ;
288-
288+
289289 // Sample output:
290290 // The TWAP price is (7160106530699 ± 5129162301) * 10^-8
291291 msg! (" The TWAP price is ({} ± {}) * 10^{}" , price . price, price . conf, price . exponent);
@@ -308,16 +308,13 @@ import { HermesClient } from "@pythnetwork/hermes-client";
308308// The URL below is a public Hermes instance operated by the Pyth Data Association.
309309// Hermes is also available from several third-party providers listed here:
310310// https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
311- const hermesClient = new HermesClient (
312- " https://hermes.pyth.network/" ,
313- {}
314- );
311+ const hermesClient = new HermesClient (" https://hermes.pyth.network/" , {});
315312
316313// Specify the price feed ID and the TWAP window in seconds (maximum 600 seconds)
317314const twapWindowSeconds = 300 ; // 5 minutes
318315const twapUpdateData = await hermesClient .getLatestTwaps (
319316 [" 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" ], // BTC/USD feed ID
320- twapWindowSeconds ,
317+ twapWindowSeconds ,
321318 { encoding: " base64" }
322319);
323320
You can’t perform that action at this time.
0 commit comments