Oracle
Last updated
Was this helpful?
Last updated
Was this helpful?
In lending protocols, determining the price of an asset is crucial, and this is where a price oracle comes into play. A price oracle fetches prices either on-chain or off-chain to provide the necessary data.
On-chain oracles have encountered numerous issues, including susceptibility to price manipulation. To address this, our protocol relies on an off-chain oracle, Pyth, for price reporting. Pyth enhances security by aggregating prices from various trusted sources, including exchanges and financial institutions, to ensure accurate and reliable data.
Security Advantages
Data Integrity: With a pull model, the protocol actively requests the latest price data when needed, ensuring that it always uses up-to-date information. This reduces the risk of using stale or outdated data.
Reduced Attack Surface: In a push model, oracles continuously send data to the protocol, which can increase the attack surface. A pull model minimizes this risk as the data is only fetched when necessary, reducing the opportunities for attackers to manipulate the price feeds.
Control Over Data Retrieval: The pull model allows the protocol to control when and how often it queries the oracle, providing flexibility in managing data requests and reducing unnecessary network load.
Enhanced Validation: Pulling data on-demand allows for immediate validation and comparison with other sources, enhancing the accuracy and reliability of the price data used in the protocol.
By using Pyth Oracle with a pull approach, our protocol benefits from enhanced security, reliable data aggregation, and robust mechanisms to prevent price manipulation, ensuring a more secure and trustworthy lending platform.
To further enhance the flexibility and responsiveness of our protocol, we are also integrating complementary oracles such as Switchboard. Switchboard is another pull oracle that decentralizes the process of adding price feeds by incorporating price fees in a decentralized manner. This integration offers more adaptability and quicker listing of new assets, thereby providing additional robustness and responsiveness to market changes.
In addition to integrating complementary oracles, we employ a fallback oracle mechanism. This system is designed to automatically activate if our primary oracle encounters issues, such as downtime or erroneous price feeds. When the primary oracle fails to deliver accurate data, the fallback oracle takes over, providing a reliable price feed without interruption.
This design is crucial because it ensures that our protocol remains robust and continues to operate smoothly. In the unlikely event that both oracles encounter issues, we have a contingency plan in place: the ability to pause the protocol. This feature allows us to protect users and their assets until we can resolve any data discrepancies.
By not relying solely on a single data provider, we build a more resilient price feed system that enhances the security of our lending protocol. With this strategy, we not only maintain data integrity but also foster trust and confidence among our users, knowing that their transactions are backed by reliable price information.