Skip to content

Commit d52f1e3

Browse files
authored
Data Streams: Tutorial Consolidation (#2927)
* init restructure * new content for generic DS tutorials * remove old tutos and update links, redirects * linkfix * linkfix * reword * updated *-sdk-decode->*-sdk-fetch * schema recommendations on verification pages * update * report schema overview update * report-schema-overview self review * review changes * PM schema overview edits
1 parent 932e698 commit d52f1e3

31 files changed

+1218
-4076
lines changed

src/config/sidebar.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
369369
{
370370
section: "Streams & Report Schemas",
371371
contents: [
372+
{
373+
title: "Overview",
374+
url: "data-streams/reference/report-schema-overview",
375+
},
372376
{
373377
title: "Cryptocurrency Streams",
374378
url: "data-streams/crypto-streams",
@@ -428,25 +432,13 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
428432
},
429433
{
430434
title: "Fetch and decode reports",
431-
url: "data-streams/tutorials/api-go",
432-
highlightAsCurrent: [
433-
"data-streams/tutorials/api-rust",
434-
"data-streams/tutorials/api-rwa-go",
435-
"data-streams/tutorials/api-rwa-rust",
436-
"data-streams/tutorials/api-nav-rust",
437-
"data-streams/tutorials/api-nav-go",
438-
],
435+
url: "data-streams/tutorials/go-sdk-fetch",
436+
highlightAsCurrent: ["data-streams/tutorials/rust-sdk-fetch"],
439437
},
440438
{
441439
title: "Stream and decode reports (WebSocket)",
442-
url: "data-streams/tutorials/ws-go",
443-
highlightAsCurrent: [
444-
"data-streams/tutorials/ws-rust",
445-
"data-streams/tutorials/ws-rwa-go",
446-
"data-streams/tutorials/ws-rwa-rust",
447-
"data-streams/tutorials/ws-nav-go",
448-
"data-streams/tutorials/ws-nav-rust",
449-
],
440+
url: "data-streams/tutorials/go-sdk-stream",
441+
highlightAsCurrent: ["data-streams/tutorials/rust-sdk-stream"],
450442
},
451443
{
452444
title: "Verify report data (EVM)",

src/content/data-streams/architecture.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
keywords: ["Data Streams", "Architecture", "Oracle Network", "DON", "Verification", "API", "Streams Trade"]
88
whatsnext:
99
{
10-
"Learn more about the Standard API Implementation": "/data-streams/tutorials/api-go",
10+
"Learn more about the Standard API Implementation": "/data-streams/tutorials/go-sdk-fetch",
1111
"Learn more about the Streams Trade Implementation": "/data-streams/streams-trade",
1212
"Find the list of available Stream IDs": "/data-streams/crypto-streams",
1313
"Find the schema of data to expect from Data Streams reports: Crypto": "/data-streams/reference/report-schema-v3",

src/content/data-streams/developer-responsibilities.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ whatsnext:
1111
"Find the schema of data to expect from Data Streams reports: Crypto": "/data-streams/reference/report-schema-v3",
1212
"Find the schema of data to expect from Data Streams reports: RWA": "/data-streams/reference/report-schema-v8",
1313
"Learn the basics about how to retrieve Data Streams reports using the Streams Trade implementation": "/data-streams/getting-started",
14-
"Learn how to fetch and decode Data Streams reports using the Data Streams API": "/data-streams/tutorials/api-go",
14+
"Learn how to fetch and decode Data Streams reports using the Data Streams API": "/data-streams/tutorials/go-sdk-fetch",
1515
}
1616
---
1717

src/content/data-streams/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
keywords: ["Chainlink", "Data Streams", "Oracle", "DeFi", "Market Data", "Low Latency", "High Frequency"]
99
whatsnext:
1010
{
11-
"Learn how to fetch and decode Data Streams reports with the API": "/data-streams/tutorials/api-go",
11+
"Learn how to fetch and decode Data Streams reports with the API": "/data-streams/tutorials/go-sdk-fetch",
1212
"Find the list of available Stream IDs": "/data-streams/crypto-streams",
1313
"Find the schema of data to expect from Data Streams reports: Crypto": "/data-streams/reference/report-schema-v3",
1414
"Find the schema of data to expect from Data Streams reports: RWA": "/data-streams/reference/report-schema-v8",
@@ -24,6 +24,8 @@ Chainlink Data Streams delivers low-latency market data offchain, which you can
2424

2525
Traditional push-based oracles update onchain data at set intervals or when certain price thresholds are met. In contrast, Chainlink Data Streams uses a pull-based design that preserves trust-minimization with onchain verification.
2626

27+
Data Streams are offered in [several report formats](/data-streams/reference/report-schema-overview), each designed for distinct asset classes.
28+
2729
## Sub-Second Data and Commit-and-Reveal
2830

2931
Chainlink Data Streams supports sub-second data resolution for latency-sensitive use cases by retrieving data only when needed. You can combine the data with any transaction in near real time. A "commit-and-reveal" approach mitigates frontrunning by making trade data and stream data visible atomically onchain.
@@ -86,9 +88,9 @@ Access data directly through REST APIs or WebSocket connections using our SDKs:
8688

8789
1. Understand the Architecture: Review the [system components and data flow](/data-streams/architecture) to understand how Data Streams works.
8890

89-
1. Explore Available Data: Browse [available Stream IDs](/data-streams/crypto-streams) and [report schemas](/data-streams/reference/report-schema-v3) to see what data is available.
91+
1. Explore Available Data: Browse [available reports and associated schemas](/data-streams/reference/report-schema-overview) to see what data is available.
9092

91-
1. Try the API: Follow our [hands-on tutorial](/data-streams/tutorials/api-go) to fetch and decode your first report.
93+
1. Try the API: Follow our [hands-on tutorial](/data-streams/tutorials/go-sdk-fetch) to fetch and decode your first report.
9294

9395
1. Implement Verification: Add [onchain verification](/data-streams/reference/data-streams-api/onchain-verification) to ensure data authenticity in your smart contracts.
9496

src/content/data-streams/reference/data-streams-api/go-sdk.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ metadata:
88
keywords: ["Go SDK", "Golang", "Data Streams", "Integration", "API Client", "WebSocket Client", "Report Decoding"]
99
whatsnext:
1010
{
11-
"Learn how to fetch and decode Data Streams reports using the Data Streams SDK": "/data-streams/tutorials/api-go",
12-
"Learn how to stream and decode reports via a WebSocket connection using the Data Streams SDK": "/data-streams/tutorials/ws-go",
11+
"Learn how to fetch and decode Data Streams reports using the Data Streams SDK": "/data-streams/tutorials/go-sdk-fetch",
12+
"Learn how to stream and decode reports via a WebSocket connection using the Data Streams SDK": "/data-streams/tutorials/go-sdk-stream",
1313
}
1414
---
1515

src/content/data-streams/reference/data-streams-api/rust-sdk.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ metadata:
88
keywords: ["Rust SDK", "Data Streams", "Integration", "API Client", "WebSocket Client", "Report Decoding"]
99
whatsnext:
1010
{
11-
"Learn how to fetch and decode Data Streams reports using the Data Streams SDK": "/data-streams/tutorials/api-rust",
12-
"Learn how to stream and decode reports via a WebSocket connection using the Data Streams SDK": "/data-streams/tutorials/ws-rust",
11+
"Learn how to fetch and decode Data Streams reports using the Data Streams SDK": "/data-streams/tutorials/rust-sdk-fetch",
12+
"Learn how to stream and decode reports via a WebSocket connection using the Data Streams SDK": "/data-streams/tutorials/rust-sdk-stream",
1313
}
1414
---
1515

@@ -217,8 +217,8 @@ match client.get_latest_report(feed_id).await {
217217

218218
### Step-by-Step Guides
219219

220-
- [Fetch and decode reports using the REST API](/data-streams/tutorials/api-rust)
221-
- [Stream and decode reports via WebSocket](/data-streams/tutorials/ws-rust)
220+
- [Fetch and decode reports using the REST API](/data-streams/tutorials/rust-sdk-fetch)
221+
- [Stream and decode reports via WebSocket](/data-streams/tutorials/rust-sdk-stream)
222222

223223
### More Examples
224224

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
section: dataStreams
3+
date: Last Modified
4+
title: "Overview"
5+
---
6+
7+
import DataStreams from "@features/data-streams/common/DataStreams.astro"
8+
import { PageTabs } from "@components"
9+
10+
<DataStreams section="dsNotes" />
11+
12+
<PageTabs
13+
pages={[
14+
{
15+
name: "Cryptocurrency Report Schema (v3)",
16+
url: "/data-streams/reference/report-schema",
17+
},
18+
{
19+
name: "DEX State Price Report Schema (v3)",
20+
url: "/data-streams/reference/report-schema-v3-dex",
21+
},
22+
{
23+
name: "RWA Report Schema (v8)",
24+
url: "/data-streams/reference/report-schema-v8",
25+
},
26+
{
27+
name: "NAV Report Schema (v9)",
28+
url: "/data-streams/reference/report-schema-v9",
29+
},
30+
{
31+
name: "Backed xStock Report Schema (v10)",
32+
url: "/data-streams/reference/report-schema-v10",
33+
},
34+
]}
35+
headerTitle="Available Report Schemas"
36+
headerDescription="Choose the schema version you want to explore."
37+
/>
38+
39+
## Available Report Schemas
40+
41+
Below is a summary of all available Data Streams report schemas, their main use cases, and key fields.
42+
43+
| Report Schema | Version | Use Case / Purpose | Key Fields |
44+
| :------------------------------------------------------------ | :----------------------------------------- | :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------- |
45+
| [Cryptocurrency](#cryptocurrency-report-schema) | [View schema (v3)](./report-schema-v3) | Crypto price streams | `price`, `bid`, `ask` |
46+
| [DEX State Price](#dex-state-price-report-schema) | [View schema (v3)](./report-schema-v3-dex) | DEX state crypto price streams | `price`, `bid`, `ask` (All fields equal; [details](../concepts/dex-state-price-streams#how-to-use-dex-state-price-streams)) |
47+
| [Real World Asset (RWA)](#real-world-asset-rwa-report-schema) | [View schema (v8)](./report-schema-v8) | Real World Asset (RWA) price streams | `midPrice`, `marketStatus`, `lastUpdateTimestamp` |
48+
| [Net Asset Value (NAV)](#net-asset-value-nav-report-schema) | [View schema (v9)](./report-schema-v9) | Net Asset Value (NAV) streams | `aum`, `navPerShare`, `navDate`, `ripcord` |
49+
| [Backed xStock](#backed-xstock-report-schema) | [View schema (v10)](./report-schema-v10) | Tokenized stocks and backed asset streams | `price`, `tokenizedPrice`, `marketStatus`, `currentMultiplier`, `newMultiplier` |
50+
51+
## Cryptocurrency Report Schema
52+
53+
[Chainlink Cryptocurrency Reports](./report-schema-v3) provide market data for digital assets, supporting high-frequency, onchain use cases. Each report includes a consensus mid price (`price`), as well as simulated bid (`bid`) and ask (`ask`) prices that estimate the impact of buying or selling at a specified liquidity depth. These values help protocols and applications understand current market conditions and potential slippage for larger trades.
54+
55+
For a deeper explanation of how liquidity-weighted bid and ask prices work, see [Liquidity-Weighted Bid-Ask Prices (LWBA)](../concepts/liquidity-weighted-prices).
56+
57+
## DEX State Price Report Schema
58+
59+
[Chainlink DEX State Price Reports](./report-schema-v3-dex) are designed for assets that derive most or all of their liquidity from decentralized exchanges (DEXs). Unlike standard crypto price streams, these reports use onchain market data to reflect the unique conditions of AMM pools and DEX-dominant tokens. In this report, the `price`, `bid`, and `ask` fields are all equal, representing the execution price a trader would receive based on the current state of onchain liquidity pools, rather than order-book mechanics. This approach enables accurate, real-time pricing, even for long-tail or newly launched tokens in low-volume environments.
60+
61+
[The DEX State Price methodology](/data-streams/concepts/dex-state-price-streams#high-level-outline-of-the-dex-state-price-methodology) aggregates data from multiple DEX pools, applies volume and TVL-based weighting, and uses filters to reduce manipulation and smooth volatility. Users should be aware of the specific risks inherent to DeFi, such as smart contract vulnerabilities, bridge dependencies, and external price manipulation. It is important to review [risk mitigation guidance](/data-streams/concepts/dex-state-price-streams#risk-mitigation) and adjust protocol parameters accordingly when integrating DEX State Price Reports.
62+
63+
For more details on the methodology and risk considerations, see [DEX State Price Streams](../concepts/dex-state-price-streams).
64+
65+
## Real World Asset (RWA) Report Schema
66+
67+
[Chainlink RWA Data Streams](./report-schema-v8) provide fresh, reliable, and accurate financial market data for real-world assets, enabling DeFi users to gain onchain exposure to physical assets. Each report includes a staleness measure (`lastUpdateTimestamp`), consensus median price (`midPrice`) and market status (`marketStatus`).
68+
69+
RWA assets trade on traditional exchanges during [market hours](../market-hours). These market hours vary by asset class and can be subject to unexpected halts, pauses and other behaviors affecting traditional markets. For this reason, this class of Data Streams contains a market hours flag and a staleness measure to equip our users to handle these events correctly. It is critical that users implement correct safeguards on their end to pause markets, add more conservative risk caps, or do whatever else is appropriate for their application.
70+
71+
## Net Asset Value (NAV) Report Schema
72+
73+
[Chainlink NAV Data Streams](./report-schema-v9) provide real-time, tamper-proof access to the Net Asset Value (`navPerShare`) of tokenized assets, funds, or portfolios, delivered over the low latency, high frequency Chainlink Data Streams infrastructure. Each report includes NAV per share (`navPerShare`), NAV date (`navDate`), assets under management (`aum`), and ripcord status (`ripcord`). The ripcord is set to true (`1`) by the asset issuer when the consumer should ignore the value being sent (for cases such as maintenance, upstream data source outages, etc). The feed data will remain stale until the ripcord returns false (`0`).
74+
75+
NAV is a fundamental financial metric that represents the value of an investment vehicle such as a mutual fund or ETF and is calculated as the total assets minus the total liabilities.
76+
77+
Data Streams ensures that any NAV update, whenever it occurs, is captured and made available immediately and at low latency, allowing for seamless integration with onchain applications alongside other real-time data streams. Although the NAV value may not change frequently, Data Streams provides the most recent NAV as soon as it is published by the source.
78+
79+
## Backed xStock Report Schema
80+
81+
[Chainlink Backed xStock Data Streams](./report-schema-v10) provide fresh, reliable, and accurate financial market data for Tokenized Equities such as [xStock](https://xstocks.com/us) assets, enabling DeFi users to gain onchain exposure to tokenized stocks. These Streams are a unique product provided by Chainlink Labs for partners such as xStocks. They combine data from our US equity Data Streams with data from the tokenization service, which enables users to correctly handle corporate actions affecting the underlying equities. Each report includes the staleness measure (`lastUpdateTimestamp`), consensus mid price (`price`), market status (`marketStatus`), current multiplier (`currentMultiplier`, the number of underlying shares each xStock is redeemable for), new multiplier (`newMultiplier`, the future number of shares after a scheduled corporate action), activation date/time of the corporate action (`activationDateTime`) and the tokenized price if available on primary or secondary markets (`tokenizedPrice`).
82+
83+
The underlying US equities trade on traditional exchanges during [market hours](../market-hours). These market hours depend per asset class and can be subject to unexpected halts, pauses and other behaviors affecting traditional markets. For this reason, this class of Data Streams contains a market hours flag and a staleness measure to equip our users to handle these events correctly. It is critical that users implement correct safeguards on their end to pause markets, add more conservative risk caps, or implement other measures appropriate for their application.
84+
85+
[The schema](./report-schema-v10) is designed specifically for tokenized equities such as xStocks and contains data from the Chainlink US equities streams, combined with data provided by the tokenizer to properly handle corporate actions. With this enhanced data users are able to handle expected and unexpected market events such as pauses, halts and market off hours. The tokenization provider layers in data around the `currentMultiplier`, the `newMultiplier` and the `activationDateTime` of the new multiplier to handle corporate actions.

src/content/data-streams/reference/report-schema-v10.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Chainlink Backed xStock Data Streams adhere to the report schema outlined below.
6464

6565
**Notes:**
6666

67+
- Future Backed xStock streams may use different report schemas.
6768
- `price` updates in real time during market open, but may become stale during market closed periods.
6869
- `tokenizedPrice` will be available in an upcoming release of Backed xStock Data Streams. Currently, it will always return `0`.
6970
- `currentMultiplier` reflects all past corporate actions and is updated only when a new action is activated.

src/content/data-streams/reference/report-schema-v8.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ RWA streams adhere to the report schema outlined below.
5757
| `lastUpdateTimestamp` | `uint64` | Timestamp of the last valid price update (nanoseconds) |
5858
| `midPrice` | `int192` | DON's consensus median price |
5959
| `marketStatus` | `uint32` | [Market status](/data-streams/market-hours). Possible values: `0` (`Unknown`), `1` (`Closed`), `2` (`Open`) |
60+
61+
**Notes**:
62+
63+
- Future RWA streams may use different report schemas.

src/content/data-streams/reference/report-schema-v9.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Chainlink NAV Data Streams streams adhere to the report schema outlined below.
6161

6262
**Notes:**
6363

64+
- Future NAV streams may use different report schemas.
65+
6466
##### `ripcord` Status
6567

6668
- 0 (false) - **Data Provider is OK**. This indicates that the Fund’s data provider and data accuracy is reporting as expected.

0 commit comments

Comments
 (0)