Gelato Integrates Chainlink, Bringing Reliable Automation to Ethereum Developers
Gelato Network is now live on the Ethereum mainnet, providing developers with the tools to quickly build & deploy their own automated applications. A key part of making the Gelato Network function with high reliability is our integration with Chainlink, the market leading decentralized oracle network, for built-in access to its Fast Gas/Gwei Price Reference Oracle.
Through Gelato, users will be able to specify the gas price conditions under which their automated transactions will execute. For example, developers can program the smart contract to auto-execute trades for any gas price and/or halt the automation of trades if gas prices rise above a certain threshold. Gelato Network will reference the gas price reported by Chainlink’s Fast Gas Oracle at the point of smart contract maturity, ensuring users always pay the current fair market price and have a way to control their usage costs.
Chainlink’s fast gas oracle marks the first time that smart contracts have access to a reliable, decentralized on-chain source of fast gas prices. Gelato is leveraging their oracle to bring next-generation smart contract automation tools to developers, opening up use cases such as liquidation prevention, automated trading, dollar-cost averaging, and more.
The Importance and Challenges of Automated dApps on Ethereum
Automated dapps are applications that perform actions on behalf of users under the conditions specified by them. This is achieved by third party relay servers called “Executors”, which send transactions on the users’ behalf, such as moving their funds, updating balances, or conducting any other smart contract operation.
Automated dapps are pushing Ethereum applications to a wider audience because they offer users streamlined experiences by abstracting the hard work of manually monitoring and placing each transaction themselves. In fact, automated dApps are already deployed by several DeFi protocols. For example, DeFi Saver has an automated liquidation prevention mechanism, Set Protocol uses its automated portfolio rebalancing, and MakerDAO relies on third party servers (Keepers) to constantly monitor the collateralization ratios of debt positions in order to liquidate any undercollateralized position.
The challenge is that developers wanting to deploy automated dApps have to build and audit their own smart contracts. They also have to develop and run their own specialized relay node infrastructure to broadcast transactions on-chain. All of it needs to be done in a non-custodial and secure manner, in order to preserve the valuable properties of the smart contract. This entails a lot of time consuming up-front development work that ultimately results in the operators of the dapps becoming the single point of failure of the systems they built.
Automated dApps Made Simple with Gelato
Gelato Network is infrastructure that enables developers and businesses to easily build and profit from automated decentralized applications. Developers can use Gelato as a tool to build secure, composable and automated dapps without the need to write any smart contract code, nor having to run the underlying relay node infrastructure. This is achieved by allowing developers to compose any arbitrary pre-existing Condition, with arbitrary Action smart contracts, which combined form “Tasks”.
Developers can write and deploy those Tasks themselves if they want to customize or innovate. Or they can choose from many standard templates that have already been written and deployed for them. Developers submit these Tasks to the Gelato protocol. Such Task submissions are monitored constantly by a network of relay nodes called “Executors”, which will send transactions to execute them on behalf of the developers’ users, but only if the specified Conditions are satisfied.
For developers to tap into this decentralized automation service they only need to maintain an ETH balance on Gelato, which will be used to compensate and incentivize the Executors. This is why Developers or End-Users are also called “Providers” in Gelato, as they are the one paying the Executors. Gelato abstracts away most of the complexities that automated dapps burden developers with by providing a simple on-chain API that can serve any use case possible. Gelato also allows developers to abstract the gas complexities surrounding dapp automation away from their users and makes it easy for them to build a business model into their automated dapps, if they choose to. It’s another “lego” for DeFi and other applications that can be included in other smart contracts to schedule future conditional transactions.
Using Chainlink Oracles For Reliable Gas Prices
Chainlink is the most widely used oracle network on Ethereum, providing price oracles to an increasing number of leading DeFi applications. It’s collection of Price Reference Data oracle networks incorporate decentralized architecture at both the node operator and data source level, providing strong security and reliability guarantees on uptime and tamper-resistance. It also utilizes strong quality control standards on its price reference networks, using only high quality node operators and high quality off-chain APIs to source data from.
Chainlink’s Fast Gas Reference Oracle enables participants in the Gelato Network to decide on the fast gas price that gelato automation nodes should use. The average fast gas price is not something which is currently available on-chain, as it is determined by the off-chain mining market. Chainlink makes the fast gas price available on-chain and its decentralized design ensures it’s stable and manipulation resistant.
Chainlink’s on-chain gas price oracle ensures users always pay fair fees and allows them to exert direct control over their automation operating costs. For example, users might be happy to pay up to $20 for a gelato transaction that potentially saves them $100.000, but only want to pay up to $0.50 for a transaction that transfers tokens from one wallet to another
This enables exciting use cases, where users only automatically interact with certain smart contracts up until a certain gas price ceiling. Moreover, Chainlinks other on-chain price reference oracles are the perfect source for determining whether a wide variety of Gelato Conditions were met and certain actions should be executed on behalf of users. For example, Chainlink’s ETH/USD price oracle could be used as a reference price feed to determine if an automated trading application built on Gelato should rebalance a portfolio’s exposure to ETH.
Some of the use cases we are already seeing interest in include:
- Automatic trading
- Limited Orders on DEXs
- Stop-loss Orders on DEXs
- Automatic interest rate refinancing
- Dollar cost averaging
- DAO funded uniswap oracles
- Automated weekly salary payments
- Investment basket rebalancing
Luis Schliesske, Co-founder of Gelato Network explained:
“Without Chainlink’s secure and reliable decentralized oracle network, automated smart contracts would not be able to execute with the reliability guarantees that developers require, especially as smart contracts scale in value. Users and developers purchasing executions from Gelato’s “Executor” will need a reliable price point in order to avoid overpaying for gas and to properly budget their dApp. Chainlink is the first to provide this gas data on-chain in a reliable and decentralized manner, enabling Gelato to remain secure in its end-to-end operations.”
Example Use Case of Gelato and Chainlink Integration
An example use case built on gelato: Automated Dollar Cost Averaging using Kyber Network
In the example shown above, we have a user that wants to sell ETH for DAI every Friday on Kyber Network. The user could set up a contract with that specification on Gelato, but naturally, the fast gas price would fluctuate over time.
In this scenario, we would have four actors in the process — the user, Chainlink to provide fast gas price reference data, Gelato to establish and execute the contract, and Kyber Network to process the trade.
The timeline for this automated smart contract execution and Chainlink’s supply of fast gas price reference data would be as follows:
1) The smart contract is established and shows that there are X Days remaining until contract maturity. We see that the user wants to sell ETH on Kyber, however, the transaction is currently withheld by Gelato.
2) Every Friday Gelato “removes” its barrier withholding the transaction, at which point the User’s ETH is automatically swapped to DAI on Kyber Network as the contract is executed by an Executor.
3) Within the same transaction, the user, or their Provider, is also paying Gelato for executing the transaction on their behalf. The fast gas price that the user has to pay at the moment of contract maturity will be informed in real-time by Chainlink’s Fast Gas / Gwei aggregation oracle.
As a result, instead of attempting to pre-determine a fast gas price at the point of contract creation, users can pay the exact fast gas price at the point of smart contract maturity to access the fairest and most up-to date price.
Going forward, we foresee that Chainlink’s other Price Reference Data oracles will be the perfect source of off-chain pricing data for other Gelato contact conditions, which can be used to define when certain actions should be executed on behalf of users. We plan to expand upon these concepts and others with future integration using Chainlink oracles.
Gelato is a Berlin-based startup supported by blockchain development communities Gnosis and MetaCartel. Gelato is designed for the creation of personal Ethereum bots, which will execute certain actions on a user’s behalf if certain predefined conditions are met.
If you’re a developer looking for more information about our automated smart contracts or personal Ethereum bots, check out our GitHub! Here you’ll also find a demo that showcases how to build automated trading dApps using Gelato and Kyber Network.
If you’re a developer and want to quickly get your application connected to Chainlink Price Reference Data, visit the developer documentation and join the technical discussion in Discord. If you want to schedule a call to discuss the integration more in-depth, reach out here.
Chainlink is an open source blockchain abstraction layer for building and running decentralized oracle networks that give your smart contract access to secure and reliable data inputs and outputs. It provides oracles to leading DeFi applications like Synthetix, Aave, and Kyber Network, numerous blockchains such as Ethereum, Polkadot, and Tezos, and large enterprises including Google, Oracle, and SWIFT.
Note: chainlinkecosystem.com does not claim any ownership of this content, all credit to Gelato, view official announcement.