Pythora: Decentralized agents for secure entropy generation and on-chain Pyth price feed updates.
Pythora is a practical project that utilizes the Autonolas framework to create an Olas Agent. This agent is designed to perform specific tasks related to fetching and updating price data on the blockchain.
Here's a detailed explanation of how Pythora operates:
Agent Setup: Pythora employs the Autonolas framework to establish an Olas Agent. This agent is configured to carry out tasks autonomously, reducing the need for manual oversight.
Entropy Request (Pre-Update): Before updating prices, the agent requests a secure, verifiable random number (entropy) from the Pyth Entropy service. This randomness introduces non-determinism and is used to select which agent in the network should proceed with the next steps: fetching and updating price data on-chain.
Data Fetching: The Olas Agent fetches price data from Hermes, an off-chain API within the Pyth network, known for delivering reliable, low-latency data crucial for DeFi, gaming, and prediction markets.
On-Chain Updates: Once the price data is fetched, the agent updates this information on the blockchain using the updatePriceFeeds method. This process ensures that the blockchain has the most current and accurate price data.
Price Consumption: The updated price data is then consumed and logged in the console for further use within the application.
Integration and Workflow Entropy Request & Coordination: Before any price updates, the Olas Agent requests a verifiable random number from the Pyth Entropy service. This entropy is used to introduce randomness into the agent coordination process, such as deciding which agent in the network should execute the upcoming price update.
Data Fetching and Processing: The selected agent then fetches price data from Hermes, Pyth’s off-chain API. The data is parsed and formatted to meet the requirements of the on-chain updatePriceFeeds method.
On-Chain Updates: The processed price data is written to the blockchain using the updatePriceFeeds smart contract method provided by the Pyth Network. This ensures that price feeds are accurate and up-to-date for downstream consumers.
Automation and Fault Tolerance: Through the Autonolas framework, all steps — from entropy generation to data fetching and submission — are executed autonomously, reducing manual overhead and improving system resilience.
Partner Technologies Pyth Network: Pyth provided two crucial components:
Autonolas Framework: Autonolas enabled us to create a fully autonomous Olas Agent that can perform tasks without manual input, with built-in state machine logic and transaction safety.
Tooling & Contracts Foundry: I used Foundry for Solidity development and deployed a contract to Arbitrum Sepolia
Custom Entropy Consumer Contract: I built a custom Solidity contract to consume random numbers from Pyth Entropy. This contract connects directly with the agent logic, serving as the interface between randomness requests and on-chain coordination decisions.