Skip to content

Commit cbe7934

Browse files
committed
updates
1 parent 9b2c5fd commit cbe7934

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/content/data-streams/concepts/calculated-streams.mdx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,30 @@ Calculated streams inherit risks from their underlying inputs and introduce addi
9595

9696
### Multiple dependencies
9797

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.
98+
If a required input becomes unavailable or returns errors, the calculated stream stops producing reports until all inputs recover. This prevents potentially incorrect values from being published.
99+
100+
Single-source inputs (such as a specific protocol API or contract) carry higher risk than decentralized aggregates. If a single source experiences downtime, report production halts entirely until the source recovers. Review which inputs are single-source vs. decentralized aggregates when assessing a calculated stream for your application.
99101

100102
#### Mitigation
101103

102-
- Design your protocol to handle missing data gracefully (pause operations, use last-known values, or implement fallbacks based on your risk tolerance)
104+
- Design your protocol to handle report gaps gracefully (pause operations, use last-known values with appropriate staleness checks, or implement fallbacks based on your risk tolerance)
105+
- Implement staleness checks to detect when reports stop arriving and trigger appropriate protocol responses
106+
- Understand your input sources and assess the reliability of each, particularly single-source APIs or contracts
103107

104108
### Timing and synchronization
105109

106110
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.
107111

108-
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.
112+
During rapid market changes or protocol events (such as large deposits, withdrawals, or sharp market moves), you may observe temporary differences between the calculated stream value and values from other sources like block explorers, vault dashboards, or DEX charts. These differences typically resolve as all inputs update to reflect the new state.
113+
114+
If any input source experiences an outage (API errors, RPC failures, or contract issues), report production pauses until all inputs are available again. Your application should be prepared to handle gaps in report availability.
109115

110116
#### Mitigation
111117

112118
- Implement max deviation checks against expected ranges
113119
- Use time-weighted averages or circuit breakers for extreme moves
114120
- Monitor trends over time rather than reacting to individual updates
121+
- Set alerts for report gaps to detect input source issues early
115122

116123
<Aside type="note" title="Developer Responsibilities">
117124
When using calculated streams, you inherit all responsibilities associated with the underlying inputs plus additional
@@ -146,9 +153,11 @@ Without this stream, protocols accepting the vault token as collateral would nee
146153

147154
### Monitoring
148155

149-
- Track the calculated stream value over time to establish normal behavior
150-
- Monitor key inputs independently when feasible (vault balances, token supplies) to cross-check outputs
151-
- Alert on update gaps or movements outside your safe range
156+
- Set alerts for report gaps to detect when no new reports arrive within your expected update frequency
157+
- Track the calculated stream value over time to establish normal behavior patterns
158+
- Monitor key inputs independently when feasible (vault balances, token supplies, API availability) to identify which input may be causing issues
159+
- Alert on movements outside your expected range
160+
- For critical applications, consider independently monitoring the availability of single-source APIs or contracts used as inputs
152161

153162
### Handling updates
154163

0 commit comments

Comments
 (0)