Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel committed Feb 27, 2024
1 parent 1904505 commit 73982d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/example_ws_single_feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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]}`)
Expand All @@ -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()

0 comments on commit 73982d5

Please sign in to comment.