description |
---|
Switchboard can fetch data from a number of oracles. Here's how to use them. |
The Pyth Oracle Network provides a over 500 data feeds that you can read through the Switchboard Oracle Aggregator task.
Here's an example of the Pyth oracle task, being used to pull the price of SNX/USD:
// SNX/USD Task with accepted confidence interval of 1.2%
{
oracleTask: {
pythAddress: "0x39d020f60982ed892abbcd4a06a276a9f9b7bfbce003204c110b6e488f502da3",
pythAllowedConfidenceInterval: 1.2,
},
}
The Chainlink Oracle Network provides 145 data feeds at the time of writing on the Arbitrum L2 Mainnet. Check out the available feed addresses here.
// AAVE/USD Task with accepted confidence interval of 1.2%
{
oracleTask: {
chainlinkAddress: "0x3c6AbdA21358c15601A3175D8dd66D0c572cc904"
},
}
Switchboard V2 (Solana Push) feeds can be referenced within on-demand feeds. It's simple, all you need is an Aggregator public key, which you can find on the V2 Explorer App.
Here's an example of a Switchboard Oracle Task for the price of BTC/USD:
// BTC/USD Task
{
oracleTask: {
switchboardAddress: "8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee",
}
}