Introducing Gelato V2, The Most Reliable Way To Automate Your Ethereum Smart Contracts
Tags: blockchain, ethereum, defi, bots
Published: 2021-04-14 15:56:28

TL;DR 👇

- Using [Gelato v2](http://gelato.network/), web3 developers can build “service” smart contracts that define certain transactions that Executors (bots in the Gelato Network) monitor and automatically execute on behalf of projects and their users.
- Gelato v2 enables a wide variety of operations ranging from limit orders to dollar-cost averaging to refinancing one’s debt position to avoid liquidation.
- Gelato acts as a single entry point for the execution of these transactions. The whole system coordinates a decentralized network of bots and ensures that those bots only charge fair market rate gas fees based on actual gas consumed and the Chainlink fast gas price.
- Bots are coordinated using “slots” and only execute transactions when it is their “turn” in order to avoid racing conditions while guaranteeing maximum efficiency.

<h2>What’s New with Gelato Network V2?</h2>

<b>1) Each dapp can define its own custom interface</b>
Whereas Gelato v1 imposed a “one size fits all” way of having developers communicate with Executors, v2 is significantly more flexible and opens the possibilities for an infinite number of implementations of how that communication is happening. Developers still do not have to reinvent the wheel and only have to write minimal smart contract code, because we came up with several “Service Standards”, which compose a standard set of functions and modifiers developers can use to automate certain functions on their dapps. More standards, tailored to specific sets of use cases, will be released shortly.

<b>2) No need for proxy contracts</b>
Whether services that are powered by Gelato v2 require a proxy contract or not is completely up to the developers’ to decide. This is no longer a requirement and there are a number of use cases that are already in development that will save users significant gas costs down the line by not requiring a proxy contract per user.

<b>3) Off-chain data generation resulting in significant gas savings</b>
Executors can implement custom logic off-chain that enables them to compute arbitrary data and pass those to smart contracts services, which save a substantial amount of gas that was previously used to fetch certain data on-chain. This capability also opens the door to more interesting use cases like off-chain conditions where data is not available on-chain, but more on that soon!

<b>4) No pre-deposits and pay for transactions with any token you want</b>
Transactions pay for themselves as long as Gelato is paid an amount equal or higher to what it pays out to its network of executors. In practice, a transaction can hence swap e.g. DAI to USDC on Uniswap, and send part of that received USDC to Gelato to pay for the transaction fee and the rest to the user.

<b>5) Ability to submit tasks via Meta transactions</b>
One pain point of Gelato v1 was that tasks had to be submitted on-chain, which meant that before anything got executed, users already had to pay for some gas (even if not that much). V2 supports meta transactions which means that users only have to sign a message off-chain that will be passed to the “Gelato Service Relayer” from which Executors can query the available tasks in order to execute them. This part will be controlled and maintained by the Gelato Core team for now and will be decentralized in the near future.

<b>6) Coordinating bots so they don’t front-run each other</b>
The problem with all “keeper” systems today is that they use gas price auctions in order to decide which bot will end up executing transactions. This results in a significant loss in value that leaks to miners. In the Gelato Network, Executors are coordinated by a soft off-chain coordination mechanism that allocates “slots” to different Executor operators. In those slots, these Executors are the only ones who can execute the tasks of a particular service. If an executor goes offline or fails to serve a specific slot, it will be kicked from the network. In the future, staking and slashing will add even more incentives for executors to abide by the rules and keep a constant uptime for their servers.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrpm6501t7yujqfltzrz.jpg)

We envision Gelato v2 as an ever-changing and improving networked service for developers that will constantly adapt in order to guarantee the automation of transactions in a reliable and efficient manner. Most of the security-related code was externalized into the service contracts and thus services can be assured that even if Gelato is maliciously taken over, their services are safe. For this reason, we choose to implement Gelato v2 using the Diamond Standard, otherwise known as EIP-2535. The upgradable protocol is secured by a multisig controlled by the Gelato Core development team, however, there are already concrete plans to transition this control over to the upcoming GelatoDAO, which will launch in Q2 this year.

[Gelato’s v2](http://gelato.network/) was built to complement next-generation protocols like [Uniswap v3](https://info.uniswap.org/), which leads to a lot of features open-ended for third parties to build out. For instance, Gelato can automate a variety of functions of Uniswap v3, including reinvesting fees back into the pool, converting LP NFTs into wrapped ERC-20s, and automating LP price ranges.

As demand for smart contracts automation increases in the DeFi ecosystem, there is an even greater need for a cost-efficient and more flexible off-chain solution. That is why we launch Gelato v2 to help and empower the developers to build unstoppable DeFi dapps.

--
If you have any questions or need help to get started, please reach out to us in our [Telegram community](https://t.me/therealgelatonetwork) or email us at hi@gelato.digital.

We are looking forward to building with you!