sbv2-solana/website/docs-1/feeds/publisher/overview.mdx

233 lines
7.1 KiB
Plaintext

---
sidebar_position: 10
slug: /publisher
title: Publisher Overview
label: Overview
---
import MarkdownImage from "/src/components/MarkdownImage";
import { Box, Typography, Grid } from "@mui/material";
import Link from "@docusaurus/Link";
<Typography variant="h4">
<b>Link: </b>
<Link to="https://publish.switchboard.xyz/">publish.switchboard.xyz</Link>
</Typography>
## Overview
The publisher site is a decentralized marketplace that allows anyone to build a data feed and deploy it on-chain. The site includes a directory of pre-defined feeds from popular sources such as FTX, Coinbase, or any permissionless Serum market. The publisher site streamlines the on-chain workflow and allows a user to configure a data feed from a convienent UI. A Switchboard data feed has the following account structure:
<Grid container spacing={3}>
<Grid item md={5}>
<ul>
<li>
<b>Aggregator: </b>Contains the data feed configuration, dictating how
data feed updates get requested, updated, and resolved on-chain.
</li>
<li>
<b>Job Account: </b>Stores the blueprints for how data is fetched
off-chain for a particular data source.
</li>
<li>
<b>Permission Account: </b>Permits a data feed to join an oracle queue.
</li>
<li>
<b>Lease Contract: </b>Pre-funded escrow contract to reward oracles for
their work.
</li>
<li>
<b>Crank: </b>Optional, owned by the queue and allows a data feed to be
updated at a regular interval.
</li>
<li>
<b>History Buffer: </b>Optional, allows a feed to store the last N
values.
</li>
</ul>
</Grid>
<Grid item md={7}>
<MarkdownImage
img="/img/L2_Aggregator_Accounts.png"
sx={{
display: "flex",
}}
/>
</Grid>
</Grid>
See [/architecture/feeds](/architecture/feeds) for more information on Switchboard data feeds.
## Connect
<Grid container spacing={3} justifyContent="space-around">
<Grid item md={4}>
<MarkdownImage
img="/img/publisher/Connect_Wallet.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 3 }}
/>
</Grid>
<Grid item md={6}>
<Typography>
The publisher site contains a <i>Connect Wallet</i> button in the top
right corner that allows you to connect your web wallet to Devnet or
Mainnet.
</Typography>
<br />
<Typography>
The publisher site currently supports the following wallets:
</Typography>
<ul>
<li>
<a href="https://phantom.app/" target="_blank">
Phantom
</a>
</li>
<li>
<a href="https://slope.finance/" target="_blank">
Slope
</a>
</li>
<li>
<a href="https://wallet.coin98.com/" target="_blank">
Coin98
</a>
</li>
<li>
<a href="https://solflare.com/" target="_blank">
Solflare
</a>
</li>
<li>
<a href="https://www.sollet.io/" target="_blank">
Sollet
</a>
</li>
</ul>
</Grid>
</Grid>
## Directory
The publisher site includes some pre-defined sources to help developers publish data feeds. Pre-defined sources can be added to your basket by selecting them in the directory, from there you can toggle individual data sources to meet your on-chain needs.
**Coming Soon:** Users will soon have the ability to publish their own sources to the site and help grow the catalog.
<MarkdownImage
img="/img/publisher/Directory.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 3 }}
/>
## Checkout
During checkout, the publisher will create the necessary accounts for your data feed.
### Lease
<Grid container spacing={3} justifyContent="space-around">
<Grid item md={5} sm={12}>
<b>
<u>Automatic Updates</u>
</b>
<Typography>
The <i>Enable automatic updates</i> checkbox determines whether your data
feed will be added to a crank. A crank allows data feeds to be updated at
regular intervals. Event based feeds should uncheck this box.
</Typography>
<br />
<b>
<u>Update Interval</u>
</b>
<Typography>
The update interval lets you configure how often and how long a data feed
should be updated for. This derives the total cost deposited into the
lease contract escrow account, which is used to fund oracles each time a
feed is updated. You can extend or terminate a lease at anytime.
</Typography>
<br />
</Grid>
<Grid item md={6}>
<MarkdownImage
img="/img/publisher/Lease_Contract_Modal.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 5 }}
/>
</Grid>
</Grid>
### Account Creation
<Grid container spacing={3} justifyContent="space-around">
<Grid item md={6} order={{ xs: 2, md: 1 }}>
<MarkdownImage
img="/img/publisher/Account_Creation.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 3 }}
/>
</Grid>
<Grid item md={6} order={{ xs: 1, md: 2 }}>
<Typography>
The <i>Account Creation</i> modal gives you a summary of your balance
changes before any on-chain transactions occur. Once you have verified the
total cost, hit <i>Create Feed</i> to submit the transactions.
</Typography>
<br />
<Typography>
After the accounts have been created, you will be redirected to the My
Feeds page to view your newly created data feeds.
</Typography>
<br />
<Typography>
By default, data feeds are added to the permissionless queue, where they
can begin updating immediately. Data feeds can be upgraded to the
permissioned queue by submitting a request to the Switchboard DAO.
</Typography>
</Grid>
</Grid>
## My Feeds
The My Feeds page shows you a list of active data feeds associated with your wallet.
<MarkdownImage
img="/img/publisher/My_Feeds.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 3 }}
/>
<br />
The publisher site lets you manage your on-chain feeds and currently lets you:
<Grid container spacing={3} justifyContent="space-around">
<Grid item md={3} order={{ xs: 2, md: 1 }}>
<MarkdownImage
img="/img/publisher/My_Feeds_Actions.png"
sx={{ borderWidth: "thin", border: "1px solid #D3D3D3", borderRadius: 3 }}
/>
</Grid>
<Grid item md={7} order={{ xs: 1, md: 2 }}>
<ul>
<li>
<b>View Feed Details: </b> View the Aggregator configuration such as
current accepted result, oracle batch size, and associated Job account
public keys.
</li>
<li>
<b>View In Explorer: </b> View the Aggregator in the Solana block
explorer.
</li>
<li>
<b>Track Feed History: </b> Optionally, add an{" "}
<Link to="/architecture/feeds/history">aggregator history buffer</Link>{" "}
to track the last N recorded samples.
</li>
<li>
<b>Extend Lease: </b> Deposit funds in the feeds lease contract.
</li>
<li>
<b>Terminate Lease: </b> Withdraw remaining funds from a feeds lease
contract and if present, remove it from its crank.
</li>
</ul>
</Grid>
</Grid>