Skip to content

Commit

Permalink
Custom & New Token categories & Dev Resp update (#2112)
Browse files Browse the repository at this point in the history
* init

* nit

* update

* Custom Feeds Dev Res

* Update Dev Resp
  • Loading branch information
khadni authored Nov 7, 2024
1 parent 2f92528 commit 433adc5
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 46 deletions.
9 changes: 8 additions & 1 deletion src/content/data-streams/developer-responsibilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,21 @@ Token prices may exhibit oscillations between two or more price points within re

Developers implementing Chainlink New Token Data Streams are responsible for independently verifying the liquidity, quality and stability of the assets pricing when integrating them in their use cases

#### Custom Data Streams

Custom Data Streams are built to serve a specific use case and might not be suitable for general use or your use case's risk parameters. Users must evaluate the properties of a feed to make sure it aligns with their intended use case. [Contact the Chainlink Labs team](https://chain.link/contact?ref_id=DataStreams) if you want more detail on any specific feeds in this category.

### Application Code Risks

Developers implementing Chainlink Data Streams are solely responsible for instituting risk mitigations, including, but not limited to, data quality checks, circuit breakers, and appropriate contingency logic for their use case. Some general guidelines include:

- **Code quality and reliability:** Developers must execute code using Chainlink Data Streams only if their code meets the quality and reliability requirements for their use case and application.
- **Code and application audits:** Developers are responsible for auditing their code and applications before deploying to production. Developers must determine the quality of any audits and ensure that they meet the requirements for their application.
- **Code dependencies and imports:** Developers are responsible for ensuring the quality, reliability, and security of any dependencies or imported packages that they use with Chainlink Data Streams, and review and audit these dependencies and packages.
- **Contingency Logic:** In extreme circumstances, including situations outside the control of Chainlink node operators, Chainlink Data Streams may experience periods of unavailability or performance degradation. Developers are responsible for implementing contingency plans for such circumstances specific to their application, such as the use of the active-active SDK for Data Streams, a secondary fallback oracle, and/or circuit breakers to stall trading.
- **Implementing Contingency Logic:** In extreme circumstances, including situations beyond the control of Chainlink node operators, Chainlink Data Streams may experience periods of unavailability or performance degradation. When a WebSocket connection is dropped, user systems must manage reconnections effectively. Developers are responsible for creating contingency plans tailored to their specific application needs, such as:
- Implementing the [Streams Direct Architecture](/data-streams/architecture#streams-direct-architecture),
- Adopting an [active-active](/data-streams/architecture#active-active-multi-site-deployment) deployment strategy and [configuring the SDK](/data-streams/reference/streams-direct/streams-direct-go-sdk#config-struct) to support multiple concurrent WebSocket connections,
- Retrieving any potentially missing reports via the [REST API](/data-streams/reference/streams-direct/streams-direct-interface-api).

### Additional Considerations on Data Usage and Verification

Expand Down
111 changes: 66 additions & 45 deletions src/features/feeds/components/Tables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Pagination = ({ addrPerPage, totalAddr, paginate, currentPage, firstAddr,
}

return (
<div class={tableStyles.pagination}>
<div className={tableStyles.pagination}>
{totalAddr !== 0 && (
<>
<button
Expand Down Expand Up @@ -121,7 +121,7 @@ const handleClick = (e, additionalInfo) => {
const DefaultTHead = ({ showExtraDetails }: { showExtraDetails: boolean }) => (
<thead>
<tr>
<th class={tableStyles.heading}>Pair</th>
<th className={tableStyles.heading}>Pair</th>
<th aria-hidden={!showExtraDetails}>Deviation</th>
<th aria-hidden={!showExtraDetails}>Heartbeat</th>
<th aria-hidden={!showExtraDetails}>Dec</th>
Expand All @@ -132,7 +132,7 @@ const DefaultTHead = ({ showExtraDetails }: { showExtraDetails: boolean }) => (

const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
<tr>
<td class={tableStyles.pairCol}>
<td className={tableStyles.pairCol}>
<div className={tableStyles.assetPair}>
{feedCategories[proxy.docs.feedCategory] || ""}
{proxy.name}
Expand All @@ -152,7 +152,7 @@ const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
<td>
<div className={tableStyles.assetAddress}>
<button
class={clsx(tableStyles.copyBtn, "copy-iconbutton")}
className={clsx(tableStyles.copyBtn, "copy-iconbutton")}
data-clipboard-text={proxy.proxyAddress ?? proxy.transmissionsAccount}
onClick={(e) =>
handleClick(e, {
Expand All @@ -167,7 +167,7 @@ const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
<img src="/assets/icons/copyIcon.svg" alt="copy to clipboard" />
</button>
<a
class={tableStyles.addressLink}
className={tableStyles.addressLink}
href={network.explorerUrl.replace("%s", proxy.proxyAddress ?? proxy.transmissionsAccount)}
target="_blank"
>
Expand All @@ -176,19 +176,19 @@ const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
</div>
{!isTestnet && (
<div>
<dl class={tableStyles.porDl}>
<dl className={tableStyles.porDl}>
{proxy.docs.assetName && (
<div>
<dt>
<span class="label">Asset name:</span>
<span className="label">Asset name:</span>
</dt>
<dd>{proxy.docs.assetName}</dd>
</div>
)}
{proxy.docs.feedType && (
<div>
<dt>
<span class="label">Asset type:</span>
<span className="label">Asset type:</span>
</dt>
<dd>
{proxy.docs.feedType}
Expand All @@ -199,7 +199,7 @@ const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
{proxy.docs.marketHours && (
<div>
<dt>
<span class="label">Market hours:</span>
<span className="label">Market hours:</span>
</dt>
<dd>
<a href="/data-feeds/selecting-data-feeds#market-hours" target="_blank">
Expand All @@ -218,7 +218,7 @@ const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => (
const SmartDataTHead = ({ showExtraDetails }: { showExtraDetails: boolean }) => (
<thead>
<tr>
<th class={tableStyles.heading}>SmartData Feed</th>
<th className={tableStyles.heading}>SmartData Feed</th>
<th aria-hidden={!showExtraDetails}>Deviation</th>
<th aria-hidden={!showExtraDetails}>Heartbeat</th>
<th aria-hidden={!showExtraDetails}>Dec</th>
Expand All @@ -229,7 +229,7 @@ const SmartDataTHead = ({ showExtraDetails }: { showExtraDetails: boolean }) =>

const SmartDataTr = ({ network, proxy, showExtraDetails }) => (
<tr>
<td class={tableStyles.pairCol}>
<td className={tableStyles.pairCol}>
{feedItems.map((feedItem: FeedDataItem) => {
const [feedAddress] = Object.keys(feedItem)
if (feedAddress === proxy.proxyAddress) {
Expand Down Expand Up @@ -269,11 +269,15 @@ const SmartDataTr = ({ network, proxy, showExtraDetails }) => (
<td aria-hidden={!showExtraDetails}>{proxy.decimals ? proxy.decimals : "N/A"}</td>
<td>
<div className={tableStyles.assetAddress}>
<a class={tableStyles.addressLink} href={network.explorerUrl.replace("%s", proxy.proxyAddress)} target="_blank">
<a
className={tableStyles.addressLink}
href={network.explorerUrl.replace("%s", proxy.proxyAddress)}
target="_blank"
>
{proxy.proxyAddress}
</a>
<button
class={clsx(tableStyles.copyBtn, "copy-iconbutton")}
className={clsx(tableStyles.copyBtn, "copy-iconbutton")}
style={{ height: "16px", width: "16px" }}
data-clipboard-text={proxy.proxyAddress}
onClick={(e) =>
Expand All @@ -290,32 +294,32 @@ const SmartDataTr = ({ network, proxy, showExtraDetails }) => (
</button>
</div>
<div>
<dl class={tableStyles.porDl}>
<dl className={tableStyles.porDl}>
<div>
<dt>
<span class="label">Asset name:</span>
<span className="label">Asset name:</span>
</dt>
<dd>{proxy.docs.assetName}</dd>
</div>
{proxy.docs.porType && (
<div>
<dt>
<span class="label">Reserve type:</span>
<span className="label">Reserve type:</span>
</dt>
<dd>{proxy.docs.porType}</dd>
</div>
)}
{proxy.docs.porAuditor && (
<div>
<dt>
<span class="label">Data source:</span>
<span className="label">Data source:</span>
</dt>
<dd>{proxy.docs.porAuditor}</dd>
</div>
)}
<div>
<dt>
<span class="label">
<span className="label">
{proxy.docs.porSource === "Third-party" ? "Auditor verification:" : "Reporting:"}
</span>
</dt>
Expand All @@ -324,7 +328,7 @@ const SmartDataTr = ({ network, proxy, showExtraDetails }) => (
{proxy.docs.issuer ? (
<div>
<dt>
<span class="label">Issuer:</span>
<span className="label">Issuer:</span>
</dt>
<dd>{proxy.docs.issuer}</dd>
</div>
Expand Down Expand Up @@ -415,7 +419,7 @@ const StreamsNetworksData = [

export const StreamsVerifierProxyTable = () => {
return (
<table class={clsx(feedList.verifierProxyTable, tableStyles.table)}>
<table className={clsx(feedList.verifierProxyTable, tableStyles.table)}>
<thead>
<tr>
<th>Network</th>
Expand Down Expand Up @@ -526,15 +530,26 @@ export const StreamsVerifierProxyTable = () => {
const StreamsTHead = () => (
<thead>
<tr>
<th class={tableStyles.heading}>Stream</th>
<th className={tableStyles.heading}>Stream</th>
<th>Details</th>
</tr>
</thead>
)

const streamsCategoryMap = {
custom: {
text: "Custom",
link: "/data-streams/developer-responsibilities/#custom-data-streams",
},
new_token: {
text: "New token",
link: "/data-streams/developer-responsibilities#new-token-data-streams",
},
}

const StreamsTr = ({ proxy, showExtraDetails, isMainnet }) => (
<tr>
<td class={tableStyles.pairCol}>
<td className={tableStyles.pairCol}>
<div className={tableStyles.assetPair}>
{proxy.pair[0]}/{proxy.pair[1]}
</div>
Expand All @@ -549,10 +564,10 @@ const StreamsTr = ({ proxy, showExtraDetails, isMainnet }) => (
</td>
<td style="width:80%;">
<div className={tableStyles.assetAddress}>
<span class="label">ID:</span>
<span className="label">ID:</span>
{proxy.feedId}
<button
class={clsx(tableStyles.copyBtn, "copy-iconbutton")}
className={clsx(tableStyles.copyBtn, "copy-iconbutton")}
style={{ height: "16px", width: "16px" }}
data-clipboard-text={proxy.feedId}
onClick={(e) =>
Expand All @@ -569,27 +584,27 @@ const StreamsTr = ({ proxy, showExtraDetails, isMainnet }) => (
</button>
</div>
<div>
<dl class={tableStyles.porDl}>
<dl className={tableStyles.porDl}>
{isMainnet && proxy.docs.clicProductName && (
<div>
<dt>
<span class="label">Full name:</span>
<span className="label">Full name:</span>
</dt>
<dd>{proxy.docs.clicProductName}</dd>
</div>
)}
{proxy.docs.assetName && (
<div>
<dt>
<span class="label">Asset name:</span>
<span className="label">Asset name:</span>
</dt>
<dd>{proxy.docs.assetName}</dd>
</div>
)}
{proxy.docs.assetClass ? (
<div>
<dt>
<span class="label">Asset class:</span>
<span className="label">Asset class:</span>
</dt>
<dd>
{proxy.docs.assetClass}
Expand All @@ -600,37 +615,43 @@ const StreamsTr = ({ proxy, showExtraDetails, isMainnet }) => (
: ""}
</dd>
</div>
) : (
""
)}
) : null}
{proxy.docs.marketHours ? (
<div aria-hidden={!showExtraDetails}>
<dt>
<span class="label">Market hours:</span>
<span className="label">Market hours:</span>
</dt>
<dd>
<a href="/data-feeds/selecting-data-feeds#market-hours" target="_blank">
{proxy.docs.marketHours}
</a>
</dd>
</div>
) : (
""
)}
) : null}
{streamsCategoryMap[proxy.docs.feedCategory] ? (
<div>
<dt>
<span className="label">Category:</span>
</dt>
<dd>
<a href={streamsCategoryMap[proxy.docs.feedCategory].link}>
{streamsCategoryMap[proxy.docs.feedCategory].text}
</a>
</dd>
</div>
) : null}
{proxy.decimals ? (
<div>
<dt>
<span class="label">Decimals:</span>
<span className="label">Decimals:</span>
</dt>
<dd>{proxy.decimals}</dd>
</div>
) : (
""
)}
) : null}
{proxy.docs.feedType === "Crypto" && (
<div>
<dt>
<span class="label">Report Schema:</span>
<span className="label">Report Schema:</span>
</dt>
<dd>
<a href="/data-streams/reference/report-schema" rel="noreferrer" target="_blank">
Expand All @@ -642,7 +663,7 @@ const StreamsTr = ({ proxy, showExtraDetails, isMainnet }) => (
{proxy.docs.feedType === "Forex" && (
<div>
<dt>
<span class="label">Report Schema:</span>
<span className="label">Report Schema:</span>
</dt>
<dd>
<a href="/data-streams/reference/report-schema-v4" rel="noreferrer" target="_blank">
Expand Down Expand Up @@ -735,8 +756,8 @@ export const MainnetTable = ({
const slicedFilteredMetadata = filteredMetadata.slice(firstAddr, lastAddr)
return (
<>
<div class={tableStyles.tableWrapper}>
<table class={tableStyles.table}>
<div className={tableStyles.tableWrapper}>
<table className={tableStyles.table}>
{slicedFilteredMetadata.length === 0 ? (
<tbody>
<tr>
Expand Down Expand Up @@ -816,8 +837,8 @@ export const TestnetTable = ({
})

return (
<div class={tableStyles.tableWrapper}>
<table class={tableStyles.table}>
<div className={tableStyles.tableWrapper}>
<table className={tableStyles.table}>
{isStreams && <StreamsTHead />}
{isSmartData && <SmartDataTHead showExtraDetails={showExtraDetails} />}
{isDefault && <DefaultTHead showExtraDetails={showExtraDetails} />}
Expand Down

0 comments on commit 433adc5

Please sign in to comment.