1inch, the RabbitHole
ETH Vietnam 2022 · November 2022 · 15:35
Sergej Kunz, co-founder of the 1inch Network, gives a keynote titled 1inch, the RabbitHole. He presents the 1inch decentralized exchange aggregator and where it is going in DeFi trading. Recorded at ETH Vietnam 2022. It is a keynote of about fifteen minutes.
Speakers
Topics
From ETH Vietnam 2022, hosted by ETH Vietnam.
Transcript
one one hi everyone [Music] thanks so um it's a pleasure to stay here on the stage my name is Sergey I'm co-founder of one inch network if you don't know what one issue network is I will explain shortly one Niche network is a set of protocols which offers different services in D5 space originally and my co-founder Anton we came to an idea of aggregation among decentralized exchanges liquidity sources or just on the
hackathon back in 2019 over two sleepless nights we have built uh a solution just for us because we didn't find a solution like a service where we can just Exchange in one single place on multiple liquid sources to to achieve the best best execution best rates um it makes sense to to to exchange multiple liquid sources by splitting in small small amounts the original talking about you you change to to achieve the best execution because the the liquidity is distributed so this is kind of original idea of one inch and we extended it with uh liquidity protocol destroys Autobook protocol and
some other stuff and now um I'm gonna talk about um how the aggregation Works shortly which problems we have right now in D5 which attacks this year every day in a bigger swap transactions and how we from one inch solve this problem yeah so um the rabbit hole let's go okay it should be a video actually now yeah so um so agenda once again deck segregation
against single decks taxes uh actually we are not just Tech segregator uh different liquidity sources also Mark makers who offer RFQ borders um we are able to work with other and compound so for example if you have if you'd like to deposit a cusdc for example in compound we do the magic another Hood exchanging ethereum to use the C and depositing to other for you it's also possible I'm going to talk about the front running attacks uh the other threads in D5 and our Rabbit Hole solution what to which we can so
um what what is the next segregation uh we see on the market uh different liquidity sources each of the liquids The Source has uh different prices of course we they are Arbiters traders who Arbitrage and balance the liquidity sources but they are sometimes not efficient and not fast enough and they work actually for their own profits so and so the thing is we have different um kind of liquidity depth different markets which can be used to to have a best execution it's kind of a best price
this line you see this is kind of best price we take the better quotes from different liquid sources and less good quotes from maybe a bigger bigger liquidity sources like uni swap um and in the end we achieved the best execution on the market uh and this is actually just Arbitrage uh before one inch uh I don't know we were working on habits trash Bots uh figuring out how that works and uh which problems um you have normally as Arbiters Trader and we came to the idea why not to offer everyone to game and arbitrust Trader one swap on the aggregator is just
arbitration after the swap there's not normally no Arbitrage of change at all so this is how it looks like at the beginning we came to the idea just to speed among one market so for example The Exchange just say one inch to die just on on the on the markets on the liquidity pools of these two tokens and a little bit later we came to the idea why not also try to Arbitrage different markets more markets yeah for example we can exchange here one is talking to wbtc by using our liquidity protocol from one
inch to use DC to WTH by using unit swap to 80 percentages and 20 percentages of Pride markets maker and then we can go further and use wh to swap to use DT use DC to swap to BNT wbtc to UC by using multiple liquid resources again and and at the end we exchange everything to die collected and the user get the best execution um theoretically we could do that also in centralized exchanges sterility on stock markets but it's not efficient so the problem with centralized exchanges you have not Atomic execution so it's not possible to revert something if
someone front-run you or just quote change in a specific exchange and on ethereum or ethereum likes blockchains we have Atomic execution so we can ensure if something goes wrong if one of these pipes are called pipes for example One issues dcbnt and diet doesn't work because the prices changed some someone front-run us or yeah yeah something happens uh maybe with the protocol itself it was stopped or something we can just disable this pipeline revert the part of the transaction and the user will will exchange only part of the of the
Hallmark plan to exchange this is kind of automatic what we have right now on one inch regarding the um the the aggregation we are also very gas efficient um we recently we released the root root of B5 it is six percentages more efficient than the previous version and this 14 percentages more efficient than everything else out there yeah who try to compete with us also like unusual product for example if you go to Unison router it's 14 percentages more expensive than just using one Edge um and
there are some other projects who try also to Aggregate and based on our analytics we are up to 26 percentages better on the gas execution we have kind of our own magic and smart contracts we have really great Engineers like Michelle and Michael founder Anton they highly optimized the execution layer to achieve these cool results so um and to see attacks against tax users or IFI users which is our front running attacks so um before
when the user swap on for example uni swap yeah in the settings you see the price slippage settings so you can't say okay I'm okay when I exchange one thousand dollar I'm okay to get 50 bips less 0.5 percent they're just less because this is this is how it works on on the access its Atomic execution and who is fast who is faster they they get the the best execution so and um when they use a senate transaction to the mempool there are Bad actors I call them hackers because they actually what they do they just hack to people they
exchange before the user exchange and exchange after the the user execution so actually there for example they buy before the user and sell after the user and this is this is a huge problem this is how it looks like attackers by on the cheaper price maybe you 0.59 percent adjustment maybe 0.5 or 50 bips then the transaction from the user is executed and after that the user added the attacker sells on on better better
rate and take the profit we call it sandwich after flash boss technology was released and validated like minors and now validators started to to implement that a lot of a lot of attackers using this service they just take huge transaction put on transaction on it pay a little bit more to the to the to the miner or to the validator and and and and benefits from it a lot so based on our analytics we have like five five men team in analytics uh the calculated and we found out that more
than 800 million dollars were lost you the front running attacks in just 2022. just huge it's actually everyone who is exchanging on dexas um above specific minimal return amount getting attacked by such bad actors yeah um and how we are going to protect this um he came to your idea why not to use the flashpoints normally flash flashbots is just a library um of course they have also kind of an rpcn point but it's not super user friendly and there are also other
providers um uh what's less what's this doing is actually uh they um they offer a piece of software which the validator produce the miners can install and earn additionally by offering such a service like a private mempo so this transaction which are shared with this service are not shared with anyone else so there's no possibility for attacker to get access to this private main pool and to attack TP users of course if someone would say a validator can front-funded people maybe it's happening it could be could be but I guess if for example Lido
would front-run someone then they would very fast gets a huge storm I'm pretty sure and would get uh yeah less less people in the community or maybe not not people more in the community of course this little bit for us yeah and such Services better would be of course everyone run or not and and ensure the network by having full decentralization so um if the flashbacks there are some limitations uh already said uh it's not user friendly um they they don't explain anyone how that works and before one inch we
thought why not to um uh just make a user-friendly product by aggregating different providers not just flashbacks they're also blocks route there are some other um other uh kind of services and on top of this we introduce all algorithm which route based on the transaction itself so we have a tracer fully deep and analyzing system which understands what's happening in the trade and um based on on the results it sends to to the mempool if it makes no sense to front run such a transaction or it sends
directly to the to the service providers yeah not every service provider is for free some of them they are very expensive and uh for the use of it's for free for now for a specific period of time and later we will potentially introduce maybe something like you have to stake Manish tokens and and then you are able to use such a service so um and you of course it is built like uh just an RPC endpoint it's just a world which you have to set as additional Network in uh for example mirror Mask metamask doesn't support um assigning transactions that's why it was previously not possible for us to use
this technology um for to protect the trades actually we have this technology since like from the beginning of flashbots uh the problem was with miramas did they actually they don't allow uh to send transactions and they don't allow to send it before sending to the RPC endpoint that's why we came to the idea just why not to offer additional RPC endpoint um of course you have to trust us uh that we are not doing some some something uh wrong um but we proved to us more multiple times that um also our aggregation promotional service for there for the swaps that did the API services are used by a lot of uh big players as well
um and we proved that you can't trust us but you don't have to trust you you can you can verify by um by before you before you send you can verify what you suppose what you said yeah and it's not getting worse than now you have it on another um Texas uh and and other projects um so yeah this is this is um um what we came to uh previously and uh recently and would like to have um first testing group so you can write to us uh you can get access to to them to their RPC endpoint and and play around with it and
uh protect you your swaps from Sandwich attacks uh we have Twitter we have Discord we have uh telegram you can go on GitHub check out our smart contracts if you're a hacker uh also shiona hackathon your you can build on top of vanish Network we have good boundaries yeah thank you very much