📕
Yagi Finance
  • Yagi Finance Introduction
  • Contact Us
  • Products
    • 🔀Vaults
      • Introduction
      • How to use Yagi Vaults
      • ERC4626
  • Developers
    • 🤖Automation
      • Introduction
      • How it Works
      • How to Create a Task
      • How to View Existing Tasks
      • ITask.cairo
      • Fee Model
      • Security
      • Tasks
      • Keepers
      • For Vaults and Bridges
      • For Order Books and Lenders
      • For AMMs
      • For Derivatives Platforms
      • For Games
    • 🔧Build a Yagi Vault
  • Additional Resources
    • How to contribute
    • Roadmap
    • Discord
    • Twitter
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Automation

How it Works

PreviousIntroductionNextHow to Create a Task

Last updated 3 years ago

Was this helpful?

Warning. The protocol is in active development so expect this section to change regularly

Low-level explanation

If you are not familiar with the protocol at the high-level, please read Yagi Finance Introductionfirst.

The protocol defines a task interface ITask.cairo that consists of two functions:

  • probeTask – defines conditions for task execution, returns 1 if task is ready to be executed and 0 otherwise

  • executeTask – executes task.

The task author creates a task contract that conforms to this interface and deploys it to StarkNet. Once deployed, the task smart contract's address is whitelisted by the Yagi team and keepers begin to execute.

Each keeper will first call probeTask to see if task is ready for execution and upon receiving a 1 (ready) will invoke executeTask. Keepers do this by running dedicated software (see example below).

The task interface model is very flexible and can accomodate several different use cases:

  • Regular timed execution (by using get_block_timestamp()

  • Conditioned execution (by manually checking for certain conditions)

  • Deploying a task separately from the contract (by "authorizing" the task to perform certain contract actions).

🤖