The future of DeFi: Intens

ETHCC 7 · 8 Jul 2024 · 17:43

Sergej Kunz, co-founder of 1inch, argues that intents are the future of DeFi, partly to protect users from MEV. He contrasts regular transactions, which are public in the mempool, with intents where users declare what they want and professional executors fulfil it. He recounts losing about 10 ETH to an MEV attack and traces intent-based limit orders and swaps, including 1inch Fusion. He explains its Dutch auction, which he says follows market liquidity, and Fusion 2, which accounts for gas costs so orders can settle. He also mentions cross-chain swaps and an RPC API for developers.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

So hi everyone. One, two? Hi everyone. My name is Sergei Kunz. I'm co-founder of OneInch, and I would like to speak today about intents, the future of TFI. But before we start, I have uh some questions to you so to understand. Uh are you familiar with uh MEV? Who is familiar with MEV? Nice. So who was uh once a victim of uh MEV attack? Also a lot of people, right?

So uh that's why I I am and my team, we uh uh changed our approach in One Inch and introduce a new product, and I'm gonna speak why we should continue to build intent-based protocols to avoid especially this scenarios where uh malicious players attack uh users in DeFi space and extract value. What are intents? Intents are planned actions, aim to achieve T-shirt goals. Intent-based architecture is a way to design and use DeFi that focus on what user want to achieve rather than on how they achieve it.

So if you look on a regular transaction, like on a blockchain, that's Ethereum, for example. Um, you need to sign new transaction. You need to create the transaction, and use you need to sign, you need to send it to the blockchain, and you need to pay for it. So of course you can interact with smart contracts, um, and you do you can do swaps, you can do transfers. But um with this approach, you take the risk that uh you need to you you've um yeah, you you you take the risks uh to be uh um being um abused by uh malicious actors because your transaction is uh public, it's visible in the mempool. So it can be attacked.

Uh intent-based um intent intents can be a multi-step operation operations uh based on conditions. Uh you can uh build very very complex intents, build complex uh strategies. Um yes, you share your intents. It's also kind of in the mempool, depends on the infrastructure, but uh you don't execute um the intents by yourself, you just declare what you want. And someone who is highly professional in execution is doing that.

So here once again on the traditional DeFi approach, you you go to one of um um of for example, if you want to swap, you find the exchange, uniswap or sushi swap, or even you can go to one inch. You select what you want, what what you what you want to sell, and then you need to like create the transaction, sign your transaction, send it, and you actually managing the how, yeah, how it's gonna be executed. Like you are looking maybe for the exchange with the right liquidity if you're not using uh aggregator.

Um, and intent-based intent-based approach, you take care about uh how um what um you you're taking care about what you want. You want to sell one asset against another, you just declare it and you share it with the uh uh professional executors. So once again you have uh huge benefits of intents, you can um create optimized uh strategies, uh highly complex strategies, you can have multi-step interactions uh where you just declare it, you sign it with your wallet, and you share it with the professional executors and can be executed then uh based also like a cron job, like in in time as well. So almost everything is possible here uh in uh uh intent-based approach.

What we have right now on the market, we have limitors, we have swaps, uh liquidity providing theoretically would be possible, but no one somehow is doing that. So if you provide liquidity uniswap, you can be front front. I personally was front front by providing um liquidity in Uniswap. I recognized that someone provided a lot of liquidity before me, uh moved the the price a little bit, and after my transaction was included, after the my transaction, another transaction was executed, where uh the uh uh profit for the uh for the attacker was extracted, so I lost uh I guess multiple Ethereums, it was really painful. Um we have also intents in terms of cross-chain.

There are already some startups who are building intent-based cross-chain swaps. So um limit orders, um, maybe short overview. Uh limit orders are already since uh I guess 2018, 2017. Zero X introduced um intent-based limit orders, uh, VS One inch. We came also uh I guess 21. Uh we are now dominating the uh market. We have 85% of market share.

We have we see Uniswap if limit orders and cow swap. We uh have also swaps. So CalSwap came uh with the with the kind of intent-based uh swap approach. Um with a settlement done by the team but uh using resolvers who provide the call data, and they select who who provides the the best execution for the user. Then we came with our um uh one-inch fusion swap uh in um with approach of a Dutch auction to ensure the and maintain the decentralization and independent independently uh settlement uh on the blockchain.

Uh Uniswap came with the Uniswap X, also based on the Dutch auction recently, and uh also Zero X is doing a little bit intent-based uh swaps uh by executing by themselves, so paying gas costs for the user. So one inch fusion looks like that. So it's a little bit more complex than uh just a simple swap in theory, but in practice it's uh highly simple based on limit aura. Uh it's just um highly efficient technology based on smart contracts. We are users sign aura, the aura is off-chain.

It's shared uh off-chain with the market makers and resolvers. We call them resolvers. You see, we have um uh presentation somehow doesn't work properly here. So you see here um we have um we have retail, like customers, we have institutional customers who are using it, we have um uh a lot of security audits, we have IML screening in place uh for users uh and also resolvers as well. If resolver gets dirty money, uh it is automatically blocked.

Uh we have multiple networks, what we support, and you see also here little Easter egg. Uh we allow it to swap uh here, like here on the picture. You can see Ethereum to uh ZK Sync swap. It's also something what I'm gonna explain. Um in the next slides. So you see market makers who are bridging liquidity from um different um uh different um liquidity sources, also centralized exchanges. So if you create a swap on one inch, you get executed by a professional market maker who hedged the position on centralized exchange and bridge the liquidity afterwards.

Some of them even uh take a loan from AVE, fill you aura and rebalance afterwards. So Dutch auction, um, very important to understand, um, we wanted to maintain the decentralization, um, and also independent execution and settlement on a on a blockchain. So no one is um depending on us or someone else. Yeah. So the auction is based um not on linear function, it's not like linear from market rate to um uh uh from spot price to market rate, we use the market liquidity. So the theory is like we think uh the when we sell in time in 10 minutes, then first we can sell actually in the first minutes a little bit for a better rate.

So almost the spot price, what you what we see on market cap and uh CoinGecko. And but if we sell everything at once, it's like market rate, like classic swap we call it as well. So if you just go and just through aggregator um uh you do transaction and swap everything on multiple liquidity sources, you would get the uh uh the market price in the middle, you see. Spot prices at the top, and you see we try to sell it in time, and you see we get partial fills. So that means the market makers they see, oh, someone is selling if like Ethereum, for example, for USDC, and the price the prices uh it's good for the market maker because they can hedge on centralized exchange, um sell Ethereum there, buy from the user, and rebalance afterwards.

So, and you see uh our curve is uh walking through the current liquidity on the market. If you sell the half, you would have better better rate than if you sell everything. Yeah, and if you sell a little bit, like maybe two percentages, you you get really good price because there's uh enough liquidity on chain. And the new thing what we introduced with fusion two, we take into account the gas execution cost. The problem with the Dutch auction, you need to uh create uh price points, and the curve walk to the price points with a linear interpolation, what we have seen here. Yeah, but the problem is the gas price it goes up, it goes down, and sometimes execution cannot be um settled, like the order cannot be settled because the um uh gas execution costs went up.

Yeah, so that means no one no one will take this order because it's not profitable for the market maker at all. That's why we introduced also the stick the taking to account the uh gas execution costs. It also helps also for them better better and faster settlement. Our orders are mostly executed just after the creation of their order itself. So um math attacks. Uh a lot of money was stolen from people, and um I I found funny when I have seen the last story about uh math attacker of math attackers. These two guys are going well, I guess, in prison because they stole like they did math attack on math attackers.

And yeah, in general, I would say like every math attacker should face um like legal legal um penalties in terms of because they abuse the system and try to extract value. So uh I'm uh I faced this problem um a couple of years ago, and I was highly angry that someone just stole 10 Ethereum from me. It was really painful for me because I could use this money for my daughter uh for the better school or whatever. Um it's it's actually a lot of money. And I thought like it cannot be like that.

We cannot trust someone that someone not is not doing that, like in the traditional finance. Traditional finance, someone came and say, okay, you're you're not allowed to do um spoofing. Yeah, you you're not allowed. And you should not do it. But some do it, some people are doing this, taking risk into account and earn money and potentially not face any charges. But we we are from tech. I'm personally I'm software engineer, and uh I try to solve uh problems by design. And we solve math um uh we integrated math uh protection by design by using intent-based uh protocol.

So uh you you you have to think about uh the math because this it's not possible, just not possible by design. Uh the really nice future uh what we have also is gas less execution. You just sign a off-chain uh message, like intent, you share it, and you don't pay the gas execution. The guess execution is potentially included in the in the rate. Because market makers only execute or professional arbitrager execute only if it's profitable for them. So how also said uh liquidity is uh cross cross-chain, cross uh platform uh through market makers.

They they actually fulfill the uh functionality of uh bridging. So the future is also cross-chain uh numbers uh should be up to date from from this month. So we have a lot of liquidity on Ethereum, but we have also liquidity on layer twos, we have also binaries smart chain, and we have uh uh other blockchains as well. Um it's very important to have cross-chain swaps since the liquidity is distributed, and uh you cannot just perform 10,000 Ethereum sell market aura on um uh on on Ethereum um and drop the price on the Ethereum and you get arbitrage uh you you lose a lot of money theoretically, yeah. So uh that's why we should go also cross-chain and um also intent-based cross-chains.

And we are from one inch, we introduce one inch atomic swaps uh very very soon uh to uh fill the gap to introduce um really cross-chain swaps where you get the best execution on a mark cross-market, cross-platform by using our market makers uh who bridge uh the whole liquidity and uh offer the possibility for the user to do a simple cross-chain. And in general, the future uh of DeFi is intent-based, so we improve the user experience. So if you look on uh like you create the transaction, you pay for the transaction, you may potentially need to uh give enough um kind of um payment for the gas execution.

Uh as a user, you should not care about that. Yeah, you you you should come set the order and forget about that and should be executed immediately. This is the user experience we need for the mass adoption. I have one more thing. Uh one small uh alpha leak from today. Uh we are happy to introduce a new API in our dev portal. Um inch web3 RPC. So developers can uh or also companies who consume Web3 APIs can easily uh consume our APIs to uh perform any uh web3 calls to the blockchain nodes. We have a lot of services, we do a lot of requests, and we thought we we can offer it to everyone.

So don't waste your time to run all nodes, you can just use our APIs. Let's uh connect. Um we are here also with our booth, and we are happy to uh see you on the booth, and we distributing small one-inch airdrops, so such uh small uh coins with QR codes, uh so you can play around with all our one-inch network and our swaps. Thank you very much. It was a pleasure, you can see that we can use the

Related talks