How to start using your own Ethereum bot — no code edition
A manual for play.gelato.finance
Quick Recap:
What is gelato?
- “Your personal Ethereum bot.”
Gelato is your personal Ethereum bot that will execute and automate transactions for you, in accordance with instructions and allowances prescribed by you.
Why do I need a gelato bot?
- “Be woke, not broke.”
You, the mere human, cannot always be online and connected to Ethereum, in order to transact just when the Conditions (market, price, account balance, time …) are right.
So why not have your own bot do the manual work for you? Your bot can monitor the Ethereum network for you 24/7 and transact on your behalf when the Conditions, specified by you, are met.
What is play.gelato.finance?
- “An easy-to use web interface, to deploy, instruct, monitor and manage your gelato bot”
While gelato is your bot, play.gelato.finance is the tool that lets you talk to your bot. You can use it to submit Instructions to your bot and view your bot’s activity. Think about Instructions like transactions that your bot should execute for you, as soon as your pre-defined condition is met.
What can I do with my gelato bot?
- “Automate all your future Ethereum activity — also for Dapps”
On the gelato web interface you can create Instructions for your bot. These Instructions consist of sets of two components: Conditions and Actions. A Condition specifies the thing that you want your bot to keep monitoring. For example, your account balance, blocktime, or the ETH/DAI price on Kyber Network. An Action is what your bot should do with funds from your wallet if, and only if, your specified Condition is satisfied. Say, for instance, send tokens to your hot wallet from your cold storage, if the hot wallet balance is low. This means your bot can basically handle automatic account top-ups for you (this feature will be available on the UI soon). What else: maybe buy some ETH on Kyber, if the ETH-DAI price dropped? The list goes on. Your bot will constantly check the network for your Conditions, and execute transactions, with your funds, in accordance with your Action Instruction.
How do I get my gelato bot?
- “Deploy your bot in only 1 Ethereum transaction”
All you need to do, in order to have your own gelato bot available to you, is to deploy it on play.gelato.finance. This is a one-time thing you have to do. Well, to be precise, you have to do it once for every wallet that you use to connect with on gelato, if you want that wallet to also be upgraded to gelato’s automated transaction capability. You will be prompted to deploy your gelato bot at the end of creating your first instruction.
Let’s get to it!
FIRST TIME GELATO USER EXAMPLE WALKTHROUGH
“Automatically swap your KNC for DAI on Kyber, if the KNC/DAI price dropped — a so-called ‘stop-loss’ trade”
This example walkthrough will guide you through your first time usage of play.gelato.finance. The key takeaways from this walkthrough are:
- How to sign in on gelato
- How to create an Instruction for your bot by specifying a Condition-Action pair.
- How to deploy your own bot
- How to approve your bot to have access to the token that you want to schedule a conditional Action for.
- How to submit your Condition-Action Instruction to your bot.
- How to monitor your bot’s activity and the status of your submitted Instructions.
In this specific example, we are a first time gelato user, and we want to instruct our bot to convert some of our KNC into DAI, but only if the KNC/DAI price dropped by 0.10 DAI below the current market KNC/DAI rate. Here goes:
Step1: VISIT play.gelato.finance
Step2: CONNECT YOUR METAMASK
You need to have ETH on there, to be able to deploy your bot and submit Instructions to it.
Step3: SELECT YOUR CONDITION
In our walkthrough example we want our bot to act upon price changes in the Kyber Exchange Network.
Step4: SELECT YOUR ACTION
Here we want our bot to Trade Tokens on Kyber, but only when our Price Condition is met by the market.
Step5: INSTRUCT BOT
Step6: SET CONDITION
For our example we want to sell our KNC into DAI, if the current KNC/DAI price drops by 0.10 DAI, in order to put a hold on our losses should the KNC price decrease in the near future. This type of trade is also known as an automatic “stop-loss”. So in our Condition, we want to monitor the KNC/DAI rate. We set the Price Condition to the exact same (future) price that we want to sell our KNC into DAI at. However, we need to take into account that rates on Kyber depend on how much of a Token we want to sell. So to specify our Price Condition we need to:
- Set Sell Token to KNC
2. Set our SellVolume
For this example, it makes sense to use the exact amount of KNC we intend to sell, so that the Condition accurately reflects the price we want our bot to monitor and act upon. So, if we want to sell 30 KNC for DAI, if the price drops, then we should fill in 30 KNC as Sell Volume into this Condition field.
3. Set our BuyToken to DAI
Now we can see the current KNC/DAI price based on the KNC SellVolume we inputted:
4. Set the Price Condition we want our bot to act upon
Lastly, and most importantly, we now need to set the KNC/DAI Price at which we want our bot to sell our 30 KNC into DAI for us. Since we said we only want to do that, if the KNC/DAI price drops by 0.10 DAI compared to the current price of ~0.36 DAI per KNC, we fill in the last box like so:
Here you can compare the current price, with your specified price condition:
And you can also always double-check the auto-generated Condition description above
Click Next and ….
Step7: SET ACTION
Now that we have our KNC/DAI price condition set, we want to specify what our bot should do, if our condition is actually met by the market. We need to specify the “Action” it should take. For our example, we already specified that we then want our bot to Trade Tokens (KNC) on Kyber. Now we need to add more details to our Action Instruction.
In our Condition, we set the price rate at which we want to swap our 30 KNC for DAI to 1 KNC = 0.26 DAI. So in the Action we now:
- Select KNC as Sell Token
2. Input 30 as Sell Volume
3. Select DAI as Buy Token
Click Next and ….
Step8: CHECK THE INSTRUCTION SUMMARY
Now we want to check our Instruction Summary and make sure we did everything right.
The auto-generated Instruction Summary text says:
If 30.0 KNC are worth 7.800.. DAI (1 KNC = 0.26 DAI) or less on Kyber
This is our Price Condition. And it is correct. We want to sell 30 KNC for DAI, if the KNC/DAI price drops to 0.26 DAI. Remember that the current KNC/DAI price in our example is at ~0.36 DAI
Then your gelato bot will sell 30.0 KNC for DAI on Kyber
Correct. If the KNC price drops to 0.26 DAI, we want our bot to sell our 30 KNC into DAI for us.
Make sure to read through the Condition and Action summary details again. Here you can also check the Current Price Condition again
and you can also check that you have enough tokens available for your bot in your wallet. In our case it is 30 KNC that we need.
All good, we are set! Click Next and ….
Step8: Submit Instruction
Step9: DEPLOY YOUR BOT in Transaction #1
In this example, we are first time gelato users, and do not have our bot yet. So we first need to deploy our bot. We only have to do this once per wallet that we want to automate transactions for on play.gelato.finance.
Confirm the bot deployment transaction on Metamask.
Step10: APPROVE YOUR BOT in Transaction #2
In this example, our bot needs to have access to our 30 KNC, in order to be able to convert it to DAI, when the price is ripe.
Step11: SUBMIT INSTRUCTION TO BOT in Transaction #3
This is the 3rd and final transaction step that we as first time gelato users have to get done. Now we are going to submit our Instruction to our newly deployed bot. In our future usage of gelato, we sometimes still need to send approval transactions, to give our bot access to our funds. However, if it already has our approval to spend a token, we will only need 1 transaction to submit a new instruction to our bot. Let’s get on with our very first Instruction
Here we can see that on top of the usual Transaction Fee we have to pay on Ethereum, we also need to pay a Gelato Fee. The reason is that your bot will have to pay for any gas it will use, when executing transactions for you, in the future. So the “Gelato Fee” is basically an Ethereum Transaction Fee deposit that your bot needs, in order to be able to transact on the network on your behalf.
Step12: Your bot has received your Instruction and begins working for you
Step13: My Bot Activity
Here we can see all the Instructions we have submitted to our bot.
Instructions can be in status:
- open: your bot is working but your Condition was not there yet.
- successfully executed: your Condition was there and your bot executed your specified Action for you.
- cancelled: you cancelled your Instruction or it expired and you forgot to cancel it beforehand.
- issue — please contact us: there might be a problem with your bot that you should contact the gelato team on Telegram for.
Step14: Instruction Details
Here you have an overview over all your Instruction’s details. We will take a look at the details of the Instruction we just created. Please take note that your Instruction has an expiry date. An Instruction expires, if the Condition you specified was never reached and the Instruction’s lifespan is over. You can always cancel an Instruction to reclaim your Gelato Fee deposit, but only before it has expired. After that you cannot reclaim your Gelato Fee deposit.
Optional Step: Cancel
You can always send a transaction to cancel your open Instructions. Please be aware that Instructions for your bot also have an Expiry Date. If your Condition never happens before expiry, and you do not cancel the Instruction, you will not be able to cancel the Instruction any more, in order to get your Gelato Fee deposit back.
You can check the Transaction on Etherscan and see that some ETH was transferred back to your wallet. This is the Gelato Fee deposit you prepaid when you submitted the Instruction, which you just cancelled.
You will see that “My Bot Activity” will reflect the new Instruction Status
END OF EXAMPLE WALKTHROUGH
Wow. We made it. And boy does Ethereum’s User Experience still suck! Sorry for that. Tell us about it. We are working on it. Patience….. We’ll get there eventually.
On the slim chance that any of the readers made it to here without starving, here is some bonus material:
Another last use case example, please?
- “If MKR/DAI price increases, go short on Maker ”
Same as the walkthrough example, just this time your bot will take your funds to buy Short-MKR leverage tokens for you, but only if the MKR/DAI price increased into the range of your price Condition.
Last but not least. Gelato is in Alpha and the smart contracts are NOT AUDITED. Therefore, use at own risk and with caution.
Sweet like ice cream!