diff --git a/src/example_ws_single_feed.ts b/src/example_ws_single_feed.ts index 028f87f..8dcb3b0 100644 --- a/src/example_ws_single_feed.ts +++ b/src/example_ws_single_feed.ts @@ -7,7 +7,7 @@ const connection = new Connection(getPythClusterApiUrl(PYTHNET_CLUSTER_NAME)) const pythPublicKey = getPythProgramKeyForCluster(PYTHNET_CLUSTER_NAME) // This feed ID comes from this list: https://pyth.network/developers/price-feed-ids#solana-mainnet-beta // This example shows Crypto.SOL/USD -const feeds = [new PublicKey('HD7fKr26unn2521YNNKeV7o45c4qzpzbNMceg2NCysE1')] +const feeds = [new PublicKey('H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG')] const pythConnection = new PythConnection(connection, pythPublicKey, 'confirmed', feeds) pythConnection.onPriceChangeVerbose((productAccount, priceAccount) => { @@ -16,9 +16,9 @@ pythConnection.onPriceChangeVerbose((productAccount, priceAccount) => { const price = priceAccount.accountInfo.data // sample output: // SOL/USD: $14.627930000000001 ±$0.01551797 - if (price.price && price.confidence && price.status === PriceStatus.Trading) { + if (price.price && price.confidence) { // tslint:disable-next-line:no-console - console.log(`${price.timestamp} ${product.symbol}: $${price.aggregate.price} $${price.aggregate.priceComponent} \xB1$${price.confidence}`) + console.log(`${product.symbol}: $${price.price} \xB1$${price.confidence}`) } else { // tslint:disable-next-line:no-console console.log(`${product.symbol}: price currently unavailable. status is ${PriceStatus[price.status]}`) @@ -27,4 +27,4 @@ pythConnection.onPriceChangeVerbose((productAccount, priceAccount) => { // tslint:disable-next-line:no-console console.log('Reading from Pyth price feed...') -pythConnection.start() +pythConnection.start() \ No newline at end of file