🎬Pythia: automation

Pythia is a flexible automation oracle capable of executing transactions at scheduled intervals, providing randomness, or delivering price feeds from Sybil. This guide will walk you through the process of creating a subscription using both the front-end application and Solidity.

Frontend Subscribe

For frontend subscription, follow these steps:

  1. Visit the Pythia application page at Pythia DApp.

  2. Set up your own subscription by choosing the chain where your contract resides, specifying your contract address, and defining the method to be executed.

  3. Define the automation frequency, and if desired, add payload to execution transactions as randomness or price feed from Sybil.

  4. Authenticate with Self Identity Wallet Extension (SIWE), top up your execution wallet, and submit your subscription.

Subscription Usage Examples

Here are a few examples demonstrating how to use the Pythia subscription in different scenarios:

  1. Basic Execution: An example where the Pythia oracle executes a simple update to a value.

import {OrallyPythiaConsumer} from "../consumers/OrallyPythiaConsumer.sol";

contract PythiaExecutionExample is OrallyPythiaConsumer {
    uint256 public value;

    constructor(
        address _pythiaRegistry
    ) OrallyPythiaConsumer(_pythiaRegistry) {}

    function updateValue(uint256 _value) external onlyExecutor {
        value = _value;
    }
}

These examples should help you get started with using Pythia. With its robust features, Pythia offers great flexibility in automating transactions and retrieving real-time data, making it a vital tool for any decentralized application.

Last updated