Skip to content

Commit 7fa9448

Browse files
committed
added ds report schema info and fixed report schema tabs
1 parent 72aa4b2 commit 7fa9448

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ section: dataStreams
33
date: Last Modified
44
title: "Report Schemas"
55
metadata:
6-
title: "Cryptocurrency Report Schema (v3) | Chainlink Data Streams"
7-
description: "Learn about Chainlink Data Streams cryptocurrency report schema (v3), including fields, encoding, and examples to integrate market data into your applications."
8-
keywords:
9-
["Report Schema", "Cryptocurrency", "v3 Schema", "Data Format", "Report Structure", "Liquidity-Weighted", "Bid-Ask"]
6+
title: "Exchange Rate Report Schema (v7) | Chainlink Data Streams"
7+
description: "Learn about Chainlink Data Streams exchange rate report schema (v7), including fields, encoding, and examples to integrate exchange rate data into your applications."
8+
keywords: ["Report Schema", "Exchange Rate", "v7 Schema", "Data Format", "Report Structure", "Exchange Rate Data"]
109
---
1110

1211
import DataStreams from "@features/data-streams/common/DataStreams.astro"
@@ -16,20 +15,20 @@ import ReportSchemaTabs from "@features/data-streams/common/ReportSchemaTabs.ast
1615

1716
<ReportSchemaTabs />
1817

19-
Cryptocurrency streams adhere to the report schema outlined below.
18+
Exchange Rate streams adhere to the report schema outlined below.
2019

2120
## Schema Fields
2221

23-
| Field | Type | Description |
24-
| ----------------------- | --------- | -------------------------------------------------- |
25-
| `feedID` | `bytes32` | Unique identifier for the data stream |
26-
| `validFromTimestamp` | `uint32` | Start timestamp of price validity period (seconds) |
27-
| `observationsTimestamp` | `uint32` | End timestamp of price validity period (seconds) |
28-
| `nativeFee` | `uint192` | Verification cost in native blockchain tokens |
29-
| `linkFee` | `uint192` | Verification cost in LINK tokens |
30-
| `expiresAt` | `uint32` | Timestamp when this report expires (seconds) |
31-
| `price` | `int192` | DON consensus median price |
32-
| `bid` | `int192` | Simulated buy impact price at X% liquidity depth |
33-
| `ask` | `int192` | Simulated sell impact price at X% liquidity depth |
34-
35-
**Note**: Future Cryptocurrency streams may use different report schemas.
22+
| Field | Type | Description |
23+
| ----------------------- | --------- | ---------------------------------------------------- |
24+
| `feedId` | `bytes32` | Unique identifier for the Data Streams feed |
25+
| `validFromTimestamp` | `uint32` | Earliest timestamp when the price is valid (seconds) |
26+
| `observationsTimestamp` | `uint32` | Latest timestamp when the price is valid (seconds) |
27+
| `nativeFee` | `uint192` | Cost to verify report onchain (native token) |
28+
| `linkFee` | `uint192` | Cost to verify report onchain (LINK) |
29+
| `expiresAt` | `uint32` | Expiration date of the report (seconds) |
30+
| `exchangeRate` | `int192` | DON's consensus median exchange rate |
31+
32+
**Notes**:
33+
34+
- Future Exchange Rate streams may use different report schemas.

src/features/data-streams/common/ReportSchemaTabs.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22
import { PageTabs } from "@components"
33
4-
const reportSchemaPages = [
4+
// Get current page URL to determine if we should show deprecated schemas
5+
const currentUrl = Astro.url.pathname
6+
7+
const allReportSchemaPages = [
58
{
69
name: "Cryptocurrency Report Schema (v3)",
710
url: "/data-streams/reference/report-schema-v3",
@@ -13,6 +16,7 @@ const reportSchemaPages = [
1316
{
1417
name: "(Deprecated) RWA Report Schema (v4)",
1518
url: "/data-streams/reference/report-schema-v4",
19+
deprecated: true,
1620
},
1721
{
1822
name: "Exchange Rate Report Schema (v7)",
@@ -31,6 +35,11 @@ const reportSchemaPages = [
3135
url: "/data-streams/reference/report-schema-v10",
3236
},
3337
]
38+
39+
// Only show deprecated schemas if user is currently on a deprecated page
40+
const isOnDeprecatedPage = allReportSchemaPages.some((page) => page.deprecated && currentUrl === page.url)
41+
42+
const reportSchemaPages = allReportSchemaPages.filter((page) => !page.deprecated || isOnDeprecatedPage)
3443
---
3544

3645
<PageTabs

0 commit comments

Comments
 (0)