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

Loading player…

1inch 🛠️ 1inch Fusion: a new standard for decentralized swaps - Sergej Kunz

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Speaker

Sergej Kunz

Join Sergej Kunz from 1inch for a workshop titled "1inch Fusion: a new standard for decentralized swaps". Thank you to everyone who joined us for ETHGlobal Lisbon! After being away from Europe for almost a year, we've decided to bring the heat and excitement back to the stunning historic streets of Lisbon! All over the world, hundreds of thousands of developers, users, hobbyists, creators, artists, and market makers spend their days and nights thinking, building, talking about Ethereum because we are... excited. We're excited by the idea that Ethereum can change things. This May, we invited you to come learn what all the talk is about. We were joined by the leading teams in the ecosystem such as Polygon, Metamask, Aave, 1inch and Gnosis Chain who have a number of prizes up for grabs! This event is focused on building a new product/protocol, learning at the summits through talks and workshops, and giving opportunities to gain valuable feedback from ecosystem champions at the beautiful Convento do Beato. Find your future team at our Hacker Café and create even more meaningful connections while engaging with some of the most notable speakers in the industry at Pragma Lisbon. At ETHGlobal Lisbon you'll have the support of a huge community of experts, mentors, sponsors, developer advocates, and other community members who want to help you build something awesome. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Music] thanks for coming um it's good to see people who would like to win up to 20 000 US Dollars uh the second one so we have really nice bunches but first of all I would like to introduce who we are um why we are here and why you should built on top of one inch Network to to then tomorrow so Who We Are I am also a hacker back 2018 I started with my co-founder London book of to travel around the globe first second one was December 2018 I met with Alex buterin and I met a lot of other people and for now it's cool it's really cool I had already like 15 16 years of software engineering experience but never participate in hackathon and for now we can build this island over just tonight something which uh can win a prize and we can sort of pay for airplane tickets uh for hotels actually we almost never needed a hotel because we were staying always on a venue uh also when we build a one-inch first protocol back in 2019 in may we didn't sleep I didn't sleep 56 hours so it was quite hard but uh you see nowadays we have um a huge set of um protocols we started with the aggregation protocol then we have built liquidity protocol uh we came to our Dao our talking was large but the foundation back in 2020 we have built our self-custody wallets because we didn't find a proper wallet out there as the Minimus was really terrible and from one of you you know still there are issues with other Wallace that's why we just have different teams working on on the space to just not compete but improve and add value to the space um we have our limit our protocol is fully decentralized one based on the signature similar to zero X and other approaches but highly efficient visual use of refusion December last year we did hackathon over one month with our people in Dubai they got breakfast lunch and uh dinner Spa gym pool family could come so we just tried to to create such an environment which you emit here at DJs Global hackathon and it worked we were able to deliver in just one mouth diffusion and uh we were really happy about that nowadays we are also working on institutional products we try to enter the space of traditional finances and improve their settlements for example before swaps with our aggregation um like VR like three years old I would say the projects almost four years old the first year we just were working with Anton in the nights I was working for portion here for near protocol and one day we raise money so in total we raised like 190 million of US Dollars and uh continue to develop new products to ship new new Innovations we keep 70 percentage of the aggregation market share this Market we created actually on the hackathon we came to the idea how to uh make a swap more efficient by aggregating among these realistic changes and choose based on specific algorithm only those pools which makes sense to users degree to source so at the end the user get the best rate limit orders uh market share is about 80 percent there's just huge we achieved like in just one year uh from zero to to 80 or so on the market share and uh overtook 0x and other protocols we have four and a half minutes of wallets who are using one inch protocols it's not huge but at the end like you can see in the left corner they generate 330 billions of West dollars since 2019 and they have 180 actually more one at 80 core contributors around the blob uh like freelancer score full-time working on um on one inch Network um protocols so we see Dex volume continues to grow and it looks like we are we can overtake yeah uh centralized exchanges because uh this centralized exchanges are more efficient than centralized so you don't have to trust anyone you just interact with the smart contract you have no intermediaries except validators of course and this is Room to Grow for us all here uh who is developing web3 space but we have current limitation device space we have unfavorable swap rates we have meth attacks I first my like being really painful meth attack last year when ethereum dropped to 1000 I had because of tax reasons I had to sell my ethereum to buy again so to just declare loss in my tax report and I was front-run I lost 10 ethereum it was really painful for me so I could use this money just to to for my daughter or I can do like for charity or whatever but some some attackers got it so and I went to to our teams and I said like guys it doesn't work we need we need solution from this and then we came to the idea with the fusion I will explain a little bit later um and of course we have problem with three space that the user experience very complicated still very complicated we from our side we try to improve the wallet which we have really nice ux UI now we have this kind of meta transactions with Fusion uh it improves but still there's a lot of things to to to build to the problems um front running attacks so someone see a transaction into something before you extract value from this the math attacks are like if someone don't know how that works in terms like math someone is monitoring the um a mempool and analyze make it sense to exchange before you do to exchange after you to extract value from from your trade if you for example exchanging directly on uni swap um so someone is doing this and they make a lot of money back in 2022 they just earned one half billions of West dolls just by out of senior how we was gonna says nowadays so I just saw like around 10 percent yourself of of the transactions so uh and now you have two ways you have the thorny path with using daxes directly you don't get the best rates you don't know really where the liquid is concentrated um and you don't know where where the tokens listed and uh you may you face also the math attacks you faced here first running attacks um so this is not really efficient that's why people from outside we call it tourney pass uh like black forest you don't know what what can which animal can can attack you in the next time and we try to build the other other side yeah uh where we come to um to uh our Fusion and uh but but before I would like to explain once again about the aggregation itself maybe not it's not clear for everyone um I know some some people of you are very Advanced uh but some people still like just know that I can go to UNI Swap and just exchange there uh this more yeah we we came to the idea we found on two aggregate among the strollers exchanges and multiple equation sources right now we have on if you know more than 25 000 liquidity sources each smart contract with liquidities on liquid source so um at the beginning we just exchange on one market just for example ethereum to die but it makes no sense to just use one market plus if you exchange hundreds of thousands of US dollars maybe ten thousand of vegetables make sense to use all the other markets like UCT Market UCC Market uh if you do something else so in this case you see ethereum to see usdt this is a compound usdt uh actual Pathfinder our algorithm Pathfinder can also build a buff to just put ethereum into a usdt landing pool of compound for example so in this case we use market makers who also integrated in our aggregation protocol and and routine we have unusual we have sushi swap you see part part V extration to die but we exchange through usdc from UC we go to UCC and from diver also to UCC and then in the end the user get the best experience best best experience and best execution rate because we I actually did an Arbitrage just actually an Arbitrage algorithm which we uh are using um so Fusion this is new new approach uh how to exchange assets nowadays it works very well on ethereum since uh when you do the transaction by yourself if you do this transaction by yourself then the amount is higher than around 10 000 US Dollars someone will frontrun you some someone will sandwich you and you will lose um amount of money in normal cases like 50 bips what you lose and this is not how it should be and future solve this problem uh Fusion is based on our limit order protocol uh you just give a signature that you're okay to exchange one asset against another asset in a specific amount and you would like to exchange four specific rates not just for one specific rate like you if you do a normal limit order this uh is a kind of uh this is a specific grid we call it which use the current market liquidity because our algorithm our algorithm knows exactly how many tokens are where and which rates you get for which amounts for which pairs this way we can build such a nice grid and you see the price go going down from the current to Oracle price and goes down to the current market rate if you do Market swap so when you do Market swap you face a price impact so you get less than you have original it because liquidity uh it's not really huge and every decks need to earn something yeah use weapons like in different pools 30 beeps one beep five pip 100 beeps so um of course all algorithm can optimize this but yeah still still is kind of difficult um here to achieve the the best best execution so we we were thinking why not why why should we do a Dutch option um in linear we could just use discrete which comes directly from from the literally gym amount from from from the current Network so in this case someone exchanged this rule case 37 anti-firm to use DT and they got 2 345 bucks more compared to if they would just execute it by themselves uh theoretically we should she would face the math attack would get actually less and also if they wouldn't face their meth attack because they would use maybe RPC or Flash boards or our Rabbit Hole um our percent point which protects people as well from front running attacks and anyway this execution was better because we see these partial Fields you see here small partial filters are greens Green points arbitrust Traders when they see such Arbitrage opportunity they go and hatch on positional centralized exchanges they are exchangels with only liquidity um also the hatch view of other networks as well from some of you are buying a polygon like Matic token the potentially they will exchange it like hedge deposition might get trading in the reverse Direction and another Network where they see more liquidity and and come back to to ethereum to Arbitrage back um and actually we allow over time to sell specific amount of tokens by giving a chance to Arbiters really to Arbitrage this trade that's why it's it's better than just doing uh Market uh trade actually a market makers are selling uh tokens over weeks months and theoretically you can also set up with a custom mode you can set the order to sell it in maybe two days because you have a token it's not super liquid but there's some liquid on centralized exchanges and then if you set such order arbitrustrated try to switch up with Russia among these realized exchanges and different networks and also centralized exchanges um how did it worse under the woods it's very important to understand it is kind of Autobook um some people are switching like swapping in One Direction the other in the other direction if you don't use DC is a situ ethereum then our solvers who are able to settle the trades can match these orders that's why it's also sometimes very efficient to use all the fusion because they are also other people who would like to to exchange tokens maybe in the reverse Direction and um so the resolvers these are professional market makers um we have a special games Theory for economics we changed it recently also in December together with Fusion release you need to stick one-ish tokens to get unicorn power this unicorn Power Amp decrease in time based on the burning curve that means you have to maintain all the time to to to have almost one token to one unicorn power so and with this unicorn power you can become resolver or you can ask someone to dedicate the Unicorn power to you to be able to to to became top 10 resolver on on the top 10 resolver can execute DM uh the settlement so the settlement is done through smart contracts for this industrialized manner fully permission permissionless in terms of everyone can send their order but in permission manner the only specific resolvers who were selected by the community or had enough unicorn power they can settle the the trades and and we have these shunts to Arbitrage among centralized exchanges already said um this is realized exchanges also we've only created they are market makers like midtermute trading with only liquidity and providing better rates then you can get on Unison because they can hatch positions they can use options in the background to to to just kind of hatch so what is important the U.S user you just sign them like permit yeah do you send a message you send it in a network and you don't pay any gas uh with the execution of course there are some gas costs costs market makers resolvers need to execute it somehow on smaller amounts if you use Fusion you will just get a little bit less destination token for example if you're exchanging new if you need to use DC you would get just a little bit less usdc because the rate would be worser than if you execute by yourself but anyway you you get the same if you send your transaction a legacy mode by yourself you do the um this aggregation Thing by yourself you pay the gas costs yeah in ethereum and in a fusion mode resolver paste the gaskets and they're taken to account how much they pay and if it's profitable for them if it's not profitable of course no one will take it but we set the orders we have presets we set specific price ranges and the chance that it's executed very fastly so map protection has said already how that works how to integrate the fusion itself you have a nice SDK written JavaScript um I'm sorry if someone would like to contribute to right like to write a SDK in other languages you are welcome to ask for a grant we have a nice dial and 18 millions of West doors for those people who contribute to one inch Network you can write and fight them for example so how how to get a quads it's simple you use the SDK um there's a nice method get quote you form your request and you you get the quotes uh what is the current market rate Market Return of the token period on the amount you would like to exchange so it means you can just easily build your own UI which is maybe more user friendly than ours or you you bought a specific product it's just Fusion under the hood uh to maybe rebalance a bundle of assets or something so you can place a water it's also very very easy SDK with the proper endpoint Network um we have also nice documentation I will show you where to find it you can get all orders maybe you can build something what analyze oras or maybe uh filters towards based on specific criteria or you build an Explorer for for one-ish Network like if we use an Explorer it's also one thing what you you can get maybe a grant here and also you can apply maybe for rent at the dollar to to work on that maybe full time so you can scan the QR code you will get the documentation and um I have still a little bit time I would like to show you how it works and of course you can get in touch with us uh anytime we also share uh downstairs on the ground level we have a move you're welcome to come um also to get such ships like a little bit later distribute there are some money stops you so you can play around with the fusion mode and exchange it in fully gasless manner so I will show you how it works so we have here our uh one inch and I would like to use our one-ish wallets to connect so now I need to find the proper wallets a sec yeah this one and we can use one inch wallet connects so very easy connected and now I have some unit uni swap tokens which I would like to sell and I would maybe sell it to use the same so by default we have like legacy mode because on smaller amounts you can send the transaction by yourself pay for the gas costs uh and you will not face the meth attack because it's not profitable for the maps under under estimated 1000 bucks but anyway if you have no ethereum on your wallet you can still perform the trade because Union supports permit permit is just allowance signature which you give from your wallet and we will do it now so we have auto mode which is in three minutes the expression time is in three minutes so with the um which gets in which takes into account the gas cost for the Arbitrage for the resolvers the ibisource trainers so we ensure that that rate will be executed so I get him notification that I have to give a permission and now I have to sign this swap and you see here uh they have pending status we have expiration time uh we have three minutes something we give like 20 seconds for for people to sign because sometimes people are slow they need to use Ledger or other Hardware wallets so and it should be executed in next 30 seconds I'm pretty sure so you see you you will receive 500 at least 529 use usdc because gas costs right now are very expensive from ethereum of course we are supporting other networks so you can work with other networks we have arbitrum and uh and uh where you don't pay a lot of a lot of money so in meantime as long as in a pending process compared to legacy mode if you send the transaction by yourself anyway you have to wait sometimes if you use Market gas price you wait maybe 30 seconds until the transactions are included in the block so it's similar here um for smaller mods for bigger mods you have huge proof like huge benefits um by using Fusion already explained we have nice dock portal you can find you can find it here under more documentation and uh you get kind of deeper insights uh how this how it's set up how that works how to become become a resolver and we have also nice SDK repositorium you can you can also walk through all the examples real real examples there's some auction calculators and yeah and to to the bounties um to the bonuses so we have the first task where we say we would like to see someone to build on top of one is Fusion integrated how you want asset rebalancing mechanism um swap interface integrate one of your products which you already have built somewhere I don't care so um for me it's important that the fusion is integrated and used somewhere there it makes sense we have also this thing with with their resolvers which I explained oh now actually we were hearing this sound I didn't recognize we have this magic sound when it's filled so it's filled and we bought 549. West dollars and it was yeah it's a little bit broader than 595 because it wasn't profitable for anyone to take this Aura because they had to pay the gas costs yeah the money is not coming from nowhere someone need to pay in any time yeah but compared to what if you do it by yourself you you trade by yourself you pay anyway the guest costs so it's comfortable in the case also when you have no ethereum on your wallet um so to the second task we have our resolvers you can go to um you can stake one-ish tokens um you can lock up to two years uh we're flocking to you for by two years you get almost one to one one inch token to one unicorn power at a decrease in the time and then you can delegate to uh to the resolvers they're already some you can also create by your own some uh but you need to of course you need a lot of Delegation power so we have we have here top 10 and the top 10 they have 270 000 unicorn power delegated so 200 000 of initials you need theoretically but you can ask the community you can ask core contributors as well to delegate to you if you if you would like to participate here um you don't need really money you just need support from people um so we have this delegation and these people these companies who run the resolver they distribute the um kind of uh incentives for people who delegate to them so it makes more sense for me to delegate to someone uh just just like that yeah um here you see APR how much how many one-ish talkers this resolvers distribute and a based on gcpr most of the people delegate the the tokens to earn on that you can build something on top of this you can tokenize maybe these positions you can create maybe a pool that the thing is every time when I delegate and when I claim the tokens I need to pay gas and it's painful on if you know right now since the mem coins um so maybe a good solution would be to create a smart contract which is kind of pool everyone can participate uh you know like bring on one-ish tokens this contract can stake and Delegate for specific resolver and also move to delegation based on the APR and also claim rewards and distribute rewards for those who participate so this could be a one one of cool ideas what you can build here and we have really nice prices so for the for the fusion integration for the first place you can get four thousand West doors it's a lot back to my times I I was lucky to get um if on ethereum New York I got on 350 bucks to be able to pay the airplane ticket to Stuttgart back so and when you have built one inch um but nowadays yeah it's really nice to see that all the other projects are offer offer nice um nice bunches uh which you can really easily earn by just not sleeping two days uh yeah an open track just come with what you think uh I can get give you some um give I can give you some example I'm running out of time um we are working on P2P network uh pgp not the network for storing um uh industrialized Mana limit orders like mesh network uh and fusion auras and if you if you build something like this on hackathon Originals I would appreciate and you can see a nice nice Bounty for two to one two thousand five hundred US Dollars thank you very much if you have any questions I will stay outside and yeah we have here both you can also come to our booth and speak with us as well thank you very much it was pleasure foreign

Automatic transcript — names and jargon may be misspelled.