📄
Autonomy Docs
  • Autonomy Network
    • Overview
    • Use Cases
    • System Components
      • Registry
      • Requests
      • Executors
      • StakeManager
    • Products
      • AutoSwap
        • How It Works
        • Integrating Limits/Stops Into Your DEX
        • Limits & Stops SDK
      • AutoHedge
        • How to Use AutoHedge
        • Return/Profit Analysis
        • How It Works
        • How It Works (detailed)
          • Derivations
        • Links
      • AutoStation
        • Tutorial 1: Create A Condition And Upload It
          • Part 1: non-recurring
          • Part 2: recurring
          • Part 3: uploading to AutoStation
          • Part 4: bonus - how to call manually
        • Tutorial 2: Example automation using AutoStation
  • Developers
    • How to create a Request
    • Deployed Contracts
Powered by GitBook
On this page

Was this helpful?

  1. Autonomy Network
  2. Products
  3. AutoStation

Tutorial 1: Create A Condition And Upload It

PreviousAutoStationNextPart 1: non-recurring

Last updated 2 years ago

Was this helpful?

Typically every action requires a condition under which you want the action to execute, such as rebalancing a portfolio under the condition of time (e.g. every day), or making a trade under the condition of price (such as a limit order or stop loss). Some conditions are very common, such as time-based conditions, and the beauty of AutoStation is that, because you can mix and match any number of conditions with any number of actions, the same time conditions contract can be used with any other action or condition in a completely modular way!

This tutorial shows how to create a contract that is usable in AutoStation to add time conditions to any other action/condition. Since it's already created and uploaded to AutoStation, it's a bit pointless for anyone else to do it, but it shows every step required in the process so you can easily come up with your own condition and upload it to AutoStation. We're going to create a time-based condition contract that allows you to use 2 kinds of triggers/conditions:

  1. At a specific time, e.g. "trigger on June 1st at 10am" (more suitable for non-recurring automations) - `betweenTimes`

  2. Recurring with a constant time period "trigger starting on June 1st at 10am and every day after that" (obviously more suitable for recurring automations) - everyTimePeriod

Part 1 covers the specific time condition, and part 2 covers the recurring condition. The whole contract code can be found .

here