Usurping Binance Once And For All
EthPrague 2024 · 1 Jun 2024 · 29:47
At EthPrague 2024, kassandra.eth of Arrakis argues that decentralized exchanges are at a crossroads and need to be rethought from first principles if onchain spot trading is to rival centralized venues such as Binance. The talk compares centralized exchanges, AMMs and newer hybrid exchanges, and introduces the HOT AMM (hybrid order types), a design built with Valantis Labs. It closes on the wider design space for liquidity pools, from dynamic fees to in-protocol auctions.
Speakers
Topics
From EthPrague 2024, hosted by ETHPrague.
Holešovice Market
Transcript
[Music] all right so our next speaker is founder and CTO of arus solving lever in the deck space so let's give a round of applause for [Applause] Cassandra all right hey everybody uh I'm cassandra. eth online this this girl um and uh this talk today is called usurping binance the next phase of Dex Evolution uh we're going to get to an alternate title as well but I think um what I really want to frame for you guys
today is um the way that decentralized exchanges are um moving into a new paradigm are accelerating the way that they're changing and hopefully these changes and decentralized exchanges will allow us to compete with centralized players uh in a new way so um yeah if I'm going to get anything across to you in this talk today uh it's this idea which is that I believe we're um for those of you I mean how many people here have heard of Unis swap V3 and concentrated liquidity just to see where we're at okay good amount um and Unis swap in general Unis swap V2 yeah most people yeah okay great well I believe
that uh decentralized Exchange we've come a long way right decentralized exchanges is a really New Concept um and uh with with the Advent of protocols like Unis swap uniswap V2 we saw an explosion of of of usage on these on this new paradigm uh and this was really exciting for all of crypto and I think it sort of solidified our mental models about how we think decentralized exchanges work so we really believed that this x * yal k automated Market maker was like this new Revolution and it and it was and it's super exciting but I think that things are really changing rapidly on the onchain spot trading space uh I think both um the
twin paradigms right because decentralized exchanges are a uh they're a two-sided marketplace right they have liquidity providers and they have swappers um I think on both sides we've asked some really really hard questions of on the liquidity provider side does an algorithm like just a constant function actually work and and a and a constant swap fee actually work for liquidity providers at scale and I think a lot of hard questions have been asked of of this amm Paradigm on that side on the other side does normal users them encoding a swap payload and just putting that in the public M poool of ethereum does this actually work for Traders and
I think many hard questions have been asked there so there was this incredible explosion of excitement around um around the amm and then I think the last few years have been this constant question asking and we're on the precipice of sort of starting again from the ground up so if I get across anything to you today it should be the idea that I believe decentralized exchanges are at this Crossroads we're at a paradigm shifting moment and we need to start again thinking about from first principles how can we build the best onchain spot trading experience that can rival uh uh rival the experience you have on on centralized venues so uh and
I think there's a really bright fure ahead of us things like Unis swap V4 um very exciting new developments which allow us to crack open and explore this design space a lot okay so this alternate title here and what I really want to tell you about today tell you about something new what we're doing at arus so yeah I I work at arus it's a um a protocol built on top of decentralized exchanges for um for uh automating uh for trustless Market making on on top of decentralized exchanges so uh we've been doing a lot of research and um we're really excited about all these possible changes in the Dex design space and our first contribution of something a a different style of amm a different idea
for how you could approach the amm is something we're calling the hot amm or hot hot stands for hybrid order types and the idea is we wanted to create a an a design for amm that was M aware um that allowed us to compete in this in this new world this new landscape that is rapidly emerging of of onchain trading that we're going to talk about today so you're also going to hear a good amount about uh this new design it's something that we at arus we built in collaboration with valantis Labs they're also a uh they're creating a new decentralized exchange protocol on top of eum and other evm chains so let's take a step back and look at like how do people trade crypto
assets and and why are we trading on chain and uh so people want to trade one crypto asset to another right this is why we have spot trading and we have these different venues that we might be able to do this you have centralized exchanges right you can trade on a centralized exchange you can trade on a decentralized exchange like an amm um and what people probably know as much about is that there are also these sort of this new class of uh exchange protocols emerging which we're going to call hybrid exchanges here um so so what is a centralized exchange what's a decentralized exchange so uh we have some sort of different features of these things uh that we organized a bit here
and the idea is that well on a centralized exchange everything is centralized you put your funds into some uh into some Omnibus wallet basically all the funds are custodi by the centralized exchange and both making and taking right both swapping and being a liquidity provider is entirely centralized you have sort of central actors like hedge funds and so on being uh playing doing Market Mak and doing high frequency Market making algorithms you have people going on there and wanting to swap but everybody is trusting the centralized exchange to facilitate uh you know uh facilitate all of this exchange and allow people to place these maker orders these taker orders um so everything's happening offchain you have an offchain Central
littleit order book and uh everything centralized on what this new paradigm we're talking about today right this amm what you have is this onchain liquidity pool everybody has custody of their funds they only ever put their funds into a smart contract that works with very specific rules and so you actually have fully decentralized making and fully decentralized taking and this was we already said it's like an explosive concept it allowed bootstrapping of a market formation on longtail assets in a way that was simply not possible at all before in crypto all kinds of composability benefits as well so this was really exciting um however there are some issues with uh with trading on these amm that we're going to get into
and one of them is that uh getting the best price one of the easiest ones to understand is that swappers were not as routinely getting as competitive prices as they were on uh these centralized venues uh on a centralized exchange so if you wanted to trade uh you want to trade on chain it was super convenient super composable all different protocols could could tap into this amm liquidity but pricing for the Trader wasn't so great and what we have in the Middle with these hybrid exchanges with the rise of intent-based trading is you have this idea that you can still have a totally decentralized swapping experience where you on chain are simply going to uh your assets are only going
to move out of your wallet based on things that you define and uh you never have to allow these assets to be custodi by some Central platform like a centralized exchange so you as a Trader get a similar experience maybe slightly different because you're not encoding a swap in the M poool you're not um you're not encoding a raw payload to hit uh to hit a smart contract instead you're maybe uh just signing a a certain uh a certain struct and uh you're going to use this offchain signature that you give for your assets and maybe an approval to a Smart contract to work out how your trade will actually get settled and so the interesting thing is these
hybrid exchanges you can think of them as these private market makers like wintermute who are facilitating trade on chain for instance you can also think about things like maybe something like uh dydx might fit in this hybrid world um but basically in the end what you have often is you have a centralized maker you have uh Central parties like solvers or like a like a hedge fund like a uh financial institution like a wintermute being the one who's actually going to figure out how to facilitate your trade from one asset to another or be the counterparty for your trade themselves with their own assets and so you still have centralized making but you retain this decentralized taking and the idea was
if you work in this way you can get around some of the difficult problems of trying to have a very simple truly automated Market maker where the pricing of your swaps is entirely defined on chain instead now you can have these def sophisticated parties giving you very up-to-date pricing you sort of get rid of this beautiful dream of a fully decentralized two-sided Marketplace um however the Traders still have this uh very decentralized experience they can simply swap on chain they can sign stuff from their wallet they get their swaps in and now they're getting way better pricing and so there's a large growth of these hybrid exchanges and we at araus who worry about onchain liquidity providers and helping liquidity
providers onchain sort of uh realize their goals uh are noticing this trend and are are basically wondering about what's going to happen if more and more trading on the swapper side goes through these intent-based systems what will happen to the retail LPS to the onchain LPS sitting in liquidity pools if all of the flow all of the good flow coming from normal swaps uh not toxic flow which is just an Arbitrage to try to equilibri the markets actually gets captured by these uh these much more efficient players these centralized makers who have now come on chain themselves they're not just making on centralized exchanges but they're actually making on chain in the
sort of intent-based uh world and so our response to this to this new chain and how we can try to retain uh allow retail LPS to compete against this this new form here is what we're calling the hot amm and we're basically trying to bring together some of the great properties you have with amm and also the really nice properties you have with this new sort of hybrid model uh and bring them together to allow you know all sort of longtail of people who have assets who want to provide liquidity on chain who want to help facilitate uh trading and make the market um that they can do this in a way where they can compete for this intent-based order flow as well against
these um these centralized Market making actors uh cool so just for a second uh yeah I maybe I'm even going to I'm going too slow so I'm going to skip this slide uh quickly let's look at the evolution of automated Market making and automated market makers so we started as we said with this really beautiful um exciting dream but then now we've asked a lot of questions about which is this constant function Market maker this constant product amm like a Unis swap where simply uh liquidity providers provide liquidity to the to the uh decentralized exchange smart contract and they provide this uniform liquidity wherein there's a
certain pricing rule as Traders trade against the smart contract this rule is just that you have to preserve this quantity k so however much of asset X is in the pool and however much of access Y is in the pool if you multiply these two amounts they should always equal K and so this creates a pricing rule as Traders trade against the smart contract the price automatically updates and you as a maker you don't decide the price the smart contract decides the price for you you take some swap fees it's super cool um however uh there were some major inefficiencies on the liquidity providing side that uh brought us to uh a new paradigm the next idea which was to take how can we make amm more efficient because one issue that this
had was that people were providing liquidity uniformly from the price zero to Infinity well many assets only trade in a much smaller band and so you had a capital efficiency problem where you were you were leaving capital in places to preserved for prices that you're never going to explore um so then we came with the idea of concentrated liquidity this is the idea that people can basically we we we quantize this x * yal K rule into a bunch of of buckets and we allow people to provide liquidity into into different ranges um you can decide as a liquidity provider what range you want to uh what range you want your assets to be traded against and once you get out of that range you're
entirely in one asset or the other many of you said you've already heard of univ V3 so I won't waste too much time just explaining the basics of concentrated liquidity but the interesting idea here was that um liquidity providers got more choices got more expressibility in the amm it became more comp Lex for them to provide liquidity this is sort of the birth of our araus project is the idea that now you as a liquidity provider you're not all the same you're not all just providing the same uniform liquidity you CH select this price range you want to provide liquidity at and you might want to adjust this price range as your uh thesis around the uh asset pair changes and so araus is basically a trustless protocol to try to uh allows third parties to delegate the management
of these ranges to us so that we can help optimize uh what which bands you're providing your assets to the to the market at um on your behalf um so it added new complexity but it added a an order of magnitude more efficiency to these markets which allowed these markets to have better pricing again what's the goal here we want to compete with binance with centralized exchanges which offer really great pricing for Traders the issue with this uniform liquidity is that you swap a little bit and the price might move really far and with concentrated liquidity if if uh liquidity providers are uh are you know estimating where where the price action will actually be well and they Bunch that liquidity around those prices then
all of a sudden uh people can trade a lot more volume without creating so much price impact without moving prices to weird places which then mean that the amm is quoting you know suboptimally in comparison to these other venues and most importantly I think we're on the precipice of uh of a tremendous various forms of all kinds of new amm designs so uh you know the the example that's being used here A bunch Unis swap they had uniswap V2 which is this first thing Unis swap V3 which is this next example and Unis swap V4 is sort of an unopinionated platform that allows uh all uh all kinds of amm designers to uh Implement custom logic into these
liquidity pools and we're going to see all kinds of variety in terms of onchain liquidity pools where people add liquidity these pools uh how the pricing of this liquidity Pool Works how the automated um the idea is that the smart contract automatically figures out the pricing on behalf of these LPS who are simply uh providing assets to the market and we're going to see a tremendous amount of new designs which is really exciting so why did we change from one to the next well in the from the constant product amm to the concentrated liquidity amm we moved because we wanted to increase Capital efficiency we we just wanted to say okay this constant product amm something works about it everybody's using it but it's extremely
capital and efficient um uh all the LPS are the same this is really cool but it but we just want to be able to to lower the price impact to make these markets um be more efficient especially markets that maybe only trade in a very small band the next big question that's been asked of these concentrated liquidity amm over the last couple years is is this a good deal for liquidity providers are liquidity providers actually profitable since you are providing liquidity at prices that you don't control but a smart contract controls it and you have all these sort of taker actors who are there looking to exploit this pool whenever the pricing is wrong what they want to do is they want to
Simply trade against your pool and then offload their trade on another venue to take a risk-free profit and it turns out that this is a very big issue for liquidity providers and so the idea I think with um with what what these new modular deck is all this explosion of innovation around new liquidity pool types is going to do is it's going to um allow us to try to solve some of these problems one of the main ways that this problem has been formulated for LPS is the loss versus rebalancing problem it's it's uh it's just the theoretical framework for how we can understand whether LPS are really being profitable in expectation or not and whether the amm has uh competitive pricing in comparison to other venues and um so
this is a major problem the way that we can solve it is by innovating how these uh automatically automatically determined price market makers uh actually function and add more interesting logic to uh more interesting logic and designs to these amm to to to make them compete against these much more low-latent actors who can simply decide what price they want to give at any given moment and thus have a much more favorable pricing both for their LPS and for Traders cool so the last really big thing like we said is that there's this rise of this intent based flow so this chart comes from uh Illuminating the order flow from flash Bots it's super
interesting um you check out that article by the way um but what you have here is uh on the on the left on the edge here you have these three protocols which are like basically the three biggest protocols for intent-based trading these are this new design for these high hybrid exchanges right where basically you as a Trader simply sign an intent and you let Central parties figure out how they're going to route your intent to trade through some different venues whether it's a bunch of uh liquidity pools whether it's amm or whether it might be some of these private market makers who simply give out offchain quotes that settle on chain and try to get you the best price and so
this is really cool um Traders are getting way better pricing now but we're seeing this major Evolution and the growth of these private market makers who are doing sort of oldfashioned centralized Market making taking a much larger market share of the onchain trading so this is what this is one of these e this Evolution this this change that's occurring right now in onchain trading that's super important so you can see that Unis swap V3 and note that this is only the intent-based volume and the thing about the intent-based volume is you know that this is coming from real Traders not arbitragers who who want to just equilibri who want to change the price of your Unis swap pool just to take a risk-free profit this isn't toxic Arbitrage this is all the
good flow this is the flow that you want from retail Traders and more and more of this good flow is being eaten by actors like wintermute SCP Etc these these actors which are um have their own assets and simply give offchain quotes to say hey I'll I'll let you trade at this price and then these solver actors in the middle can take these user intents and and fulfill them through any any onchain venue including some of these private market makers so these RFQ systems are growing in relevance onchain and it's hurting the uh amm liquidity provider who is increasingly being left with just toxic order flow and getting less and less of of the good order flow partially because it can't compete on
pricing with these other venues so finally and I only have like five minutes here so I'll do it really fast what are we building at araus to deal with this problem well the the the our first approach to try to deal with uh to try to help retail LPS compete with these RFQ systems with these private market makers in in uh in capturing this intent-based flow is what we're calling hot amm this is the hybrid order type amm and the idea is to do a couple of things we want to help protect the amm LPS from the toxic Arbitrage that hits amm because since amm only move with volume the only way for the price to
change is for some Trader to come and move the price and sometimes Traders just move the price for you from a very off price to the real world price and they take a risk-free profit for doing so so we want to protect LPS from all this toxic flow um we also want to still have a design that's truly a decentralized exchange truly an amm that's Fully live it if offchain components of this design were to all just go Kut you'd still have a functioning amm where anybody can permissionless try to swap against it and LPS can add their liquidity Etc and then what we add to the amm what we've created with hot amm is sort of an amm that's both an amm or sorry a smart
contract a liquidity pool which is both a classical amm and also an RFQ system in one so we also have this offchain quoting service which people can use to Simply ask to get a quote or RFQ type system and then they can execute this quote against the same liquidity pool that is that is the amm but this quote is guaranteed the price that they're getting is exactly the price that's inside the quote so it's basically one of these private Market maker contracts and a permissionless amm in one and the idea is we want to make these two systems work together so we want to make it so that this quoting service when we can give offchain quotes to certain actors and allow them to
execute against our our pool reserves this should somehow benefit the other side the other door of this amm which is the permissionless uh swappers right so we want to make it so that this should help update the pricing of our amm to be more competitive and uh and I'll explain how this works in a moment so the idea is we basically have two swap types there are two doors to how you might swap against this new hot amm liquidity pool one door is the classic one you simply directly uh encode a swap payload you put that in the me pool and then uh based on the price that the uh that the amm is at You're simply going to move
the price with your volume in the same way that a Unis swap V3 Pool Works um so classical amm swaps entirely permissionless to do this however there is another door now which is optimized for this intent-based trading flow so let's say um some solver is solving the cow swap auction and they have a bunch of retail flow that they want to figure out how to get the best price for and they're querying a bunch of rfqs they can now also query this oracus quoting surface right they're they're quering winter mute they're checking all the pools on chain they're quaring SCP they can now ask offchain oracus what price will you give me for this particular Swap and this quoting service does not have to respect the current price of the
amm at all it can it within some bounds can give exactly the price that it wants to give on a solver by solver basis on an order by order basis and if a solver has given one of these signed quotes from the quoting service then they can do what we're calling a flash swap here which will just execute their trade at exactly the the uh signed price against the liquidity pool but it will do two extra things in the signed quotes that this uh quoting service emits it inserts a little bit of metadata what kind of metadata well an update to the pool spot price as well as an update to how the dynamic fees on this liquidity pool will work and so what happens is whenever one
of these uh quotes lands from a quoting service from the quoting service on the liquidity pool it will also magically zap the spot price to the new trusted spot price that comes from the quoting service without volume so this should be this is this liqu uh lvr this is part of the solution tion of this lvr protection that this design gives because basically we can arbitrarily say hey instead of letting a a toxic arbitrager move the price from A to B we will simply let this solver get his swap at a at a nice price and at the same time we'll magically move the price from A to B we'll remove all the liquidity kick the price over from A to B without taking this toxic volume and then replace the
liquidity back in the liquidity position so um what is the dynamic fee we're going to look at that in a moment but basically this is our design and it we understand this to be somewhat of a half measure there are some permission components here but the idea is to mash together the best of truly permissionless decentralized dexes a concentrated liquidity amm and this new emerging category of RFQ based onchain trading together into one contract so um uh not this yeah uh what about this Dynamic fee almost done here by the way is um basically what happens is every time we see one of these quotes we also get a new trusted price for the
amm but if we don't land one of these offchain quotes from the irais quoting service for some blocks it means we're less and less certain that the spot price of our amm isn't stale that it's not going to be open for Arbitrage and so the rule for the for the swap fees on this pool type is that every single block the swap fees grow and grow until we observe another one of these uh updates until another one of these solver quotes lands on chain which will update the price to a more uh uh trusted upto-date price and this will reduce the swap fees again so that Traders coming through that permissionless door should
get better execution with lower fees at more uh upto-date real world pricing for this asset pair however if it if we don't observe more these uh quotes landing on chain for some blocks the the um the fees just linearly increase again and the dynamic fee update is just about how quick is this linear increase this is one thing that these solver uh swaps can also inject in that metadata and so this is our new liquidity pool design um it's again as I said sort of the first thing that we felt could be done to help LPS compete in this new landscape and try to uh allow dexes in this new world that is emerging to actually rival centralized exchanges what I just want
to finally say is that I think the future for for onchain trading is very bright but still undecided so I think there are going to be many this is our first design that we felt was possible right now how to make a some impact right now but I think there are going to be many liquidity pool designs serving very specific goals for specific LPS and token pairs specific use cases we're about to see an explosion of innovation people working on things like Dynamic fees integration of offchain price information which in some sense we're doing some of these too with the hot amm we're also uh as well as this RFQ this is all of these things are sort of similar to what we're doing at the hot amm but there's also all kinds of other designs one that's very interesting that we're seeing a lot about is uh auctions
and in protocol auctions to figure out uh Arbitrage rights for uh arbitraging the pool at the top of the block or uh allowing uh the liquidity pool to be only hit at with a batch auction you see this with the cow amm with Cella so there's just this incredible new design space opening up for liquidity pool designers that I think is very exciting and uh will make a lot of changes for onchain trading and hopefully allow us to usurp binance so thank you guys very much this is oracus we do prohibition L onchain Market making we uh we have these smart contracts which allow you to integrate with dex's in a very convenient way as well as run all kinds of algorithmic strategies on top of this
so uh thanks so much uh I'm Cassandra on Twitter and you can follow oracus as well thank you [Applause] guys uh unfortunately we don't have enough time for questions so if you can make yourself available uh for sure talk after thanks