How to provide a fully On-Chain Defi Dapp

ETHCC 6 · July 2023 · 22:14

Solene Daviaud presents autonomous smart contracts intended to remove offchain initiators such as bots from DeFi operations. The speaker discusses autonomous liquidity management as an example.

Speakers

Topics

From ETHCC 6, hosted by Ethereum France.

Transcript

hi everyone I'm really happy to be there my name is solenoham one of the co-founder and CEO of Dosa so we have also Leo and alexson from dusa in order to talk about take part on this Workshop so we are going to talk about this authorization of defy which is unfortunately incomplete and difficult to implement in the Quran D5 protocol so this is a necessary topic to consider in order to move on the right direction for the future of divine so how to provide a full-on chain divided so we'll be discussing about this topic starting with highlighting the Quran defined decentralization issues then

introducing two new components that are the Unchained front end and the autonomous smartphone swags in order to build the freelance and application and thanks to that components we will focus on the autonomous liquidity Concepts so it's a new kind of liquidity management running fully unchain and with Auto Chain initiators and finally Alexa will do a demo on the autonomous contract so let's start by questioning the decentralization of G5 so decentralization is a complex term muslin defy and several debates are emerging mostly from the important view of micro regulation about what is the fully decentralized application

so according to use Dosa and the co-founder of nonsense adap is a decentralized window or its mechanism running fully Unchained so that's that's mean or the protocol Works entirely on the blockchain and without option initiators so the blockchain is natively decentralized and secure so a protocol can benefit from a high level of security and decentralization by being entirely of chain on chain sorry so the results of this lack of decentralization are the increase in terms of act with almost 4 billion story in the last year we have also a lot of

human error providing for liquidity manager but although we have some many front-end steel offensive sensorable so why is this issues the main reason is the centralization of defy so finally the majority of different users still interact with centralized front-end and we have also a lot a lot of dependencies on centralization record even if we have a lot of decentralized records are emerging and finally as a user is still complex to manage this liquidity by itself so that's why the user needs to delegate it

to a liquidity manager so I'm going to introduce you to new components that is that are the ancient Fontaine and the autonomous map contracts in order to create a full engine application so we will take the example of Dosa so this is blockchain so before to start it's important to know that ethereum is not yet in position to include the structures for the moment and Masa offers interesting future like you ancient Fontaine and autonomous maximum tracks in order to provide the freelancing application they also provide great metrics about decentralization scalability and

security if you are interested by Masa um the team will have a boost during ECC so you can you can turkey with the cartoon if you want to do it so let's let's start by the ancient Fontana so today a lot of of efforts are focused on back-end security so accounts are increasingly attacking the front end of the apps it was the case for a curve in 2022 so for that I just created a copy of pure real DNS server and after that project is the DNS point to work site and put on my resource contract on this on page that's

mean all the users were interacted with this on-page um receive fake approval requests so it's a real issue for defy in terms of alternative you know ipfs or ens so this this application works together and have complementary to talk a little bit about ipfs so each file exhausted by a server and the biosis BIOS binding system so The Binding system allowed to keep a 5 for animated by those time so that's mean uh if if the file become npn it can be no

longer available to replicate it on the rest of the server so that's why your ipfs need to incentive The Binding system in order to have um to ensures the file distribution and we're getting ens and so regarding ens is just to our domain name and you need to pass by your centralized server by an application in order to obtain the register your your name on the blockchain so we have also a lot of alternative like ICP and always but I'm going to introduce you to another one

that is the master station so for formal Association muscle loss to store as if I continue the front end directly on the blockchain so that's mean you need to register your DNS on the master Network and after that you can design your job by um and copying the most important elements into the smart contracts and you can employ the directly on the blockchain after it so it's important to know that Masa works with determines this smart contract that means the smart controls can directly interact with with the with the fountain so as we use outside on the other side

we just need to download the master plugins that's called Master station in order to have access to do so and other application with Total Security and you can just type dosa.masa onto the browser and everything will be okay so from now Leo will introduce you to autonomous smart contracts yeah thank you Celine hi everyone I'm Leo the one of the five co-founder of Dosa and the CEO so I'm going to talk you about the idea of autonomous smart contract and how we use it in D5 so just a bit of comparison between classic smart contract and auto Moon smart contract the idea is that with classic

smart contract when you are sending a transaction you like triggering the smart contract to execute for example the swap that you want to do on any dexes but when you want to have like for example a latent execution with a limit order or dollar cost average order for example you need the smart contract to be triggered by an external server like for example but or or any other centralized entity that needs to trigger it but with another new smart contract the idea is that when you are setting up your order you setting all the parameters directly in the smart contract so the autonomous smart contract can read the chain every every half a second so you can wake up by himself when he sees that the action that you wanna that you want to do is is

uh is a is doing on the Chain like for example we're going to take the example of limit order just after that so in terms of other example you have gelato that offers to automate smart contract but one of the problem is that only white listed address can trigger uh the different smart contracts to do so so that creates a point of centralization on gelato uh one of uh really interesting proof of concept that we saw recently earlier in the year it was with optimism with their bad work update the idea is that the bad work updates are implementing a new type of transaction that can be used to create and automate smart contract with time parameters so that that's going through through the right direction and we are definitely

looking at all of those options to deploy doosan Auto Chain in near future so just to take the example of a limit order when you want to do a limit order on a decks you're going to set up the the order while you while you can do on a classic uh Decks that have limit order so you set up the price but uh you need to have Oracle that check the price of the blockchain uh and the Oracle needs then to trigger the smart contract to execute your order so the idea is that all this part with your recurl is situated off the blockchain so it can be like the source of ax or human errors that can lead to to serverless in terms of funds of the users and after all of that when the Oracle trigger the smart

contract only that the smart contract is going to execute the order for the users and the user is going to receive the token and his wallet but when you have an autonomous smart contract the idea is that the user is setting up his order on the application the same but the idea is that the parameters set up by the user is directly set up on the autonomous smart contract so every half a second like I said before the smart contract is taking the price on the blockchain for example on the liquidity pool to be sure that the price is attained and he can execute the limit orders at that moment the user when he is setting up his order he know that his order will be executed because it's already writed on the blockchain so we have no uptrain initiator on this type of transaction the idea is that we

took the limit order example for it to be more simple but we aim like to do it further with dollar cost average that is already available on the Dosa beta at the moment but we also want to do that with Oco and trilix Club the idea is that we aim like to give all the Traders the bricks to construct like complex trading complex trading strategies that are completely Unchained and thanks to all of that you can you can play with all of that to do like several liquidity management also on chain so that's what I'm going to talk next like autonomous liquidity so the ID it's since uh uni swap introduced their new model based on concentrated liquidity in 2021 user needs to supply the liquidity on the pool on on a special range to have like

the the best liquidity utilization and to generate the most Fields as possible but at the same time when you are doing that the user like needs to rebalance their liquidity each time to press the the price goes out of the range where he has supplied liquidity so the idea is that at the moment we have several issues with concentrated liquidity firstly retail user are not bringing the liquidity and emergency complexity of it uh secondly LPS are not profitable if they don't manage intensively their liquidity and even in that case it displayed a lot of time and sometimes they are not even like break even and if retail AP wants to like generate a yield on the liquidity position they need like to to call a

liquidity manager like Iraqis Finance for example but those liquidity manager are running like off chain strategy that are being triggered by Bots so that goes into this scheme so here you can see that you have free choice repairs replace your liquidity manually but that will definitely take a lot of time um using Bots uh if you if you can run birds at home like that can do server strategy like to rebalance your liquidity depending on the market situation at the moment or using liquidity manager that can lead to third part that can introduce a third party to your liquidity providing experience or even can lead to human errors for x or y reason

the idea is autonomous liquidity is that we are giving the possibilities for users uh to like Supply liquidity and have directly the smart contract that have uh that have an autonomous rebalancing strategy for the liquidity the idea is that on the near future we will have like several autonomous smart contract that will have several autonomous strategy at the moment we just released our beta with the first autonomous liquidity managing strategy that is live um but the idea behind all of that is to have a better user experience so the user only need like to supply the liquidity on the immactivate the autonomous management a better security because they can have

like the vision about all the strategies that are being run with their liquidity and they can also um aim to have more yields because the liquidity is managed at all time without consuming them any more time so the idea is that we have launched the the Dosa beta today with the first version of autonomous liquidity and dollar cost average where you can all have access to it because it's public since this morning so the ID globally is that with Dosa we are building a fully Unchained Imam based on two core technical properties the idea to have the front-end directly stored on blockchain with Masa station but also autonomous smart contract that are helping us to create complex trading order that are completely Unchained so

with all of that we are able to to create low sleep page swaps autonomous liquidity and different complex trading order like you saw before with three different level of user interface because the ID because behind all of what we are building is like to be as inclusive as possible and help everyone get on board on the on the default ecosystem so here is the team in terms of the team we are five co-founder at the moment with soleno Alexander here today and Alexan is going to present you how an autonomous Smart Control work and how uh with the example of dollar cost average order that are live on our beta at the moment hi everyone so

um so yeah I'm gonna do a deep dive into um dollar Quest averaging so for those that don't know so basically it's a way for investors to um basically invest in a token without worrying about um [Music] so like you can invest and let the the system do its work so you can see that right now we have 9000 USD and 555 rifles so keep those numbers in mind so let's say we want to to use to invest 100 usdc and we want to buy some red litter

and for the sake of this tutorial we'll do it every minute but um of course in a in a real world scenario you might do it like once a week or once a month so we first increase the allowance so that's the basic workflow and then we'll start the DCA so let's do this and so this is gonna it's gonna happen 10 times but you can also choose to do it infinitely so we can see that the transaction goes went through and so if we'll take a deep dive into the code so

for those that will know Mass abduction runs on the web assembly so you can write for my contracts in the assembly scripts which is basically a subset of typescript or you can also use the rest they plan to add the evm compatibility in the near future but um for now that's the stack and so you can see that it looks like a solidity a lot and so the part that interests us is this function and so you can see at the end so there is this send message so basically how it works is that um in a real in like in regular blockchains you have the mempool which is basically the pool where

pending transactions are waiting for validators to um to to pick and be validated and so in the master blockchain there is a second pull which contains the autonomous autonomous transactions and so this message helped to trigger those transactions and and help take advantages of autonomous smart contracts and so um while I was talking you can see that if I go back to my portfolio you can see that I have now um eight 800 usdc so two transaction went through and now I have a 0.11

wrapped it more so we can see that it went successfully and so that's the the power of autonomous smartphone size I didn't have to do anything and so the I continue to invest in in Rapid so pretty pretty cool concept yeah thanks thanks a lot Alexander just to come back on the slide I know it was run on Adobe right oh yeah uh so yeah this was the the Deep dive

into the the fully Unchained DCA and uh now uh you can like scan the kiraka to have access to our beta and try autonomous liquidity and all complex trading order that are currently live on our beta the idea is that the mainnet version will go live at the Q4 of 2023 and now feel free to have to ask any question guys thanks a lot foreign [Applause] do you guys have any questions yes thank you thank you um you said that in these

this is an autonomous smart contract and that uh it checks on chain the price yeah how does that work smart contracts can't do this so do you have an oracle no no dude so we have an Unchained Oracle so it feels like um if you know about the Trader Joe Trader Joe the Trader Joe it which is a like a copycat of unisat okay so um we have like a 19 Oracle and we also have we can also correct the price break directly from the pair we look at the the result and uh but this is completely on train yeah okay I'll research the Oracle so

thank you uh do you have do you guys have any question yes over there hi so uh every time this autonomous smart contract does any computation does it cost gas so yeah it costs some gas obviously and so um you know I maybe I haven't said it but um the difference between autonomous transaction and regular transaction is that you have to pay the gas up front and so if the smart confer runs out of gas so the transaction will cancel and it won't happen anymore and there is also like a some sort of competition so

the there's like a ranking and the more orgasm you said The more likely it has to to work sure okay thank you uh any questions uh I just have once uh you guys are based on a theorem but are you focusing on maybe other Layer Two uh who are based on Masa indeed that is not another layer one and we are at the moment we are looking at a layer two ecosystem like optimism where where we are able like to give the same experience for user to be fully Unchained with like uh complex trading orders okay and about your

liquidity uh system uh do you um like a user will have something like a dashboard to um to make us a strategy about DCA for example or uh how do you manage the the uh Des trading strategy uh yeah yeah the idea is that user will have like two possibilities for accessing the dabs the first one that will be fully Unchained if they are using Masa stations so they can have the the most secure application as possible and if they do not want to pass by the Masa station client they will pass directly by the web to have access to our application where they

will be able like two customize all their complex trading orders such as DCA and the idea is that in a near future like September or October we aim to give them even the possibilities to customize their autonomous liquidity strategy and stuff like that okay thank you very much guys thanks a lot thank you