• This repository has been archived on 13/Sep/2022
  • Stars
    star
    233
  • Rank 172,230 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

V1 implementation of Gelato Network

Gelato - The easiest way to build automated Ethereum dapps


Get Started 🍦

  • 🍦 Read our Gelato-V1 release announcement on our blog
  • 🍦 Try out our demo tutorial here
  • 🍦 Check out our developer documentation here
  • 🍦 Read the Gelato Audit report

Who is Gelato for? 🍦

Developers on Ethereum, who want to build automation into their dapps, without having to worry about:

  • Running the required underlying relay node infrastructure themselves
  • Trusting a single operator to run the relay node infrastructure for them

If you as a developer want to leverage Gelato automation, all you need to know is Javascript or Solidity or both, depending on what you want to build or customize.

What is Gelato ? 🍦

Gelato is a tool for developers to automate smart contract execution on Ethereum.

Gelato is a tool to build automation into dapps and thus level them up to a whole new range of cool features and User Experiences. Think of Gelato as the infrastructure that enables you to make use of automated If This, Then That execution for smart contracts. It allows for the combination of arbitrary Conditions with arbitrary Actions, which will be executed on behalf of your Users by a network of relay nodes called "Executors".

What is an automated dapp? 🍦

🍦Example #1: Swap 100 DAI to ETH on Uniswap every week. (check out the Gelato demo tutorial for a similar use case)

🍦Example #2: Automatically refinance my loan between multiple lending protocols to always get the highest yield.

🍦Example #3: Automatically buy ETH when its price dropped and then sell it again after the price has gone up again (automatic volatility trader).

A regular dapp like uniswap.exchange requires Users to interact with it manually by sending transactions every time they want to swap tokens. Users that want to sell 100 DAI every week on Uniswap have to manually do it every week.

An automated dapp, using Gelato, requires Users to only send a transaction once and then will keep on sending the ensuing transactions on the Users' behalves in the future, when, and only if, the User-defined Conditions are met. That's why, with Gelato integrated, Users that want to sell 100 DAI every week on Uniswap only have to send one initialization transaction for their 100 DAI to be automatically sold from then onward.

How Gelato works

Gelato Protocol

At its core, Gelato is a network of relay nodes (executors), which User's can instruct to submit arbitrary transactions (Actions) on their behalf, when certain predefined Conditions are met.

The only thing Executors demand before executing a transaction is to be rewarded, or at least compensated, for their gas costs. Therefore, Users have to deposit some ETH on the GelatoCore smart contract, which can be seen as "filling up their gas tank". Now if an Executor executes a transaction, the costs of the execution will be automatically deducted from the User's ETH balance on Gelato, similar to other pay-as-you-go services. Gelato uses Chainlink gas price oracles, to regulate the gas price Executors are allowed to use, and thus to ensure fair market rates.

Everyone can access the Executors' services by submitting arbitrary Tasks to them, which they will execute exactly as per the User's specification. Executors never have custody of Users funds, they simply initiate the transaction. Funds are always kept either in the User's wallet or in their personal smart contract wallet (proxy contract).

Therefore, in order to enable your Users to let Gelato submit transactions on their behalf in the future, someone simply has to deposit some ETH to pay the Executors on Gelato and you are good to go. This someone actually does not necessarily have to be the User himself, it can also be the developers (called GelatoProvider), who want to offer their Users a smoother UX on their dApp. Namely, a UX that does not require the User to pre-deposit ETH on Gelato and to worry about gas-tank balance top-ups during high gas price volatility.

GelatoProviders

GelatoProviders deposit ETH on Gelato, in order to pay for their Users' automated transactions. In most cases, GelatoProviders are dapp developers that want to offer cool automated dapps to their customers, without requiring them to prepay ETH and worry about maintaining a high enough balance for Executors during times of gas price volatility.

GelatoProviders have the ability to define exactly what kind of automation Tasks they provide to Users, so that GelatoProviders control the business logic of the Tasks they pay for. They can define:

  1. The Spec of the Task, or in other words, what kind of Conditions are allowed in combination with what kind of Actions

  2. The maximum execution gas price for any Task Spec they whitelist.

  3. They can define much more on their "GelatoProviderModule". Notably, what type of Users, or rather User smart contract proxy accounts, they allow to tap into the GelatoProvider funds, to pay for transaction automation.

Why would a GelatoProvider pay for their Users transaction fees on Gelato?

While developers can certainly build Dapps with Gelato that require their end-users to maintain a gas tank balance, to pay for automation gas, having to ask end-users to deposit some ETH on Gelato before their transactions get executed still sounded like bad UX to us. Especially because end-users would have to make accurate predictions about future gas prices, in order to have some degree of certainty that they will still have enough funds deposited on Gelato, in order to pay Executors when the time has come. That's why we introduced the concept of GelatoProviders, who can abstract this complexity for the end-users.

In short, GelatoProviders are incentivised to pay for their Users automated transactions because they can provide great UX this way. Additionally, they have many opportunities to create interesting business models on top of Gelato. For example, if a GelatoProvider enables Users to swap DAI to ETH on Uniswap every 2 days, then an automated GelatoProvider fee mechanism could be applied for each executed transaction, which retains 0.5% of the sold tokens and sends them to the GelatoProvider.

This way, on the one hand Users do not have to prepay ETH on Gelato, and on the other hand GelatoProviders get rewarded, or at least compensated, for paying the transaction fees on behalf of Users, all without having to do the heavy lifting of running the underlying infrastructure.

Hence you can think of Gelato as a pay-as-you-go execution service for developers to create the first wave of user-friendly automated dapps, while also running a sustainable business model.

Executors

The Gelato Protocol's design goal is to incentivise an open and decentralized market for automated Task execution. This means that a multitude of relay servers should be run, independently from each other, trying to execute Tasks for Gelato Users, in search for profits. Ideally, Gelato developers and Users should not have to care about who is running the server. They should just have to submit their Tasks and expect them to be executed on their behalves. Gelato allows anyone to run an Executor node and to reap rewards from Task execution. Currently, Users/GelatoProviders still assign an Executor to their Tasks. However, this can be a smart contract that runs a decentralized execution market mechanism. The first version of such a smart contract is on the Gelato roadmap and will be deployed in the future.

How are Executors incentivised?

Executors are incentivised to run their automation servers by receiving a small fee (2% initially of the total gas costs of each Task they successfully execute, which is paid from the balance each User/GelatoProvider has to keep on Gelato. So if a Task execution cost them 0.001 ETH for example, they would receive approximately 0.00102 ETH as reward. They also get a refund of their gas costs, if they executed a Task that had a bug in it, which led to a revert. In other words, Task GelatoProviders need to make sure their Tasks are bug-free.

How can Executors submit transactions on behalf of Users, without having access to their private keys?

Through smart contract wallets - proxy contracts. Each Gelato dapp User must have a personal smart contract wallet deployed through which they interact with the Gelato protocol, in order for the dapp to be able to leverage automation for them. Once this requirement and a few more case-by-case details are fulfilled, dapps can let their Users submit Tasks to Gelato and Executors will execute them via the Users' smart contract proxies in the future. Users' have full control over what their proxies can do and can provide them with, or retract, access to funds in any of their wallets.

Gelato is highly modular and works with any smart contract standard out there. Two of the most widely used examples include the Gnosis Safe and DSProxy, but you can also use Gelato with your own custom made proxy contract, or use the GelatoUserProxy.

Need help building with Gelato?

Let us know in our Telegram Chat, if you have any questions or issues. We are more than happy to help you get going and even provide you feedback on your idea for an automated dapp (we built quite a lot ourselves)!

Let’s build the next generation of fully automated Ethereum dapps, together.

Reach out to us in our official Telegram Community Chat

More Repositories

1

gelato-uniswap

How to build an automated trading dapp using Gelato V1 and Uniswap.
JavaScript
180
star
2

automate

Automate arbitrary smart contracts with Gelato Automate
Solidity
169
star
3

web3-functions-template

Gelato Web3 Functions template & examples
TypeScript
35
star
4

swap-orders-lib

Gelato swap orders library [Deprecated]
TypeScript
31
star
5

relay-sdk

A fast & reliable transaction relaying API for web3 projects like Games, Bridges, NFT marketplaces and many more
TypeScript
30
star
6

limit-orders-lib

TypeScript
26
star
7

g-uni-v1-core

G-UNI Pools are managed ERC20 Wrappers around Uniswap V3 Liquidity Positions
Solidity
25
star
8

auto-top-up

Automatically top up multiple ETH addresses once their ETH balance falls below a certain threshold.
Solidity
22
star
9

web3-functions-sdk

Web3 Functions SDK
JavaScript
21
star
10

sorbet-finance

JavaScript
19
star
11

automate-sdk

Gelato Automate SDK
TypeScript
18
star
12

web3-functions-hardhat-template

A template to get started using Gelato Web3 Functions in your hardhat dev environment.
TypeScript
16
star
13

gelato-safe-module

Gelato Safe Module to automate transactions for Gnosis Safe's
TypeScript
16
star
14

koru-dao-contracts

Solidity
13
star
15

gelato-chi

A repo containing the gelato smart contracts need to automate CHI buying based on gas price
Solidity
12
star
16

relay-context-contracts

Solidity
12
star
17

gelato-core-contracts

Gelato Core Smart Contracts
Solidity
12
star
18

automate-sdk-hello-world

Create Hello World tasks using Gelato Automate SDK
Solidity
10
star
19

triggered-oz

The triggered smart contract repo, but everything is upgradeable using the Openzeppelin SDK and CLI tools -- big shoutout to OpenZeppelin and ether.js for providing such great tools!
Solidity
9
star
20

off-chain-resolver-template

TypeScript
9
star
21

vrf-nft

Solidity
9
star
22

gelato-automate-foundry-template

Gelato Automate examples on Foundry
Solidity
8
star
23

relay-docs-examples

A companion repo to the Gelato Relay docs, with code examples on how to get started with Gelato Relay.
TypeScript
7
star
24

relay-example-unit-tests

Relay Examples with Unit tests
TypeScript
7
star
25

gasless-cctp

Bridge USDC from and to any chain without needing the native asset to pay for gas.
TypeScript
7
star
26

relay-examples-frontend-backend-v5

Repo showcasing how to call the relay from a React UI as well as from node
TypeScript
5
star
27

lensgpt

Lens post generated messages with AI and Gelato
TypeScript
5
star
28

gelato-polywrap-template

TypeScript
5
star
29

g-uni-docs

5
star
30

relay-contracts

Gelato Relay: Contracts + Tests
TypeScript
5
star
31

gasless-wallet

TypeScript
5
star
32

erc4337-counter-example

TypeScript
5
star
33

vrf-contracts

vrf-contracts
TypeScript
5
star
34

relay-safe-session-key-contracts

TypeScript
4
star
35

relay-safe-examples

Relay Safe integration examples
TypeScript
4
star
36

gelato-relay-foundry-template

TypeScript
4
star
37

uni-v3-range-orders

Uniswap v3 Range Orders automated by Gelato
TypeScript
4
star
38

gelato-omen

Automating Liquidity Withdrawals for Omen Prediction Market Liquidity Providers
JavaScript
4
star
39

account-abstraction-demo-ui

TypeScript
4
star
40

gnosis-protocol-automations

Gnosis Protocol automation features using gelato
JavaScript
4
star
41

demo-gasless-app

Create a starter gasless Gelato Relay app with custom smart contract deployments
TypeScript
4
star
42

koru-dao-ui

TypeScript
4
star
43

off-chain-resolver-examples

TypeScript
3
star
44

relay-sdk-hello-world

Gelato Relay SDK - Hello World
TypeScript
3
star
45

gelato-subgraph

Subgraphs to easily query data from the GelatoCore Smart contract
TypeScript
3
star
46

gelato-raas-aa-ui

This project showcases a React implementation of how to use web3Auth with Safe and Gelato on Gelato Raas.
TypeScript
3
star
47

w3f-lensgpt-tutorial

LensGpt Repo simplified
TypeScript
3
star
48

w3f-automated-topup

TypeScript
3
star
49

yearn-saver

JavaScript
3
star
50

gelato-tutorial

Gelato Ops Tutorial using delicious Ice Cream NFTs
Solidity
3
star
51

vrf-nft-hardhat

TypeScript
3
star
52

avax-summit-w3f

Solidity
3
star
53

eth-muc-gelato

Example of W3F generating an AI image for the NFT
Solidity
2
star
54

hello-world

TypeScript
2
star
55

furu-limit-order-handler

Placing Gelato Limit Orders using Furucombo Proxy
Solidity
2
star
56

gelato-test-kit

Test kit to play around with gelato alpha
2
star
57

web3-functions-demo-app

Demo app showcasing how to use Web3 Functions to automate smart contracts with off-chain data
JavaScript
2
star
58

dca-sdk

Typescript SDK to integrate Gelato Dollar Cost Averaging on DeFi UIs
TypeScript
2
star
59

astar-zkatana-starter-kit

This starter helps to quick start developing on zKatana.
TypeScript
2
star
60

automate-unit-testing

The purpose of this repo is to showcase unit tests examples of using Gelato Automate in a Hardhat enviroment.
TypeScript
2
star
61

w3f-pyth-poc-v2

Updated Pyth PoC to Beta 2.0 and hardhat plugin
TypeScript
2
star
62

w3f-automated-bribing

Solidity
2
star
63

gelato-raas-aa

This starter helps to quick start with Safe account abstraction on Gelato RollUps
TypeScript
1
star
64

gelato-native-oracle-nft-example

Gelato Native Oracle One Dollar NFT Mint Example
TypeScript
1
star
65

w3f-fee-consolidator

TypeScript
1
star
66

job-board

Make a PR to that repo in order to get help creating a task on Gelato Ops
1
star
67

avax-summit

TypeScript
1
star
68

how-tos-12-web3auth-on-gelato

This project showcases a React implementation of how to use web3Auth On Gelato Raas.
TypeScript
1
star
69

rel-gasless-nft-usdc-example

TypeScript
1
star
70

w3f-zkSync-workshop

Defi Workshop zkSync <> Gelato
TypeScript
1
star
71

how-tos-9-10-vrf-jump-start

This repository provides example contracts and instructions for setting up Verifiable Random Function (VRF) on Gelato, utilizing both Gelato VRF and Gelato VRF (Chainlink Compatible).
Solidity
1
star
72

w3f-created-task-from-contract

TypeScript
1
star
73

w3f-enzyme-poc

TypeScript
1
star
74

gasless-transaction-demo-app

TypeScript
1
star
75

relay-sdks-monorepo

SDK to integrate into Gelato Multichain Relay.
TypeScript
1
star
76

gelato-thirdweb-relay

A frontend repo to get you started with Gelato Relay and using powerful thirdweb hooks.
TypeScript
1
star
77

gelato-instadapp-ui

React UI demonstrating how to submit an automated refinance task from ETH-A to ETH-B using the DSA & Gelato
TypeScript
1
star
78

gelato-dca

Automated trading using Krystal & Gelato
Solidity
1
star
79

wellTimed

Time-based order slicing on Kyber Network using gelato - Use Rinkeby Network
JavaScript
1
star
80

how-tos-2-w3f-speed-run

In this `How To` we will speed run to create our first Web3 function on blueberry , visit https://raas.gelato.network/rollups/details/public/arb-blueberry , one of Gelato Public Rollup Testnets : https://raas.gelato.network/public-testnets
TypeScript
1
star
81

astar-zkatana-w3f-pyth

This repo showcases how to use Gelato Web3 functions and Pyth on zKatana
TypeScript
1
star
82

gelato-raas-redstone

Oracle that using RedStone and Gelato Web3 functions to: Push on-chain price if the price difference between stored and live price is gerater than 2% or the time elpased since last update is greater than one hour
Solidity
1
star