Supra
Lumia L2 integrates with Supra's high-performance oracle system to provide fast, reliable price feeds through their Distributed Oracle Agreement (DORA) protocol. This guide explains how to integrate Supra oracles into your dApps on Lumia L2.
Overview
Supra provides two types of oracle implementations:
Pull Oracle: On-demand price data with sub-second response time
Push Oracle: Automated price updates with layer-1 security guarantees
This guide focuses on the Pull Oracle implementation, which gives you maximum control over when and how to fetch price data.
Integration Process
Full list of feeds: https://docs.supra.com/oracles/data-feeds/data-feeds-index
1. Smart Contract Setup
First, create your smart contract that will receive and process oracle data:
2. Web2 Integration
You'll need a Node.js application to fetch price data from Supra's gRPC server and send it to your smart contract. Here's a basic implementation:
3. Contract Deployment
Deploy your contract using your preferred method (Hardhat, Truffle, etc.) with the appropriate Supra Oracle address:
Lumia Mainnet
Oracle Address: 0x16f70cAD28dd621b0072B5A8a8c392970E87C3dD
Best Practices
Error Handling
Price Validation
Update Frequency
Consider implementing a minimum time between updates
Use price deviation thresholds to optimize gas costs
implement redundancy in your web2 infrastructure
Technical Specifications
Response Time: Sub-second for pull oracle
Data Sources: 40+ sources aggregated
Security: Byzantine Fault Tolerant consensus with DORA
Price Calculation: Median-of-medians with coherent cluster validation
Update Frequency: Customizable (recommended: 1-5 minutes)
Gas Optimization: Batch price updates supported
Support & Resources
Last updated