Skip to main content

OracleTask

Fetch the current price of a Solana oracle protocol.

Input: None

Returns: The current price of an on-chain oracle.

Example: The Switchboard SOL/USD oracle price.

{
"oracleTask": {
"switchboardAddress": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR"
}
}

Example: The Pyth SOL/USD oracle price.

{
"oracleTask": {
"pythAddress": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG"
}
}

Example: The Chainlink SOL/USD oracle price.

{
"oracleTask": {
"chainlinkAddress": "CcPVS9bqyXbD9cLnTbhhHazLsrua8QMFUHTutPtjyDzq"
}
}

See the OracleTask typescript definition in @switchboard-xyz/common

Fields

NameTypeDescription
 switchboardAddress

string

Mainnet address of a Switchboard V2 feed. Switchboard is decentralized and allows anyone to build their own feed. A small subset of feeds is available here: https://switchboard.xyz/explorer

 pythAddress

string

Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/price-feeds/

 chainlinkAddress

string

Mainnet address for a Chainlink feed. A full list can be found here: https://docs.chain.link/docs/solana/data-feeds-solana

 pythAllowedConfidenceInterval

double

Value (as a percentage) that the lower bound confidence interval is of the actual value. / Confidence intervals that are larger that this treshold are rejected. / / The confidence interval should be provided as a raw percentage value. For example, to / represent 10%, enter the value as 10, not 0.1.