diff --git a/libraries/protos/job_schemas.proto b/libraries/protos/job_schemas.proto index 158cfe5..c9e2197 100644 --- a/libraries/protos/job_schemas.proto +++ b/libraries/protos/job_schemas.proto @@ -313,7 +313,7 @@ message OracleJob { oneof AggregatorAddress { // 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 string switchboard_address = 1; - // Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/markets/ + // Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/price-feeds/ string pyth_address = 2; // Mainnet address for a Chainlink feed. A full list can be found here: https://docs.chain.link/docs/solana/data-feeds-solana string chainlink_address = 3; diff --git a/website/api/switchboard-tasks.md b/website/api/switchboard-tasks.md index 7324997..fd46aa9 100644 --- a/website/api/switchboard-tasks.md +++ b/website/api/switchboard-tasks.md @@ -89,7 +89,7 @@ Fetch the current price of a Solana oracle protocol. | Field | Type | Label | Description | | -------------------------------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | switchboard_address | [string](#string) | optional | 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 | -| pyth_address | [string](#string) | optional | Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/markets/ | +| pyth_address | [string](#string) | optional | Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/price-feeds/ | | chainlink_address | [string](#string) | optional | Mainnet address for a Chainlink feed. A full list can be found here: https://docs.chain.link/docs/solana/data-feeds-solana | | pyth_allowed_confidence_interval | [double](#double) | optional | 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. | diff --git a/website/docs/feed/directory.mdx b/website/docs/feed/directory.mdx index ac64bb3..d4ba72b 100644 --- a/website/docs/feed/directory.mdx +++ b/website/docs/feed/directory.mdx @@ -11,6 +11,7 @@ import { IoPricetags } from "react-icons/io5"; import { SerumIcon } from "/src/components/icons/SerumIcon"; import { MangoIcon } from "/src/components/icons/MangoIcon"; import { JupiterIcon } from "/src/components/icons/JupiterIcon"; +import { AlephIcon } from "/src/components/icons/AlephIcon"; import { OrcaIcon } from "/src/components/icons/OrcaIcon"; import { BiCylinder } from "react-icons/bi"; import { MdOutlineSportsBasketball } from "react-icons/md"; @@ -19,6 +20,7 @@ import { MdOutlineAccessTimeFilled } from "react-icons/md"; import { FcMultipleInputs } from "react-icons/fc"; import { GiPiggyBank } from "react-icons/gi"; import { GiGrainBundle } from "react-icons/gi"; +import { SiAtom } from "react-icons/si"; ## Exchange APIs @@ -511,27 +513,24 @@ Switchboard can fetch the price of any asset listed on Serum's decentralized exc -## OracleTask +## OracleTask Switchboard can fetch the current price of a Solana oracle protocol
-### Switchboard SOL/USDC +### Switchboard SOL/USD -```json title="Serum_MNGO_USD.json" +```json title="Switchboard_SOL_USD.json" { - "name": "JupiterSwap JSOL to USDC", + "name": "Switchboard SOL/USD", "tasks": [ { - "jupiterSwapTask": { - /* JSOL mint address */ - "inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn", - /* USDC mint address */ - "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" + "oracleTask": { + "switchboardAddress": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR" } } ] @@ -540,27 +539,21 @@ Switchboard can fetch the current price of a Solana oracle protocol
-## JupiterSwap - -Switchboard can be used to fetch the best swap price using JupiterSwap. -
-### JSOL to USDC Swap +### Pyth SOL/USD -```json title="Jupiter_JSOL_to_USDC.json" +```json title="Pyth_SOL_USD.json" { - "name": "JupiterSwap JSOL to USDC", + "name": "Pyth SOL/USD", "tasks": [ { - "jupiterSwapTask": { - /* JSOL mint address */ - "inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn", - /* USDC mint address */ - "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" + "oracleTask": { + "pythAddress": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG", + "pythAllowedConfidenceInterval": 0.002 } } ] @@ -569,29 +562,20 @@ Switchboard can be used to fetch the best swap price using JupiterSwap.
-## OrcaSwap - -Switchboard can be used to fetch the best swap price using OrcaSwap. -
-### GMT to USD Swap +### Chainlink SOL/USD -```json title="Orca_GMT_USD.json" +```json title="Chainlink_SOL_USD.json" { - "name": "OrcaSwap GMT to USD", + "name": "Chainlink SOL/USD", "tasks": [ { - "lpExchangeRateTask": { - "orcaPoolTokenMintAddress": "CFxQF5kNAtbbDj298Xr47Sf4mkSyuzWpRH97hrdQ6kxi" - } - }, - { - "multiplyTask": { - "aggregatorPubkey": "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW" + "oracleTask": { + "chainlinkAddress": "CcPVS9bqyXbD9cLnTbhhHazLsrua8QMFUHTutPtjyDzq" } } ] @@ -652,6 +636,40 @@ Aggregators can be initialized with a history buffer to store a buffer of accept
+## Aleph + +Switchboard can be used to fetch data from Aleph using an `httpTask`, where the url field is formatted as: + +> **<API SERVER>**/api/v0/aggregates/**<ADDRESS>**.json + +where, + +- **API SERVER** is an http endpoint such as `https://api2.aleph.im` +- **ADDRESS** is a public key to query + +
+ + +### Aggregates Example + + + +```json title="Aleph_Fetch.json" +{ + "name": "Aleph Aggregates Fetch", + "tasks": [ + { + "httpTask": { + "url": "https://api2.aleph.im/api/v0/aggregates/4upkSuPTUWJ7uk6TxzmAoqRbW2t1vPrUD7RWkYVNYMWz.json" + } + } + /** Additional tasks to parse the JSON response */ + ] +} +``` + +
+ ## Lending Rates Switchboard oracles can resolve the lending and borrow rates for the following Solana lending programs: @@ -717,6 +735,66 @@ A `field` of 1 represents a borrow rate and a `field` of 0 represents a lending +## JupiterSwap + +Switchboard can be used to fetch the best swap price using JupiterSwap. + +
+ + +### JSOL to USDC Swap + + + +```json title="Jupiter_JSOL_to_USDC.json" +{ + "name": "JupiterSwap JSOL to USDC", + "tasks": [ + { + "jupiterSwapTask": { + /* JSOL mint address */ + "inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn", + /* USDC mint address */ + "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" + } + } + ] +} +``` + +
+ +## OrcaSwap + +Switchboard can be used to fetch the best swap price using OrcaSwap. + +
+ + +### GMT to USD Swap + + + +```json title="Orca_GMT_USD.json" +{ + "name": "OrcaSwap GMT to USD", + "tasks": [ + { + "lpExchangeRateTask": { + "orcaPoolTokenMintAddress": "CFxQF5kNAtbbDj298Xr47Sf4mkSyuzWpRH97hrdQ6kxi" + } + }, + { + "multiplyTask": { + "aggregatorPubkey": "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW" + } + } + ] +} +``` + +
+ ## Mango Perps Switchboard oracles can be used to resolve the price on Mango's perpetual markets. You can find a list of market addresses in their [mango-client-v3](https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json) repo. diff --git a/website/src/components/icons/AlephIcon.tsx b/website/src/components/icons/AlephIcon.tsx new file mode 100644 index 0000000..e097e08 --- /dev/null +++ b/website/src/components/icons/AlephIcon.tsx @@ -0,0 +1,28 @@ +import { SvgIcon } from "@mui/material"; +import * as React from "react"; + +export function AlephIcon(props) { + return ( + + + + + + ); +} diff --git a/website/src/components/icons/OrcaIcon.tsx b/website/src/components/icons/OrcaIcon.tsx index 08abb8e..1ccba3a 100644 --- a/website/src/components/icons/OrcaIcon.tsx +++ b/website/src/components/icons/OrcaIcon.tsx @@ -3,49 +3,44 @@ import * as React from "react"; export function OrcaIcon(props) { return ( - - + );