New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

GearBots 🛠 Intent Agents

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join us for a workshop titled, "GearBots: Intent Agents". From November 17-19 2023, ETHGlobal welcomed developers from around the globe to take part in shaping the future of Ethereum at ETHGlobal Istanbul. Over $600,000 USD in prizes were given away at the prestige Istanbul Congress Center... thanks for an amazing weekend hackers! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] thanks for coming my name is Mikel and I'm original inventor of gearbox and today's speech we will talk a little bit how many interesting things you can build on gearbox and we choose a very narrow topic which is called Bots I believe it's quite interesting to introduce me I'm a hacker like you so I participated in many kakat tons primarily for crypto and as you know gearbox was created urine AS Global Market make kakon in 2021 and after the demo day thanks for cartic thanks for all support of is global it became a real project and now we deployed on mayet since 20121 the highest tvl we achieved was around 120 million now it's it's around 30 and pretty soon we will deliver V3 so I consider hakon is the best way for Innovation to create new ideas test your hypothesis and today my short and brief uh discussion about our Bots what to inspire and show how many interesting things we can build together using gearbox bot concept and how it could be done practically uh so I will try for next 30 minutes tell you how to build something interesting in two days I know how it's hard as I said I'm already the hacker I know that time is going too fast and you should Implement smart contracts frontend application and so on in very short period of Time how to get as many Integrations as you can because there are many interesting protocols as well and of course people want to learn more from different prot protocols get more prizes and make something which could really be helpful for um community and different defy protocols and of course how to set up environment and do some practical stuff so let's start a short and brief explanation what gearbox is gearbox is a solution which create a onchain credit or credit abstraction so basically we create a protocol which I think quite nois and it represents a credit account obstruction as you know credit uh as you know account obstruction is the way how you can really manage your onchain activity using smart contract wallet and gearbox could be considered and credit accounts itself as a smart contract wallet but you have 10 times more money on them so really incredible like a credit card you shouldn't worry how to money get in and out you shouldn't go to a for looping and so on and of course our primary usage is leverage but we open to create many new things so as you can see you can be EA you can really use any Wallet account obstruction you can connect our credit account and interact with different protocols in Native way there is nothing to be programmatic before it's really like your wallet but of course it has some limitation and if you go to briefly to architecture we shouldn't spend a lot of time here as you can see gearbox is two side protocol on the left side you can see L pce people who are interesting in passive income they provide liquidity to our pools our pools is one token pool so they have no impermanent loss and so on a little bit similar to a so you can provide usdc to usdc pool or east or east pool and so on but what is really exciting is the right part so in the center you can see a credit account and if you a gearbox user you can open multiple credit accounts wherever you want so you can one 10 100 like wallets in your metamask and then you can send transactions and when you open this credit account or even after you can provide initial funds to be able to get a margin loan for example let's check how it works oh it's transaction sorry you provide 10 East to credit account and you take leverage margin loan from the pool like a 90 is after opening credit account you have 10 times more and then you just send transaction to credit account they automatically execute it on third party protocol in a native way but all tokens and outcomes should be on this credit account and here a more detailed version so you can see as account owner you send a transaction or a batch of transaction then they will be checked because the Target contract should be WID listed from the risk perspective it's significant not to send money everywhere then we check the token you will get back is in collateral list so we should really have some experience how evaluate these tokens and then the transaction of bch will be executed and after that we will compute Health Factor just to be insured that it is enough money to pay the debt back is it clear or any questions at this point guys okay let's move forward and the problem we really want to solve using Bots that probably users should continuously check their health Factor they really want to go to vacation and for example forgot about some depth and so on because as you know crypto is a high volatile market and you could not predict what could be whenin the next day so we try to find a way how to solve the interesting Pro problem of at first part automation of everyday leverage activity and another part what we really want to do is to be able to connect different servers to manage your portfolio as you know if you want to build a bat in Python in typescript or rust you should provide a private key it's not safe when you will keep it in plain form on your web server because someone could crack your server take the key and steal the whole money so we want to solve this problem as well and of course we wants to create a lot of possibility like ecosystem system like app store for unleashing creativity and create a lot of different stuff and here how B works so just to remind here a credit account simply works as a smart contract wallet but now not only you can send transaction you can allow external smart contracts to do it on behalf of you it's a quite simple idea however we have a very robust permission system so you can allow some B just to add collateral it makes sense because if your health factor is going down you only one need to implement one function just give me a collateral somehow yeah or you can build a board for example which could really swap one asset into another and it could be done like at collateral and with row so basically the idea is very simple it's doable during the kakon what you should should done is the way how to automatically provide transaction on behalf of account owner and how to build the trust model because of course owners could be worrying about allow some B which do not check and uh meet some uh security measurements so oops oops there are a lot of ideas which we can Implement so the first part of course it's AI agents portfolio management and different stuff you can use CH GPT you can go to hugen face and find pre-trained model wherever you want because now you have the way how you can really automatically execute any prediction with Bots we can connect really a lot of interesting stuff which could be computed of chain because it's quite difficult to build natural uh uh Nal Network or using uh smart contracts but here you can build some part of chain and then allow to be executed by B I think it's a really interesting and good stuff to development of course great ux it's amazing you can connect your credit account with telegram with Lance wherever you want because as I said you should not keep your private key you can set permissions you can really provide a lower possibility to manage your fund you can say hey my telegram bot could be ragged me more than 10 person in months and even in the worst case you will still have your money so it's incredible you can build different things related to health Factor protection comparing with POS protocol so you can say guys hey you have for example cedit account going to be liquidated soon a few notification but if a user invocation and forgot leder somehow you can do it for himself and take some profits also good and of course a lot of stuff to be integrated cow swap 1 inch any protocol for example you can bit a limit order board using flashboard together so I think it's also pretty cool stuff because using cow swap you can find better rates you can really execute liit orders and create totally new experience for crait account users so a lot of interesting stuff could be built and let's check how it works in practically because we are developers and on hakon we should deliver some code let's check how it works step by step let's start from the B Anatomy so at the first part you should create any function which could be executed and here are two possible types of bots some of them could be private for example your hedge fund and you want to create a some propriatary wells management M system which will be closed and used inside your organization you can create some access modifiers like owner only then both you connect to your system is fully private it's totally okay and then you can maybe stream some AI data or some risk data to the bot and understand how to manage the funds or maybe what is more interesting you can build a public bot and it has no access modifi so everybody could call it everybody could connect it to its own account and then of course this execute methods could be triggered by you if you if you have a some server or you can ask any automation platform like gelata for example then we should build inside a trust model gearbox Bots has a very and incredible open apy so we have some things to measure measure and help you to measure for example you can store some balances to prove the user that you do not take more you can really set the minimum level of Health Factor after the execution and so on but the primar uh efforts to build the trust is on you so because for example if you make a uh swap from one token to another and you want to say hey user we will never pick a swap than 5 person worse than chain link it's an idea so you in the trust model block when you can see a function called store State just get a chain link price you compare this price with tokens and then you can check it after multicol execution to prove that everything is okay if the price was not so good for example you have a strong price impact on Unis swap you will revert pretty simple build a good trust model and users who you provide this public bot will really happy and the center piece is a multicol so gearbox allow you to really combine transaction in a batches it's quite cool so you should not really do continue things approve approve call Unis swap approve approve C power and so on just list what you need if you want to call Unis swap call Unis Swap and gearbox itself will provide needed allowances approvals and take them back after the transaction if you want to uh build a more complex stuff related to adding qual and so on everything the whole account management could be also done in the same multicol any questions at this part everybody knows how to build okay perfect perfect and there are three Corner things I believe maybe I couldn't go more details but what we can deliver today for you we have a public test night it's unel fork for everyone if you want to have your own personal public unil Fork we is deployed with3 just ask our team on a stand or we will provide any uh different uh things like telegram Channel Discord Channel and we will provide an URL for you which represents RPC we have a pretty fast re Anvil which could really help you to test your solution much better than you will really use INF for example or Alchemy each such uh deployment 24hour keep this in mind multicol what I mentioned amazing tool to put all transaction together to be uh executed at once and another part we can also provide keep in mind a router IP router could help you to find the best path between two assets so if you have no idea how to build multicol it could be a little bit more complex during this two days on hakon just ask RoR and say hey RoR help me I want to swap usdc into this convex position what to do and you will get multical immediately very cool so basically do not spend time on small things things wider and create a great picture so we have all those tools together just ask for them and uh now let's check what I already promised as a Cod and I will show that oh I think it's should be yeah uh and prove that writing BS it's a very fun things so basically here we will it's not account manager I think limit order board what we already mentioned before it's quite easy to build so of course the first part you should clone our repository as it written in docs just git loan Force install and everything you need in the repo of the smart contract deployment no more complex installation then you can start from this like a boiler plate and create wherever you want so nothing to go deeply to libraries and find different stuff so here you can see a very very simple things just to explain uh the limit order board so we have an order and here you can see burrower is a account owner manager is a credit manager and this is a contract which uh help uh allow you to really get uh and execute different stuff crit account is address of cedit account token in this token you want to really go out from account talking out what you want to get and I think all other things are pretty understandable here it looks like a Unis swap transaction structor similar to it so you create a simple contract let's keep orders one by one in a mapping and to store the latest ID let's at an internal variable called Next order ID a few events just to be able to manage what's going on with your contract and of course for monitoring as well and here some errors to understand what was incorrect but here as I said three functions to to show how it works the first part is the part when you can submit order it's a pretty simple we just store it in a mapping and increase the index of order ID and me events the second part we just want to cancel order and we cancel it here and the latest part is Execute order so maybe it's the most interesting part of our board so everybody could called execute orders so it's why limit orders could be called by any gelato person or any other stuff and of course here we do not focus on how to pay RSE but of course it's up to you how you are going to pay this and you can see it's quite simple the first we validate and get amount in and man amount then we transfer funds from MSG Center to the bot account because B will be a counterparty in this multi call and create approval to the manager and then it quite easy we create multic call of two positions the first one is at okay sorry sorry yeah yeah sorry I hope this all cot so you can find in in our repos thanks for attention and your time and let's build together

Automatic transcript — names and jargon may be misspelled.