Scaling composable DEFI protocol to 400M from dev side - 0xmikko | Gearbox Protocol
ETH Belgrade Community·Mon, Oct 7, 2024, 12:00 AM
Scaling composable DEFI protocol to 400M from dev side - 0xmikko | Gearbox Protocol
Transcript
hello to everyone really excited to see you in Belgrade amazing City so came yesterday and today I have a topic which is literally maybe a little bit new for many of us because we talk a lot about decentralization and it seems if you have a smart contract you can simply deploy it and all things done but it's not and why I will talk the next half an hour so let's start from blockchain trma and definitely I will tell you that it exists for the whole life of gearbox protocol why because we should make a decision between three main things in all blockchain the first part is scalability we want to grow faster we want to attract new users and we want to get more and more traction another part is decentralization so basically you want to really be decentralized you want to really remove one place of decision and the last but not least the part is security we want to provide a really good and robust way for people and they should trust you so we will talk about that in next 30 minutes stay tuned and shortly about myself I am a blockchain developer I participated in many hackaton and gearbox was a finalist of Global in 2021 so I have no great connection not Papa who works in VC fund or so on it was just from scratch to 400 millions in three years and it was three years of a very good job but of course I am still scared because I can't even imagine so much money 400 Millions here you can press this zero button on your keyboard but when you mount it around half a billion wow and what we could do there uh short explanation what gearbox is what we are building is a decentralized brokerage account so basically as it works in majority of Ci or tradify you can really leverage your money or strategies by using this decentralized account and currently gearbox could provide you like X20 more money for your for major strategies it depends of course of token and you can build them in the most native way so no predefine no hard hot strategies gearbox works as your wallet but with X20 more money and this is a short explanation how it works so you can see there a two- side protocol on the left side you can find the passive lenders people who are willing to deposit money to the protocol to provide a good yield without zero efforts it's a behavior like put your money and forget about them they just work for you and this part looks pretty similar like in a or compound or any other protocols because it's a very standardized currently ERC 4626 so nothing special but what really makes Gbox uniques it's the right part and here you can see the strategist who want to get for example X then leverage so this person could open credit account is a UD defy primitive and to explain it's better credit account is just a smart wallet with some restrictions and when you put money into this wallet by transferring them with a special method you can immediately take a margin loan from the pool and get EX 10 more money so you can see in the picture the borrower provide 10 e and the credit account takes immediately 90 East to the pool so after this one transaction you already have 100 e and you can manage them as usual so no special predefined things and here you can see you can send different transactions through the credit manager I will talk a little bit later and they will be executed for on behalf of credit account on third party protocol so it's the way how we integrate a lot of external protocols and this architecture help us to grow faster and faster and faster and literally it works like you as a brow send a transaction to this credit account it checks only two things the first part the token you will get is not uh is wi listed because of course we focus security from this blockchain trma on the first place if if you really support or contribute to lending protocol or protocol which has someone's money you should put Security on the first place and then this transaction could be executed and after that we recompute collateral and what we really want to check that there is enough money to the pay that back so any transactions if you really borrow e and then go to unisab and swap is into usdc you short is in natural way there is no predefined strategies you can choose Unis swap or any other IMM connected to gearbox if you go to Y and put this is into YN you start immediately leverage farming or you can combine you can borrow usdc go to year at first Park your long East and then you put ease and generate more eels and so on and so on so it's just the creativity of strategist what they really want to build and it's really show us the first big briak when you want to build a successful and scaling protocol what we learned modularity is a key part you should focus on so what's in many cases happens with many protocols I think you really listen many times it's too late to come to the market oh hype is over and so on but why it happens why really smart people very good developers could deliver something too late we delivered zv1 and we were late a little bit we delivered with two it start growing and we were late a little bit and then we start thinking what's we did wrong and the problem is development cycle it's usual you get an idea oh I want to leverage something then you should take some time for development smart contract development to make it really safe takes a lot of time then you should book the audit and someone who really book audits in this Hall who have a experience with Auditors oh yeah not many people but you know usually when you ask okay guys we freeze the court and we want to get a slot and they say okay in next in next six months we are fully booked sorry for that oops you really didn't think about that but if you come next time and say hey guys we start to work in on new version can we book in advance in a six months you will get a slot and we will spend the six months delivering the C say okay good send us a commit I have no commit I'm just start development sir how I can give you the last commit otherwise we can't understand how much time we need to really audit your quot so it always took time and the idea here is to minimize the smart contract you need to integrate new things and we did it in V3 and another part which is also you faed when you integrate many other protocols is composability it's also a really nightmare so we build a lot of small blocks to really fulfill all differences of the protocols because all protocols is a very very creative way all curve pools really have a different signature so you can't use one adapter to cover all of them some things do not really deliver uh this standard LP token if you put money into convex you get nothing you should find the solution how to integrate such kind of things but it's accountable way so currently we have a lot of predefined models to integrate it faster and this is a result who really like this point money it was really fun that I came to the industry in 2017 and people all time ask talken are tokens a decentralized way we want to have a honorship of things and then in 2023 points came to scene and nobody cares because they are fully decentralized but at the same time what do you think what happens in this I think it was a February 19th or so on you can see red line yeah this time when it started growing it was when we integrated R the East if I remember correctly and other lert protocols and it was a huge hype and to do that we build this modularity to be really Foster to the strategy to go to the market and you can see it's really amazing if maybe we would spend extra months for development or two months it's too late so my point if you build a protocol think twice how fast you can make a next iteration how you can add a small plugin how to write a very simple rapper to attract new asset new protocol new technology and deliver them to the market crypto development very very fast and another part it's a crucial part because you should break the barrier and people focused on ux in terms of front and apps but in my point of view it's a totally wrong way if you do not take into account smart contracts and usually I have a lot of conversation with smart contract developer say okay we built a pretty complex stuff so okay we do not care how this frontend guys because they really built in JavaScript I know solidity and they built in JavaScript so they could find some ways because smart contract are very very complexity but when you deliver these smart contracts which has a bad ux it seems that your users will really survive and this is two examples what we found is really works the first part as I said gearbox could help you to build the strategy in Native way it's a very very significant and if you have a complex strategy for example you want to have a five steps for example you want to swap East into usdc as it's shown then you swap usdc into fra fra into fra 3v and then you want to put that into the convex and when the gas cost I think around it was 100 to 200 way so you are not willing to spend too much these five cons four consequent transactions could take five minutes for each it's 20 minute you ask a person on the smart contract level to sit near computer and wait just imagine 20 minutes to build a strategy when you talk about looping it could be much worse because for some other protocols it could be automated but not the way so we really build multicol 2022 and then it's create two very significant part I think you should take into account the first part you should automate all the things related to approvals automate all stuff related to technical work but another part currently I think gearbox is unique we have atomicity so basically you can add the rule as a contract that the transaction should be reverted if I get less this desired amount it's a very very good when we talk about smart contracts and I start to build my strategy I do not want to be broken in the middle and really pay all these fees when I put my assets back just imagine what happens if the transaction could not be executed M it on the step three when I want to swap fra into fra 3v something happens exchange rate is different because I spent 15 times before and now the strategy is not lucrative for me anymore I should go back and for all these changes back I will pay fees I have price impact and so on so I can lose money and it really breaks the user experience so think twice about atomicity if you can make an atomic way to go from token a into token B and you can make a clear contract that I spend one e and as a result I will get not less than 2,95 uh 950 uh Stak CVX fra 3 CRV sorry for this complex name we are in blockchain it's cool because users really can understand the contract and should not spend a lot of time and of course try to remove all this stuff as possible I really support any solution to use a pyamid pyamid 2 and so on not to make this Anno annoing approvals each time a disaster and in gearbox we also have another Layel of security so we automate all these approvals when we execute transactions of behalf of credit account and we set them back to zero it's a very very good practice if you interact with third party protocol do not forget do not be lazy to remove approvals because it really empowers your Security even with proven protocols like Unis swap urve when you do not expect could happens and the last part it's a really new content when we talk about decentralization as I said three LMA means that you should at first focus in our way on different values and different protocols to be honest focus on different things so someone prioritize this and centralization and security but do not focus on scaling there are some lensing protocols which has I don't know maybe 10 million tvl and it's hard to grow further because the whole complexity of decision making is delivered to end users on the next part we will also want to really deliver all stuff related to um decision making especially from the risk perspective to someone because if you provide two complex and twoo risky solutions for end users it requires them to be PhD in mass or Finance to use your protocol which is also a disaster if you talk about Mass adoption but of course we want to remove this centralization as much as possible and gearbox continuously do these steps one by one to do that we introduce the quot system it's a really nice system when each token has its own limit so basically in a pool you can consider pool of liquidity and then we have a rule that not more than 10 million of this pool could be used as collateral if someone want to leverage e for example not more than 20 million of this pool could be used if an end user want want to use for example frax as collateral but not more than 2 million could be used if the user want to use them for R the East yeah it's just it's it's not a number and because we have a limits it requires that high demand could create a shortage of this quas and of course we introduced a pretty cool concept which called quas and each token has its own rate so basically if I use funds from the pool to leverage Ren East which is risky than normal East I should pay more but how to find this equilibrium how how to find the fair interest rate not to be set by a short part of people who decided this is rates for the next week and we built the way how gear holders could vote to really find this equilibrium and the system works for six months and it's really very very adaptive so it's create a good way because if you really if the gear holders could set up a pretty high interest rate all people who want to use this asset as a strategies just close the position and as result it's really reduce the utilization and of course gear holders are motivated to increase the utilization fees of the protocol and so on on the opposite side if you reduce the yield more people on the passive side will close and switch to another protocol and in this equilibrium Community find a really good way and and it's robust we can definitely believe it's good another part is decentralized risk curators which was really very very successful launched in Moro and this part to really make a next step when different risk curators could provide a different risk profiles to the target audience if you have a different patterns maybe some institutions prefer to get lower yeld but much safer and some maybe people who more who who has more risk Appetit really prefer to get higher yield but at the same time they understand that it's a little bit risky and if you decentralize risky rators if you provide them a tool to manage this risk you really make a huge impact uh huge step forward because now you should not deci side the market decide and people could really choose between two the same asset pools which really works better for them R for their risk profile and it's a good way decentralization and the last part I think it's a very very Innovative things we are going to deliver and we are still in research related to the uh bite code repositories so when you decentralize your risk rators there is another problem when when you want to have a final step of decentralization because these guys still use code your right for the protocol year as I said in architecture you need adapters to be connected with new protocols you need to set up a proven price feds to make possible to evaluate which asset and how much it cost it's a pretty complex because if we keep the whole code on GitHub and GitHub is centralized itself and of course risk curators and end users it's very hard to verify that the code they could compile and deploy is correct and of course if some potential attacker could provide a malicious code into not GitHub but maybe could HCK your machine and change one line of the smart contract during compilation time it could be a disaster and in this case we establish a totally novel concept which is called bite code repository so gearbox as a protocol will push all things into a special contract which is called bite code repository and then any risk curator could really use this code and use create to op code who knows solidity could understand that or evm and deploy the contracts is needed the similar things existed for UNIS swab but in Unis swab you have a standard Factory when you can deliver the pools and pools and pools and not more and here it's add some versioning So currently you can provide the new version of the contract and it's also available and to make it the last step of decentralization the Auditors which trusted by da could provide signatures on the first step gearbox def team will be the main contributors there but later it's totally okay if someone if you for example want to Launch protocol and get leverage build your adapter appload to this bite code repository and ask some Auditors to prove and they provide a wet onchain proof like a signature and then if it's enough to the consensus that the Cod is not malicious and work perfectly because of course we should trust some Auditors there it's okay to be used for all risk curators and in this game the involvement of gearbox def team involvement of Da could be reduced because now everybody could deliver code now everybody as a risk curator could connect new assets build new products built on modularity and deliver them faster and we really remove all these barriers to sell to solve this Landing dilemma because as I started we have three things to be focused security we put on the first place then of course we put scalability ility and this is the last piece how to make it fully decentralized and increase the speed and it's the way what we really learn practically so it's not like a theoretical things or something it's what we do every day by delivering the code check the concept and so on and the last part I also want to talk about the things what could happen with defi because currently it seems that in a new paradigm when we talk more about cross chain obstruction account abstraction defi should be transferred somewhere and the huge change happens when we introduced 4844 EP which really reduce the gas cost So currently as a developers we can build a new level of the protocols because primarily we were focused on gas consumptions maybe one or two years ago it was disaster we really uh fight for any gray or any gas cost currently it's totally free on majority things especially in rollup Centric ecosystem which vitalic said and it's a good way to be really closer to your customer and this new things in my point will really make the developers to make more complex complicated system use more code based large base and create better things and in this case it pretty cool that gearbox as I said built on the idea is that you have this decentralized brokerage account it works a smart wallet and it's possible to integrate it when all EAP 3074 and 7012 if I remember correctly will be implemented on the Node because it's really cool to have your own wallet as a smart contract wallet but with extent time is 10 times more money similar like credit card which is exist in real life so when you need money you pick them in your wallet and use across many strategies and it could be supported with all the centralization things I already mentioned and in some future I believe the whole defi will be transferred to these layers and not only exist on one chain or one roll up it will be some intermediate solution which could fulfill different needs and efficiently transfer liquidity between different Networks because this liquidity fragmentation problem still exist and we should work on them to create the equal interest rates and things across over waps to make this rollup Cent EOS uh rollup Centric ecosystem uh closer and closer currently people are really uh worrying about using the protocols on l2s and you can see and compare TL on mayet and on all other l2s but all these things related to egging layer avss and other stuff really help us to build this system when liquidity could be available to borrow on or app simultaneously and at the same time you can build different strategies with a really zero or equal zero fees and make your and your family profitable so that's all thank you so much thanks you for our attention maybe questions I know it's a lunch ahead so yes sure please uh can you use M because yeah yeah thank you so uh we're used to hearing about liid liquidity fragmentation as uh hello we're we're used to hearing liquidity fragmentation as a challenge uh and when when you mentioned it actually I I was wondering if if it should indeed be considered a challenge is liquidity fragmentation uh uh do you see it as a problem or is it maybe actually a a good thing uh I think it's a problem because uh what happened so there are two things in liquidity fragmentation the first one one is timing and the second one is cost so basically if you want to get liquidity on L2 and it could cost you a little bit more than on mayet because there are additional risks come to seene maybe it's totally okay but if there is no way to get liquidity on L2 and you should wait around half an hour when Bridges could finally deliver it it's not okay for theice speed for example if you have a pool and especially it's significant in terms of Ling protocol during the liquidation phase you have a short period of time when any lensing protocol like gearbox Mor for a and others should sell some assets to make this account healthy and uh this time currently much less than even Bridges could delivers these assets and for many longtail assets it's still impossible so basically when you ask someone how fast you can deliver from Main net to Native it's pretty cool but the backstage ends up with seven or 14 days which is fully impossible so we have like a lack of communication between different chains and as a result it limits the growth there and scaling but thanks it's a really good question thank you more questions okay thank you so much thank you for your attention have a good and productive days here in belgrad
Automatic transcript — names and jargon may be misspelled.