You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to get the latest price of SOL/USD from SOLANA mainnet-beta.
I found price account of SOL/USD is H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG
Hello,
I am trying to get the latest price of SOL/USD from SOLANA mainnet-beta.
I found price account of SOL/USD is H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG
**import { getPythProgramKeyForCluster, PythHttpClient, parsePriceData, getPythClusterApiUrl } from "@pythnetwork/client";
const SOL_PRICE_FEED_ID = "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d";
export const SOL_PRICE_FEED_ACCOUNT = 'H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG'
const connection = new anchor.web3.Connection(getPythClusterApiUrl('mainnet-beta'))
const onChanAccount = await connection.getAccountInfo(new anchor.web3.PublicKey(SOL_PRICE_FEED_ACCOUNT))
console.log(parsePriceData(onChanAccount.data).aggregate.price)
const connection = new anchor.web3.Connection(getPythClusterApiUrl('pythnet'))
const accountInfo= await connection.getAccountInfo(new anchor.web3.PublicKey(SOL_PRICE_FEED_ACCOUNT))
console.log(parsePriceData(accountInfo.data).aggregate.price)**
The results are different and price from pythnet is correct but the price from mainnet-beta is wrong.
The console output
119.23378
159.55172424
Let me know what is wrong
Thanks
The text was updated successfully, but these errors were encountered: