Automations Framework

Search...

Ctrl + K

Get Started

Introducing Unit

Introduction to Unit, a blockchain automation protocol that simplifies the process of building, configuring, and executing automated workflows.

What is Unit

Unit is a robust blockchain automation protocol that simplifies the process of creating, configuring, and executing automated workflows across multiple networks. Unit streamlines on-chain operations for DeFi, blockchain games, payments and more, by turning them into an Unit Workflow. Read more about use cases in the relevant section.

The Unit workflow is its core component, allowing users to concentrate on the core of their tasks while simplifying the implementation details. Its portable and wallet-agnostic design enables workflows to operate independently or integrate smoothly into diverse applications. With its task-oriented approach, Unit serves as the Swiss Army knife for BlockchainOps.

Understanding the Basics

Let's say we want to automate a simple task: buy a fixed amount of Solona daily, but only if the price is below $2000.

Without Unit

The user would need to handle several tasks manually to achieve this:

Monitor Solona Price: Write code to periodically fetch the price of Solona.

Ensure Daily Trades: Implement a system to track transactions, ensuring that trades are performed only once per day by checking the timing of the previous swap.

Execute Swaps on a DEX: Develop the code to perform the token swap, which may vary depending on the DEX being used.

Manage Funds: Ensure the necessary funds are always available for the swap, either by setting up a separate account with funds or by integrating with smart contracts.

Using Unit

We describe the entire process in a clear, declarative manner using the workflow.yaml file. The workflow is then sent to the Unit engine, which interprets the YAML and executes the process as defined.

That's the workflow.yaml file for our conditioned DCA example. It's a simple one-step workflow.

- name: conditioned_dca

version: 0.2

wallet:

address: $WORKFLOW_WALLET # the wallet can be EOA or AA wallet

type: local

steps:

- name: swap

module: dex #we use the swap module to perform the swap

method: swap

arguments:

tokenInAddress: $SELL_TOKEN

tokenInAmount: $SELL_AMOUNT

tokenOutAddress: $BUY_TOKEN

name: uniswap

network: $WORKFLOW_NETWORK

receiverAddress: $WORKFLOW_WALLET

trigger:

name: daily_schedule

type: periodic

interval: daily # Execute the steps daily

value:

function: priceOf

value: $BUY_TOKEN

condition: # condition

op: lessThan

value: $MIN_TOKEN_PRICE

With the workflow ready, the user just needs to fill the parameters - which token he wants to buy, what amount and etc.

Unit Benefit

Speed Unit allows you to quickly configure or build automations from scratch, reducing development time. By hiding the implementation details, Unit enables users to focus on core logic, lowering technical barriers and making automation accessible to non-developers.

Flexibility Workflows may include multiple steps and interact with different smart contracts and networks. Whether it’s for using lending protocols, swapping or bridging, Unit workflows allow users to customize their automations as needed.

Modularity Unit modular design lets advanced users create their own automation modules or integrate new data sources. Once integrated, these modules are available to all Unit users, promoting a collaborative and extensible ecosystem.

Wallet Agnostic Unit workflows are compatible with both EOAs and Smart Wallets, enabling seamless transitions between wallet types such as Safe, Rhinestone, or others. Instead of adapting your code to each wallet, Unit makes it effortless to support a wide range of wallet technologies.

Portability Unit workflows are highly portable, they can run on various networks, with different protocols or wallets behind the scenes. Its wallet-agnostic nature ensures compatibility with most users' wallets, making it easy to embed workflows into Dapps and wallets or use them in backend systems for business related tasks.

Reliability Workflows are executed by the Unit engine, a production-ready software designed to handle secure and reliable execution of automations across multiple blockchain networks. This ensures high reliability for all automation processes.

Where to go next

Working with Workflows - learn about the workflows and their lifecycle

Quickstart guide - build and run your first Unit Workflow

Use Cases - How to extend the DCA example, and more use cases

wokrflow.yaml spec - technical deep dive into worfklow specification

Unit CLI - easy tool to start with Unit

Next

Working with Workflows

Last updated 5 months ago

Get Started

Introducing Unit

Deep Dive

Products

Use Cases

What is Unit

Understanding the Basics

Without Unit

Using Unit

Unit Benefit

Where to go next