The Truflation Stream Network (TSN) primarily supports two types of streams: Primitive and Composed. Additionally, both types can become System streams when accepted by the TSN governance.
Primitive streams are the foundation of the TSN data ecosystem. They represent direct data sources from providers.
- Raw data input from trusted sources
- Can include off-chain and on-chain data
- Serve as building blocks for more complex data structures
- Economic indexes from reputable sources
- Aggregation outputs (e.g., sentiment analysis results)
- Raw market data (e.g., asset prices, trading volumes)
Composed streams aggregate and process data from multiple streams, allowing for complex data transformations and analyses.
- Derive data from multiple primitive or other composed streams
- Can implement custom logic for data processing
- Enable the creation of sophisticated financial products and indicators
The composed stream contract implements a weighting mechanism for child streams by default. This allows for a straightforward data composition based on weighted averages of the child streams' values.
- Custom economic indices combining multiple data points
- Risk assessment scores based on various market indicators
- Yield farming strategies using multiple DeFi protocol data
System streams are streams (either Primitive or Composed) that have been audited and accepted by TSN governance to ensure quality and reliability.
- Undergo a rigorous auditing process
- Managed by system contracts for enhanced security and trust
- Serve as reliable data sources for critical applications
Users can fetch official (system) and unofficial streams through the system contract. However, they also have the option to fetch data directly from the stream contracts. For more detailed information on data retrieval, please refer to the reading-data.md
document.
When a stream is accepted as a system stream:
- The original data provider can still push primitives to the stream.
- The data provider cannot drop the stream or modify its taxonomy.
- Ownership of the stream is transferred to the TSN governance.
- Any future changes to the stream are decided by the community through governance processes.
- Official inflation rate streams
- Benchmark interest rates
- Regulatory compliance data
While TSN provides suggested contract templates for each stream type, users can alter contract logic as long as the procedure interfaces are maintained. This approach ensures:
- Flexibility: Users can implement custom logic tailored to their specific use cases.
- Composability: Streams remain interoperable within the TSN ecosystem by maintaining consistent interfaces.
- Innovation: Developers can create novel data products while leveraging the TSN infrastructure.
- Maintain the defined procedure interfaces to ensure compatibility with the TSN ecosystem.
- Custom logic should adhere to best practices for security and efficiency.
- Consider the impact of customizations on stream composability and usability by other network participants.
System streams undergo a rigorous process to ensure their reliability and trustworthiness:
- Proposal: Data providers submit their streams for consideration as system streams.
- Audit: TSN governance thoroughly audits the stream's data sources, methodology, and contract logic.
- Community Review: The TSN community reviews and provides feedback on proposed system streams.
- Acceptance: Upon passing audits and community review, streams are accepted as system streams.
- Ongoing Monitoring: System streams are subject to continuous monitoring and periodic reviews to maintain their status.
By leveraging these different stream types and understanding their characteristics, developers and data providers can create powerful, composable data solutions within the TSN ecosystem.