Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
title: "Cryptocurrency",
url: "data-streams/crypto-streams",
children: [
{
title: "Report Schema v2 (Crypto Standard)",
url: "data-streams/reference/report-schema-v2",
},
{
title: "Report Schema v3 (Crypto Advanced)",
url: "data-streams/reference/report-schema-v3",
Expand Down
32 changes: 32 additions & 0 deletions src/content/data-streams/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5559,9 +5559,14 @@ Each stream category uses one or more report schemas to deliver data. Several ca

Cryptocurrency streams deliver high-frequency market data for digital assets.

- [**Crypto Standard (v2)**](#crypto-standard-v2) provides a single consensus price point for crypto assets.
- [**Crypto Advanced (v3)**](#crypto-advanced-v3) aggregate order-book liquidity across top venues to provide a consensus mid price alongside simulated bid and ask levels.
- [**Crypto Advanced (v3) - DEX State Price**](#crypto-advanced-v3---dex-state-price) derive pricing from onchain liquidity pools to reflect decentralized market conditions.

### Crypto Standard (v2)

[Chainlink Cryptocurrency Reports](/data-streams/reference/report-schema-v2) provide market data for digital assets using a streamlined schema. Each report includes a single time-weighted average price (`price`), making it suitable for use cases that require a TWAP price point.

### Crypto Advanced (v3)

[Chainlink Cryptocurrency Reports](/data-streams/reference/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.
Expand Down Expand Up @@ -5758,6 +5763,33 @@ As a result, these volume fields should not be treated as a proxy for total mark

---

# Report Schema: Crypto Standard (v2)
Source: https://docs.chain.link/data-streams/reference/report-schema-v2

<DataStreams section="dsNotes" />

Cryptocurrency streams adhere to the report schema outlined below.

## Time-Weighted Average Price (TWAP)

The v2 schema is used by TWAP streams. The `price` field carries the time-weighted average price for the stream's configured window, not a spot or median price. Each TWAP stream is scoped to one asset and one window length (for example, 30 seconds or 60 seconds). The window length is part of the stream's name and metadata.

## Schema Fields

| Field | Type | Description |
| ----------------------- | --------- | ---------------------------------------------------------- |
| `feedId` | `bytes32` | Unique identifier for the Data Streams feed |
| `validFromTimestamp` | `uint32` | Earliest timestamp when the price is valid (seconds) |
| `observationsTimestamp` | `uint32` | Latest timestamp when the price is valid (seconds) |
| `nativeFee` | `uint192` | Cost to verify report onchain (native token) |
| `linkFee` | `uint192` | Cost to verify report onchain (LINK) |
| `expiresAt` | `uint32` | Expiration date of the report (seconds) |
| `price` | `int192` | Time-weighted average price (TWAP) for the stream's window |

**Note**: Future Cryptocurrency streams may use different report schemas.

---

# Report Schema: Crypto Advanced (v3) - DEX State Price
Source: https://docs.chain.link/data-streams/reference/report-schema-v3-dex

Expand Down
16 changes: 15 additions & 1 deletion src/content/data-streams/reference/report-schema-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ Each stream category uses one or more report schemas to deliver data. Several ca
</thead>
<tbody>
<tr>
<td rowspan="2">
<td rowspan="3">
<a href="/data-streams/crypto-streams">Cryptocurrency</a>
</td>
<td>
<a href="/data-streams/reference/report-schema-v2">Crypto Standard (v2)</a>
</td>
<td>Crypto prices (single price point)</td>
<td>
<code>price</code>
</td>
</tr>
<tr>
<td>
<a href="/data-streams/reference/report-schema-v3">Crypto Advanced (v3)</a>
</td>
Expand Down Expand Up @@ -113,9 +122,14 @@ Each stream category uses one or more report schemas to deliver data. Several ca

Cryptocurrency streams deliver high-frequency market data for digital assets.

- [**Crypto Standard (v2)**](#crypto-standard-v2) provides a single consensus price point for crypto assets.
- [**Crypto Advanced (v3)**](#crypto-advanced-v3) aggregate order-book liquidity across top venues to provide a consensus mid price alongside simulated bid and ask levels.
- [**Crypto Advanced (v3) - DEX State Price**](#crypto-advanced-v3---dex-state-price) derive pricing from onchain liquidity pools to reflect decentralized market conditions.

### Crypto Standard (v2)

[Chainlink Cryptocurrency Reports](/data-streams/reference/report-schema-v2) provide market data for digital assets using a streamlined schema. Each report includes a single time-weighted average price (`price`), making it suitable for use cases that require a TWAP price point.

### Crypto Advanced (v3)

[Chainlink Cryptocurrency Reports](/data-streams/reference/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.
Expand Down
29 changes: 29 additions & 0 deletions src/content/data-streams/reference/report-schema-v2.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
section: dataStreams
date: Last Modified
title: "Report Schema: Crypto Standard (v2)"
metadata:
title: "Crypto Standard (v2) | Chainlink Data Streams"
description: "Learn about Chainlink Data Streams Crypto Standard (v2) schema, including fields, encoding, and examples to integrate market data into your applications."
keywords: ["Report Schema", "Cryptocurrency", "v2 Schema", "Data Format", "Report Structure", "Crypto Standard"]
---

import DataStreams from "@features/data-streams/common/DataStreams.astro"
import ReportSchemaTabs from "@features/data-streams/common/ReportSchemaTabs.astro"
import SchemaFieldsTable from "@features/data-streams/common/SchemaFieldsTable.astro"

<DataStreams section="dsNotes" />

<ReportSchemaTabs />

Cryptocurrency streams adhere to the report schema outlined below.

## Time-Weighted Average Price (TWAP)

The v2 schema is used by TWAP streams. The `price` field carries the time-weighted average price for the stream's configured window, not a spot or median price. Each TWAP stream is scoped to one asset and one window length (for example, 30 seconds or 60 seconds). The window length is part of the stream's name and metadata.

## Schema Fields

<SchemaFieldsTable schema="v2" />

**Note**: Future Cryptocurrency streams may use different report schemas.
4 changes: 4 additions & 0 deletions src/features/data-streams/common/ReportSchemaTabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { PageTabs } from "@components"
const currentUrl = Astro.url.pathname

const allReportSchemaPages = [
{
name: "Crypto Standard (v2)",
url: "/data-streams/reference/report-schema-v2",
},
{
name: "Crypto Advanced (v3)",
url: "/data-streams/reference/report-schema-v3",
Expand Down
4 changes: 2 additions & 2 deletions src/features/feeds/components/FeedList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ div.shutDate > hr {
position: relative;
cursor: pointer;
width: auto;
min-width: 200px;
min-width: 250px;
}

.filterDropdown_search {
Expand Down Expand Up @@ -316,7 +316,7 @@ div.shutDate > hr {
background: var(--white);
z-index: 1;
margin-top: var(--space-2x);
min-width: 165px;
min-width: 250px;
width: 100%;
box-shadow: var(--shadow-mid-secondary);
border: var(--border-width-primary) solid var(--color-border-primary);
Expand Down
149 changes: 90 additions & 59 deletions src/features/feeds/components/FeedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ const schemaFilterOptions: FilterOption<SchemaFilterValue>[] = [
{ label: "RWA Advanced (v11)", value: "v11" },
]

const cryptoSchemaFilterOptions: FilterOption<SchemaFilterValue>[] = [
{ label: "All", value: "all" },
{ label: "Crypto Standard (v2)", value: "v2" },
{ label: "Crypto Advanced (v3)", value: "v3" },
{ label: "Crypto Advanced DEX (v3)", value: "v3-dex" },
]

const feedTypeFilterOptions: FilterOption<StreamsRwaFeedTypeValue>[] = [
{ label: "All", value: "all" },
{ label: "Datalink Streams", value: "datalink" },
Expand All @@ -76,7 +83,7 @@ const tradingHoursFilterOptions: FilterOption<TradingHoursFilterValue>[] = [
]

const isSchemaFilterValue = (value: unknown): value is SchemaFilterValue =>
value === "all" || value === "v8" || value === "v11"
value === "all" || value === "v2" || value === "v3" || value === "v3-dex" || value === "v8" || value === "v11"
const isStreamsRwaFeedTypeValue = (value: unknown): value is StreamsRwaFeedTypeValue =>
value === "all" || value === "datalink" || value === "equities" || value === "forex"
const isTradingHoursFilterValue = (value: unknown): value is TradingHoursFilterValue =>
Expand Down Expand Up @@ -358,6 +365,14 @@ export const FeedList = ({
const setRwaSchemaFilter = (next: SchemaFilterValue) => {
setRwaSchemaFilterParam(next === "all" ? [] : next)
}
const [cryptoSchemaFilterParam, setCryptoSchemaFilterParam] = useQueryString("cryptoSchema")
const cryptoSchemaFilter =
typeof cryptoSchemaFilterParam === "string" && isSchemaFilterValue(cryptoSchemaFilterParam)
? cryptoSchemaFilterParam
: "all"
const setCryptoSchemaFilter = (next: SchemaFilterValue) => {
setCryptoSchemaFilterParam(next === "all" ? [] : next)
}
const [testnetRwaSchemaFilterParam, setTestnetRwaSchemaFilterParam] = useQueryString("testnetSchema")
const testnetRwaSchemaFilter =
typeof testnetRwaSchemaFilterParam === "string" && isSchemaFilterValue(testnetRwaSchemaFilterParam)
Expand All @@ -366,6 +381,14 @@ export const FeedList = ({
const setTestnetRwaSchemaFilter = (next: SchemaFilterValue) => {
setTestnetRwaSchemaFilterParam(next === "all" ? [] : next)
}
const [testnetCryptoSchemaFilterParam, setTestnetCryptoSchemaFilterParam] = useQueryString("testnetCryptoSchema")
const testnetCryptoSchemaFilter =
typeof testnetCryptoSchemaFilterParam === "string" && isSchemaFilterValue(testnetCryptoSchemaFilterParam)
? testnetCryptoSchemaFilterParam
: "all"
const setTestnetCryptoSchemaFilter = (next: SchemaFilterValue) => {
setTestnetCryptoSchemaFilterParam(next === "all" ? [] : next)
}
const [show24x5FeedsTestnetParam, setShow24x5FeedsTestnetParam] = useQueryString("testnetShow24x5")
const show24x5FeedsTestnet = force24x5Only || show24x5FeedsTestnetParam === "true"
const showApacEquitiesFeedsTestnet = forceApacEquitiesOnly
Expand Down Expand Up @@ -1241,36 +1264,36 @@ export const FeedList = ({
<div className={feedList.tableFilters}>
<div className={feedList.filterControls}>
{dataFeedType === "streamsCrypto" && (
<div className={feedList.checkboxContainer}>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDEXFeeds}
onChange={() => {
closeAllDropdowns()
setShowOnlyDEXFeeds((old) => !old)
if (showOnlyDatalinkFeeds) setShowOnlyDatalinkFeeds(false)
setCurrentPage("1")
}}
/>
Show DEX State Price streams
</label>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDatalinkFeeds}
onChange={() => {
closeAllDropdowns()
setShowOnlyDatalinkFeeds((old) => !old)
if (showOnlyDEXFeeds) setShowOnlyDEXFeeds(false)
setCurrentPage("1")
}}
/>
Show Datalink streams
</label>
</div>
<>
<FilterDropdown
isOpen={openDropdownId === "main-crypto-schema"}
onToggle={(isOpen) => handleDropdownToggle("main-crypto-schema", isOpen)}
onClose={closeAllDropdowns}
label="Filter schema"
options={cryptoSchemaFilterOptions}
value={cryptoSchemaFilter}
groupId="crypto-schema-main"
onSelect={(next) => {
setCryptoSchemaFilter(next)
setCurrentPage("1")
}}
/>
<div className={feedList.checkboxContainer}>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDatalinkFeeds}
onChange={() => {
closeAllDropdowns()
setShowOnlyDatalinkFeeds((old) => !old)
setCurrentPage("1")
}}
/>
Show Datalink streams
</label>
</div>
</>
)}
{dataFeedType === "streamsRwa" && (
<>
Expand Down Expand Up @@ -1343,6 +1366,7 @@ export const FeedList = ({
)}
{(searchValue ||
rwaSchemaFilter !== "all" ||
cryptoSchemaFilter !== "all" ||
(!forceStreamCategoryFilter && streamCategoryFilter !== "all") ||
show24x5Feeds) && (
<button
Expand All @@ -1352,6 +1376,7 @@ export const FeedList = ({
closeAllDropdowns()
setSearchValue("")
setRwaSchemaFilter("all")
setCryptoSchemaFilter("all")
if (!forceStreamCategoryFilter) setStreamCategoryFilter("all")
setShow24x5Feeds(false)
setTradingHoursFilter("all")
Expand Down Expand Up @@ -1403,6 +1428,7 @@ export const FeedList = ({
showOnlyDEXFeeds={showOnlyDEXFeeds}
showOnlyDatalinkFeeds={showOnlyDatalinkFeeds}
rwaSchemaFilter={rwaSchemaFilter}
cryptoSchemaFilter={cryptoSchemaFilter}
streamCategoryFilter={streamCategoryFilter}
show24x5Feeds={show24x5Feeds}
showApacEquitiesFeeds={showApacEquitiesFeeds}
Expand Down Expand Up @@ -1433,34 +1459,36 @@ export const FeedList = ({
<div className={feedList.tableFilters}>
<div className={feedList.filterControls}>
{dataFeedType === "streamsCrypto" && (
<div className={feedList.checkboxContainer}>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDEXFeedsTestnet}
onChange={() => {
setShowOnlyDEXFeedsTestnet((old) => !old)
if (showOnlyDatalinkFeedsTestnet) setShowOnlyDatalinkFeedsTestnet(false)
setTestnetCurrentPage("1")
}}
/>
Show DEX State Price streams
</label>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDatalinkFeedsTestnet}
onChange={() => {
setShowOnlyDatalinkFeedsTestnet((old) => !old)
if (showOnlyDEXFeedsTestnet) setShowOnlyDEXFeedsTestnet(false)
setTestnetCurrentPage("1")
}}
/>
Show Datalink streams
</label>
</div>
<>
<FilterDropdown
isOpen={openDropdownId === "test-crypto-schema"}
onToggle={(isOpen) => handleDropdownToggle("test-crypto-schema", isOpen)}
onClose={closeAllDropdowns}
label="Filter schema"
options={cryptoSchemaFilterOptions}
value={testnetCryptoSchemaFilter}
groupId="crypto-schema-testnet"
onSelect={(next) => {
setTestnetCryptoSchemaFilter(next)
setTestnetCurrentPage("1")
}}
/>
<div className={feedList.checkboxContainer}>
<label className={feedList.detailsLabel}>
<input
type="checkbox"
className={feedList.feedCheckbox}
checked={showOnlyDatalinkFeedsTestnet}
onChange={() => {
closeAllDropdowns()
setShowOnlyDatalinkFeedsTestnet((old) => !old)
setTestnetCurrentPage("1")
}}
/>
Show Datalink streams
</label>
</div>
</>
)}
{dataFeedType === "streamsRwa" && (
<>
Expand Down Expand Up @@ -1533,6 +1561,7 @@ export const FeedList = ({
)}
{(testnetSearchValue ||
testnetRwaSchemaFilter !== "all" ||
testnetCryptoSchemaFilter !== "all" ||
(!forceStreamCategoryFilter && testnetStreamCategoryFilter !== "all") ||
show24x5FeedsTestnet) && (
<button
Expand All @@ -1542,6 +1571,7 @@ export const FeedList = ({
closeAllDropdowns()
setTestnetSearchValue("")
setTestnetRwaSchemaFilter("all")
setTestnetCryptoSchemaFilter("all")
if (!forceStreamCategoryFilter) setTestnetStreamCategoryFilter("all")
setShow24x5FeedsTestnet(false)
setTestnetTradingHoursFilter("all")
Expand Down Expand Up @@ -1595,6 +1625,7 @@ export const FeedList = ({
showOnlyDEXFeeds={showOnlyDEXFeedsTestnet}
showOnlyDatalinkFeeds={showOnlyDatalinkFeedsTestnet}
rwaSchemaFilter={testnetRwaSchemaFilter}
cryptoSchemaFilter={testnetCryptoSchemaFilter}
streamCategoryFilter={testnetStreamCategoryFilter}
show24x5Feeds={show24x5FeedsTestnet}
showApacEquitiesFeeds={showApacEquitiesFeedsTestnet}
Expand Down
Loading
Loading