You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculated streams are Chainlink data streams whose values are derived by applying arithmetic expressions to multiple underlying inputs.
30
30
31
-
All Data Streams use a [Decentralized Oracle Network (DON)](/data-streams/architecture) where nodes reach consensus and publish signed reports.
32
-
33
-
Traditional Data Streams aggregate market data from multiple independent providers, ensuring no single data source can compromise the stream's integrity.
31
+
All Data Streams use a [Decentralized Oracle Network (DON)](/data-streams/architecture) where nodes reach consensus and publish signed reports. Traditional Data Streams aggregate market data from multiple independent providers, ensuring no single data source can compromise the stream's integrity.
34
32
35
33
Instead of aggregating only raw market data, calculated streams compute derived values using predefined formulas applied to various inputs, including existing data streams, onchain state, and offchain APIs. Some inputs are decentralized aggregates (for example, crypto price streams from multiple independent providers), while others may come from a single protocol or API (for example, a specific vault contract or yield provider). Because a calculated stream depends on all of these inputs, you should evaluate their dependencies and failure modes carefully before using it in a value-securing application.
36
34
@@ -48,7 +46,7 @@ Instead of aggregating only raw market data, calculated streams compute derived
48
46
49
47
## How to identify calculated streams
50
48
51
-
Calculated streams are marked with a **Calculated** badge in the documentation.
49
+
Calculated streams are marked with a <spanstyle="display: inline-block; font-size: 0.75rem; padding: 2px 6px; margin-left: 4px; border-radius: 4px; background: var(--blue-100); color: var(--blue-700); font-weight: 500; vertical-align: middle;">Calculated</span> badge in the documentation.
52
50
53
51
## How calculated streams work
54
52
@@ -97,7 +95,7 @@ Calculated streams inherit risks from their underlying inputs and introduce addi
97
95
98
96
### Multiple dependencies
99
97
100
-
If a required input becomes unavailable or unreliable, the calculated stream might not continue to reflect current conditions. Integrators should not assume any specific fallback behavior and must design their protocols to handle this scenario explicitly.
98
+
If a required input becomes unavailable or unreliable, the calculated stream might stop updating or cease to reflect current conditions. Integrators should not assume any specific fallback behavior and must design their protocols to handle this scenario explicitly.
101
99
102
100
#### Mitigation
103
101
@@ -136,7 +134,7 @@ A calculated stream for a tokenized yield-bearing vault might combine:
136
134
137
135
**Result**: a price per share that reflects the vault's total value including pending yield.
138
136
139
-
Without this stream, protocols accepting the vault token as collateral would need to query the vault contract, fetch accrued interest from the yield provider's API, perform the calculation themselves, and keep this logic synchronized across all integrators. A calculated stream ensures everyone prices the same way and updates together when the underlying formula or yield source changes.
137
+
Without this stream, protocols accepting the vault token as collateral would need to query the vault contract, fetch accrued interest from the yield provider's API, perform the calculation themselves, and keep this logic synchronized across all integrators. A calculated stream helps ensure integrators apply the same pricing logic and update together when the underlying formula or yield source changes.
140
138
141
139
## Best practices
142
140
@@ -156,4 +154,3 @@ Without this stream, protocols accepting the vault token as collateral would nee
156
154
157
155
- Subscribe to Chainlink release notes for formula changes
158
156
- Test new streams or updated configurations in staging
159
-
- Build flexibility to support stream ID updates when formulas evolve
Calculated streams are Chainlink data streams whose values are derived by applying arithmetic expressions to multiple underlying inputs.
415
+
416
+
All Data Streams use a [Decentralized Oracle Network (DON)](/data-streams/architecture) where nodes reach consensus and publish signed reports. Traditional Data Streams aggregate market data from multiple independent providers, ensuring no single data source can compromise the stream's integrity.
417
+
418
+
Instead of aggregating only raw market data, calculated streams compute derived values using predefined formulas applied to various inputs, including existing data streams, onchain state, and offchain APIs. Some inputs are decentralized aggregates (for example, crypto price streams from multiple independent providers), while others may come from a single protocol or API (for example, a specific vault contract or yield provider). Because a calculated stream depends on all of these inputs, you should evaluate their dependencies and failure modes carefully before using it in a value-securing application.
Calculated streams introduce additional dependencies and timing considerations compared to standard streams. Before
422
+
integrating a calculated stream, review the <a href="#unique-risks-and-mitigation">risks and mitigation</a> section to
423
+
understand how multiple inputs and update cadences may affect your application.
424
+
</Aside>
425
+
426
+
## Why use calculated streams?
427
+
428
+
- **Simpler integrations**: Consume one stream instead of implementing calculation logic in your contracts or backend
429
+
- **Canonical formulas**: All integrators use the same formula and inputs, ensuring consistency across protocols
430
+
- **Managed infrastructure**: Chainlink handles RPC calls, API integrations, and the calculation pipeline
431
+
432
+
## How to identify calculated streams
433
+
434
+
Calculated streams are marked with a <span style="display: inline-block; font-size: 0.75rem; padding: 2px 6px; margin-left: 4px; border-radius: 4px; background: var(--blue-100); color: var(--blue-700); font-weight: 500; vertical-align: middle;">Calculated</span> badge in the documentation.
435
+
436
+
## How calculated streams work
437
+
438
+
Calculated streams leverage existing Data Streams infrastructure. Data providers feed market data into the DON, which produces base streams. The DON then uses these base streams—along with onchain state and offchain APIs—as inputs to calculate derived values.
439
+
440
+
### Architecture flow
441
+
442
+
1. **Data collection**: The DON retrieves inputs specific to each calculated stream, which may include:
443
+
- Existing Data Streams (market prices from multiple independent data providers)
444
+
- Onchain state via RPC calls (vault balances, token supplies, contract data)
445
+
- Offchain data via APIs (yield rates, interest components, external reference data)
446
+
2. **Calculation**: The DON applies the predefined formula to combine the inputs
447
+
3. **Consensus and signing**: Nodes reach consensus on the calculated value and sign the report
448
+
4. **Publication**: Calculated streams are published through the Data Streams Aggregation Network
449
+
450
+
### Input sources
451
+
452
+
The inputs for a calculated stream depend on what it's computing. A stream might use:
453
+
454
+
#### Existing Data Streams
455
+
456
+
Market prices already aggregated from multiple independent sources (3+ providers). Example: using individual crypto asset prices as inputs for an index calculation.
457
+
458
+
#### Onchain state
459
+
460
+
Protocol-specific data read via RPC, such as vault balances, token supplies, or smart contract state. May come from a single protocol's contracts.
461
+
462
+
#### Offchain APIs
463
+
464
+
External data from specific trusted providers, such as yield rates or reference values. May come from a single API endpoint.
465
+
466
+
### Calculation and output
467
+
468
+
The DON executes the predefined formula (weighted averages, ratios, sums, etc.) using the latest available inputs. The calculated value is packaged into a signed report with standard metadata (timestamps, fees) and published through the Data Streams Aggregation Network. You consume these reports using the same REST APIs, WebSocket connections, and onchain verification as traditional streams.
469
+
470
+
***
471
+
472
+
## Risks and mitigation
473
+
474
+
Calculated streams inherit risks from their underlying inputs and introduce additional considerations due to combining multiple data sources.
475
+
476
+
### Multiple dependencies
477
+
478
+
If a required input becomes unavailable or unreliable, the calculated stream might stop updating or cease to reflect current conditions. Integrators should not assume any specific fallback behavior and must design their protocols to handle this scenario explicitly.
479
+
480
+
#### Mitigation
481
+
482
+
- Design your protocol to handle missing data gracefully (pause operations, use last-known values, or implement fallbacks based on your risk tolerance)
483
+
484
+
### Timing and synchronization
485
+
486
+
Inputs update at different frequencies and are read via separate calls, so they may reflect slightly different block heights or timestamps. The calculated value is an approximation based on the latest available data from each input, not a single-block atomic snapshot.
487
+
488
+
Users should expect small, transient differences between the calculated stream value and values observed on block explorers, vault dashboards, or DEX charts—especially during rapid changes such as large deposits, withdrawals, or sharp market moves. This does not necessarily indicate an issue with the stream, but is a natural consequence of combining multiple inputs with different update cadences.
489
+
490
+
#### Mitigation
491
+
492
+
- Implement max deviation checks against expected ranges
493
+
- Use time-weighted averages or circuit breakers for extreme moves
494
+
- Monitor trends over time rather than reacting to individual updates
**Result**: a price per share that reflects the vault's total value including pending yield.
516
+
517
+
Without this stream, protocols accepting the vault token as collateral would need to query the vault contract, fetch accrued interest from the yield provider's API, perform the calculation themselves, and keep this logic synchronized across all integrators. A calculated stream helps ensure integrators apply the same pricing logic and update together when the underlying formula or yield source changes.
518
+
519
+
## Best practices
520
+
521
+
### Protocol design
522
+
523
+
- Set deviation limits to cap price changes per update or time window
524
+
- Compare calculated values against market references when available (e.g., spot prices for index tokens)
525
+
- Define fallback behavior if the stream stops updating or jumps beyond thresholds
526
+
527
+
### Monitoring
528
+
529
+
- Track the calculated stream value over time to establish normal behavior
530
+
- Monitor key inputs independently when feasible (vault balances, token supplies) to cross-check outputs
531
+
- Alert on update gaps or movements outside your safe range
532
+
533
+
### Handling updates
534
+
535
+
- Subscribe to Chainlink release notes for formula changes
536
+
- Test new streams or updated configurations in staging
0 commit comments