updated job directory

This commit is contained in:
Conner Gallagher 2022-06-27 10:48:55 -06:00
parent c54c082ca6
commit b7c5a20717
5 changed files with 163 additions and 62 deletions

View File

@ -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;

View File

@ -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. |

View File

@ -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";
## <IoPricetags className="devicons" />Exchange APIs
@ -511,27 +513,24 @@ Switchboard can fetch the price of any asset listed on Serum's decentralized exc
</details>
## OracleTask
## <SiAtom className="devicons" />OracleTask
Switchboard can fetch the current price of a Solana oracle protocol
<details>
<summary>
### Switchboard SOL/USDC
### Switchboard SOL/USD
</summary>
```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
</details>
## <JupiterIcon className="devicons" />JupiterSwap
Switchboard can be used to fetch the best swap price using JupiterSwap.
<details>
<summary>
### JSOL to USDC Swap
### Pyth SOL/USD
</summary>
```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.
</details>
## OrcaSwap
Switchboard can be used to fetch the best swap price using OrcaSwap.
<details>
<summary>
### GMT to USD Swap
### Chainlink SOL/USD
</summary>
```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
</details>
## <AlephIcon className="devicons" />Aleph
Switchboard can be used to fetch data from Aleph using an `httpTask`, where the url field is formatted as:
> **&lt;API SERVER&gt;**/api/v0/aggregates/**&lt;ADDRESS&gt;**.json
where,
- **API SERVER** is an http endpoint such as `https://api2.aleph.im`
- **ADDRESS** is a public key to query
<details>
<summary>
### Aggregates Example
</summary>
```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 */
]
}
```
</details>
## <GiPiggyBank className="devicons" />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
</details>
## <JupiterIcon className="devicons" />JupiterSwap
Switchboard can be used to fetch the best swap price using JupiterSwap.
<details>
<summary>
### JSOL to USDC Swap
</summary>
```json title="Jupiter_JSOL_to_USDC.json"
{
"name": "JupiterSwap JSOL to USDC",
"tasks": [
{
"jupiterSwapTask": {
/* JSOL mint address */
"inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn",
/* USDC mint address */
"outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
]
}
```
</details>
## <OrcaIcon className="devicons" />OrcaSwap
Switchboard can be used to fetch the best swap price using OrcaSwap.
<details>
<summary>
### GMT to USD Swap
</summary>
```json title="Orca_GMT_USD.json"
{
"name": "OrcaSwap GMT to USD",
"tasks": [
{
"lpExchangeRateTask": {
"orcaPoolTokenMintAddress": "CFxQF5kNAtbbDj298Xr47Sf4mkSyuzWpRH97hrdQ6kxi"
}
},
{
"multiplyTask": {
"aggregatorPubkey": "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW"
}
}
]
}
```
</details>
## <MangoIcon className="devicons" />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.

View File

@ -0,0 +1,28 @@
import { SvgIcon } from "@mui/material";
import * as React from "react";
export function AlephIcon(props) {
return (
<SvgIcon {...props} viewBox="0 0 64 64">
<g
transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)"
fill="#0054ff"
stroke="none"
>
<path
d="M225 624 c-27 -9 -65 -27 -83 -41 -32 -24 -32 -26 -16 -44 9 -10 14
-25 11 -34 -8 -20 -44 -19 -55 2 -9 15 -13 12 -31 -18 -37 -61 -54 -127 -48
-190 10 -116 82 -218 185 -266 100 -47 206 -40 301 18 30 18 33 22 18 31 -23
12 -23 58 0 58 9 0 24 -7 34 -16 16 -14 19 -13 42 18 36 48 61 140 54 205 -21
199 -224 336 -412 277z m143 -39 c4 -27 -70 -100 -92 -92 -26 10 -18 39 21 79
40 41 66 46 71 13z m-140 -127 c15 -15 15 -51 0 -66 -7 -7 -21 -12 -33 -12
-12 0 -26 5 -33 12 -28 28 -7 78 33 78 12 0 26 -5 33 -12z m100 -120 c48 -47
55 -78 18 -78 -15 0 -37 15 -60 40 -30 34 -35 44 -26 60 15 28 20 26 68 -22z
m135 -119 c5 -9 7 -28 3 -42 -5 -21 -12 -27 -34 -27 -49 0 -67 37 -35 72 19
22 51 20 66 -3z m-93 -97 c0 -10 -20 -38 -45 -62 -37 -37 -46 -41 -60 -30 -22
18 -19 25 23 69 40 43 82 55 82 23z"
/>
</g>
</SvgIcon>
);
}

View File

@ -3,49 +3,44 @@ import * as React from "react";
export function OrcaIcon(props) {
return (
<SvgIcon {...props} width="1711" height="439" viewBox="0 0 1711 439">
<path
d="m700.3 335c-21.4 0-40.7-4.6-57.9-13.8-17.2-9.4-30.7-22.3-40.5-38.7-9.8-16.6-14.7-35.1-14.7-55.5s4.9-38.8 14.7-55.2c9.8-16.6 23.3-29.5 40.5-38.7 17.2-9.4 36.5-14.1 57.9-14.1s40.7 4.7 57.9 14.1c17.2 9.2 30.7 22 40.5 38.4s14.7 34.9 14.7 55.5-4.9 39.1-14.7 55.5-23.3 29.3-40.5 38.7c-17.2 9.2-36.5 13.8-57.9 13.8zm0-34.2c14 0 26.6-3.1 37.8-9.3 11.2-6.4 20-15.2 26.4-26.4 6.4-11.4 9.6-24.1 9.6-38.1s-3.2-26.6-9.6-37.8c-6.4-11.4-15.2-20.2-26.4-26.4-11.2-6.4-23.8-9.6-37.8-9.6s-26.6 3.2-37.8 9.6c-11.2 6.2-20 15-26.4 26.4-6.4 11.2-9.6 23.8-9.6 37.8s3.2 26.7 9.6 38.1c6.4 11.2 15.2 20 26.4 26.4 11.2 6.2 23.8 9.3 37.8 9.3zm369.84 31.2-42.9-61.5c-1.8 0.2-4.5 0.3-8.1 0.3h-47.401v61.2h-39v-210h86.401c18.2 0 34 3 47.4 9 13.6 6 24 14.6 31.2 25.8s10.8 24.5 10.8 39.9c0 15.8-3.9 29.4-11.7 40.8-7.6 11.4-18.6 19.9-33 25.5l48.3 69h-42zm-0.9-135.3c0-13.4-4.4-23.7-13.2-30.9s-21.7-10.8-38.7-10.8h-45.601v83.7h45.601c17 0 29.9-3.6 38.7-10.8 8.8-7.4 13.2-17.8 13.2-31.2zm258.13 138.3c-21.2 0-40.4-4.6-57.6-13.8-17-9.4-30.4-22.3-40.2-38.7-9.6-16.4-14.4-34.9-14.4-55.5s4.9-39.1 14.7-55.5 23.2-29.2 40.2-38.4c17.2-9.4 36.4-14.1 57.6-14.1 17.2 0 32.9 3 47.1 9s26.2 14.7 36 26.1l-25.2 23.7c-15.2-16.4-33.9-24.6-56.1-24.6-14.4 0-27.3 3.2-38.7 9.6-11.4 6.2-20.3 14.9-26.7 26.1s-9.6 23.9-9.6 38.1 3.2 26.9 9.6 38.1 15.3 20 26.7 26.4c11.4 6.2 24.3 9.3 38.7 9.3 22.2 0 40.9-8.3 56.1-24.9l25.2 24c-9.8 11.4-21.9 20.1-36.3 26.1-14.2 6-29.9 9-47.1 9zm290.27-216c18.8 0 35.2 3.7 49.2 11.1s24.8 18.4 32.4 33c7.8 14.4 11.7 31.9 11.7 52.5v116.4h-39v-54h-109.2v54h-38.4v-116.4c0-20.6 3.8-38.1 11.4-52.5 7.8-14.6 18.7-25.6 32.7-33s30.4-11.1 49.2-11.1zm54.3 126.3v-33.3c0-19.4-4.8-34-14.4-43.8-9.6-10-23-15-40.2-15s-30.6 5-40.2 15c-9.6 9.8-14.4 24.4-14.4 43.8v33.3h109.2z"
fill="#fff"
/>
<SvgIcon {...props} viewBox="0 0 439 439">
<path
d="M439 219.5C439 340.727 340.727 439 219.5 439C98.2735 439 0 340.727 0 219.5C0 98.2735 98.2735 0 219.5 0C340.727 0 439 98.2735 439 219.5Z"
fill="#FFD15C"
fill="#F2C45B"
/>
<path
d="m113.18 309.45c1.894-1.286 3.662-3.214 4.542-5.949 0.978-3.04 0.401-5.715-0.057-7.196-0.015-0.049-0.031-0.099-0.047-0.148l0.365-2.131c1.008 0.567 2.168 1.329 3.491 2.259 0.319 0.224 0.765 0.542 1.229 0.873 0.609 0.435 1.251 0.893 1.679 1.191 0.735 0.511 1.779 1.224 2.885 1.811 29.271 18.193 53.478 25.693 72.705 24.764 19.878-0.961 33.818-10.961 41.009-25.554 6.95-14.106 7.192-31.585 2.321-47.777-4.901-16.297-15.211-32.135-30.578-43.096-25.894-18.468-49.621-46.55-61.619-70.428-6.093-12.127-8.517-21.907-7.877-28.293 0.297-2.972 1.208-4.77 2.297-5.927 1.09-1.158 3.076-2.435 6.902-3.065 8.104-1.3351 17.477-4.2538 26.989-7.2155 3.693-1.15 7.406-2.3065 11.075-3.3793 13.71-4.009 28.224-7.3769 43.48-7.3483 29.59 0.0556 64.316 12.902 100.88 66.345 46.969 68.653 21.183 145.37-32.926 185.67-26.985 20.099-60.653 30.767-95.25 26.711-31.152-3.652-63.779-19.329-93.494-52.118zm5.448-17.769c0 2e-3 -0.01 0.022-0.034 0.057 0.021-0.041 0.033-0.058 0.034-0.057zm-2.941 1.341c-1e-3 -2e-3 0.029 1e-3 0.094 0.017-0.06-7e-3 -0.092-0.014-0.094-0.017z"
fill="#fff"
stroke="#000"
stroke-width="17.676"
d="M115.89 314.105C117.797 312.81 119.577 310.869 120.463 308.115C121.449 305.053 120.868 302.359 120.406 300.868C120.391 300.818 120.375 300.768 120.359 300.719L120.727 298.573C121.741 299.144 122.91 299.911 124.243 300.848C124.563 301.074 125.012 301.394 125.479 301.727C126.093 302.165 126.739 302.626 127.171 302.927C127.91 303.441 128.962 304.159 130.076 304.75C159.553 323.071 183.93 330.624 203.293 329.688C223.311 328.721 237.35 318.651 244.591 303.954C251.59 289.749 251.834 272.147 246.929 255.841C241.992 239.429 231.61 223.48 216.135 212.442C190.058 193.843 166.164 165.564 154.082 141.517C147.946 129.305 145.505 119.456 146.149 113.025C146.449 110.032 147.366 108.222 148.463 107.056C149.561 105.89 151.56 104.604 155.413 103.969C163.574 102.625 173.014 99.6859 182.592 96.7033C186.311 95.5452 190.051 94.3806 193.745 93.3003C207.552 89.263 222.168 85.8713 237.532 85.9002C267.33 85.9561 302.301 98.8936 339.121 152.713C386.421 221.849 360.453 299.106 305.963 339.692C278.788 359.932 244.883 370.676 210.042 366.591C178.671 362.913 145.814 347.126 115.89 314.105ZM121.376 296.212C121.376 296.213 121.366 296.233 121.342 296.269C121.363 296.228 121.375 296.21 121.376 296.212ZM118.415 297.562C118.413 297.56 118.444 297.563 118.509 297.579C118.449 297.572 118.416 297.564 118.415 297.562Z"
fill="white"
stroke="black"
stroke-width="17.8"
/>
<path
d="m140.07 104.29s83.908-22.343 102.28-22.343 91.779 35.647 113.2 100.79c30.37 92.349-52.238 152.9-61.567 146.96 88.874-73.483-56.601-209.31-128.1-199.1-8.937 1.277-3.972 8.937-3.972 8.937l-1.986 19.86-14.895-24.825-4.965-30.286z"
fill="#000"
d="M142.967 107.5C142.967 107.5 227.467 84.9999 245.967 84.9999C264.467 84.9999 338.393 120.898 359.967 186.5C390.552 279.5 307.362 340.478 297.967 334.5C387.467 260.5 240.967 123.716 168.967 134C159.967 135.286 164.967 143 164.967 143L162.967 163L147.967 138L142.967 107.5Z"
fill="black"
/>
<path
d="m343.33 154.96c26.497 46.645 20.99 19.939 15.108 73.261 10.885-17.609 27.906-4.424 34.935 2.309 1.26 1.207 3.339 0.459 3.28-1.285-0.268-7.909-2.534-25-15.627-43.335-17.953-25.143-37.696-30.95-37.696-30.95z"
fill="#000"
d="M347.656 158.526C374.34 205.498 368.794 178.605 362.871 232.302C373.833 214.569 390.973 227.847 398.052 234.628C399.321 235.843 401.414 235.089 401.355 233.334C401.085 225.369 398.803 208.158 385.618 189.693C367.538 164.373 347.656 158.526 347.656 158.526Z"
fill="black"
/>
<path
d="m358.44 228.22c5.882-53.322 11.389-26.616-15.108-73.261 0 0 19.743 5.807 37.696 30.95 13.093 18.335 15.359 35.426 15.627 43.335 0.059 1.744-2.02 2.492-3.28 1.285-7.029-6.733-24.05-19.918-34.935-2.309zc1.013-2.503 2.595-6.41 2.595-6.41"
stroke="#000"
stroke-width=".993"
d="M362.871 232.302C368.794 178.605 374.34 205.498 347.656 158.526C347.656 158.526 367.538 164.373 385.618 189.693C398.803 208.158 401.085 225.369 401.355 233.334C401.414 235.089 399.321 235.843 398.052 234.628C390.973 227.847 373.833 214.569 362.871 232.302ZM362.871 232.302C363.891 229.781 365.484 225.847 365.484 225.847"
stroke="black"
/>
<path
d="m130.15 221.1c-11.18 18.928-34.118 17.508-33.679 40.083 20.488 45.519 20.609 42.254 20.609 42.254 37.951-21.319 22.355-68.393 16.724-82.239-0.637-1.565-2.795-1.553-3.654-0.098z"
fill="#000"
d="M132.971 225.139C121.713 244.201 98.6131 242.771 99.0553 265.505C119.687 311.345 119.81 308.057 119.81 308.057C158.027 286.587 142.322 239.181 136.651 225.238C136.01 223.662 133.836 223.675 132.971 225.139Z"
fill="black"
/>
<path
d="m44.12 262.95c21.798 2.844 34.801-16.106 52.32-1.861 23.256 44.169 20.608 42.254 20.608 42.254-40.164 16.78-67.658-24.491-75.101-37.453-0.8414-1.465 0.4972-3.158 2.1725-2.94z"
fill="#000"
d="M46.3388 267.283C68.2902 270.147 81.385 251.064 99.0273 265.409C122.448 309.889 119.781 307.961 119.781 307.961C79.3339 324.859 51.6467 283.297 44.1509 270.244C43.3037 268.769 44.6517 267.063 46.3388 267.283Z"
fill="black"
/>
<path
d="m226.96 234.87s21.847 22.345 10.427 25.818c-14.24-8.764-39.756-1.953-52.264 2.265-3.079 1.039-6.098-1.694-4.988-4.749 4.253-11.702 14.755-33.365 34.909-36.243 11.916-2.981 11.916 12.909 11.916 12.909z"
fill="#000"
d="M230.467 239.002C230.467 239.002 252.467 261.505 240.967 265.002C226.627 256.176 200.93 263.035 188.335 267.283C185.234 268.329 182.194 265.577 183.312 262.501C187.595 250.716 198.171 228.9 218.467 226.002C230.467 223 230.467 239.002 230.467 239.002Z"
fill="black"
/>
<path
d="m240.36 125.64c-2.483-3.475-7.447-12.909 7.944-12.909 15.392 0 38.91 17.428 43.692 23.875-1.489 3.929-11.419 4.808-16.384 4.426s-13.406-1.199-19.86-4.426c-6.455-3.227-12.909-7.49-15.392-10.966z"
fill="#fff"
d="M243.967 129C241.467 125.5 236.467 116 251.967 116C267.467 116 291.151 133.551 295.967 140.043C294.467 144 284.467 144.885 279.467 144.5C274.467 144.115 265.967 143.293 259.467 140.043C252.967 136.793 246.467 132.5 243.967 129Z"
fill="white"
/>
</SvgIcon>
);