0x Request-For-Quote MEV Proof + Xero Slippage Trades - Amir Bandeali
ETHGlobal·Sat, Oct 9, 2021, 12:00 AM
Amir Bandeali, the co-CEO of 0x-Labs, describes 0x lab's solution to slippage and MEV proof, a drain of funds currently plaguing all DEX users. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal Check us out: https://ethglobal.co Email us at: hello@ethglobal.co
Transcript
cool uh so today i'm gonna share uh xerox's rfq model um one of the the trading models that is 100 are med proof and also uh has several other really nice properties uh if you were listening to tom's presentation uh he did drop some spoilers and uh i think this might be one of the few presentations today that will actually be under time all right so first of all what is rfq uh this is a concept that you know it exists in traditional finance it's not specific to blockchains at all um but has some really nice properties that work really well with blockchains i would say so at a high level you could think of rfq as uh like programmatic peer-to-peer otc trades um so you you have a trader um you know let's say they want to sell 200 ether they say how much can i get for this 200 ether um a market maker will be on the other side uh or actually one or more market makers will be on the other side and they will respond with the best prices they're going to quote so in this case smartmaker says okay i'm willing to pay 500 000 for this ether and then the trader you know at that point can decide to you know agree to the trade or pass on the trade um and uh yeah at that point the the trade is sent to the blockchain and settled so uh some of the high level properties of rfq are well first of all it can offer really really competitive pricing um and while it does have complete protection against mev um that was you know not necessarily an explicit design goal this uh this model was designed first and foremost to offer the most competitive pricing uh and i think it's just a a little bit different framing than you know a lot of the other solutions um that we've seen or we're going to see today all communication happens off chain until these trays are actually settled uh which makes the system extremely gas efficient uh for liquidity providers you know they could be quoting all day you know hundreds of times a minute or a second or whatever and they're not going to spend any gas on that and in addition to that you know orders pretty rarely need to be cancelled i would say so you know very rarely actually spending gas as a market maker at all trades are completely impossible to front run or sandwich and we'll get into how that works in the next couple slides uh trades have zero slippage zero fees aside from gas um and they're they're settled at a predetermined price um the the price of the trade um you know does not change if the transaction is is mined in uh in a different order or anything like that uh these trades are highly capital efficient for for market makers um so you know they are trading directly out of their own wallet and can theoretically offer trades as as large as the balance in their wallet and rfq liquidity is also composable so you know other dapps can consume this liquidity smart contracts can consume a security um can be you know used with more complex systems so how does it work uh well uh if you're familiar with xerox um the underlying concept is uh you know pretty similar to how xerox has worked since the beginning um so uh xerox uses off-chain orders with on-chain settlement uh in order you know just describes the the properties of a trade so the tokens that are involved in that trade the price of the trade um the you know the time at which that trade expires uh and several other fields um the the market maker will hash all of the uh all of the order properties together uh and and sign the hash with their private key uh and at that point the order becomes executable um and can be sent to the smart contract for settlement um you could uh check out the entire order field and documentation in this link uh so i want to focus in on this one field in the order uh tx.org um this is actually the the main field that uh you know prevents these trades from ever being front runned or or sandwiched um so the the tx origin field enforces who is actually allowed to fill this order who can send this trade to the blockchain only that field is allowed to to fill the trade um if anyone else attempts to submit the same order uh the the trade will just revert so literally impossible for you know any other bot any miner to to come in and try to fill the the same order um in addition to that since the price is pre-defined in the order um the the trade must be settled at that exact price this is how uh zero slippage is accomplished um solely agnostic to how market makers are pricing their orders or how how they are hedging behind the scenes uh there's no price curve involved you know no magic pricing formula baked into the system um the user you know really doesn't know any of that they just know that uh this is the price the market maker is going to give them and they either accept that or they don't so what are some of the constraints of rfq well i would say first of all this is not uh not not really for your your average uh liquidity provider that's depositing their tokens on not made market maker you know swapper or sushi swap um it does require a pretty high degree of sophistication to be a market maker on the system uh you know you are trading completely programmatically there is a good amount of off-chain infrastructure you're not just depositing your funds and you need to be able to hedge out your risk you know in a pretty sophisticated way overall um and you know because of that uh market makers typically aren't going to be experimenting that much with like brand new tokens or tokens that are difficult to hedge or you know maybe tokens that have questionable legal status right um so uh you know they tend to participate in already established markets that have a lot of trading volume um so you're gonna see really really good coverage in the main markets uh that involve wbtc stable coins any of the d5 blue chips um but you know if uh you're trying to market buy a million dollars of uh some some dog coin that launched an hour ago like you're you're just gonna get sandwich there's no way around it um however uh yeah i would say for consumers of liquidity um there there really aren't any downsides to uh trading against rfq um you know you're gonna get all the advantages of that um consumers don't really need to care uh about you know where that liquidity is coming from otherwise um so i would say overall uh the trade-offs are are pretty minimal um and there's really good coverage um in general uh yeah tom uh showed a chart in in his presentation about like how large of a percentage uh rfq volume makes up in the overall deck space um yeah it's probably somewhere around 40 these days i would think uh and probably somewhere between 10 and 20 professional market makers who are using systems from my experience so how can you go and actually use this practice um well uh we have uh a liquidity aggregation api called xerox api uh where xerox rfq is one of the major sources of liquidity um you know taps into several professional market makers behind the scenes um if a trade is routed 100 through 0x it will be protected from mev and slippage uh and you can easily set that in the api parameters um or you know can also just let your trade be be aggregated um you know there will be cases where you know there are missed pricings and all the mark makers are offering better prices for whatever reason you don't really need to worry about it um but if you're doing a very very large trade um could be worth considering um you know even if you are offered a slightly worse price in some cases uh you can think of it as insurance essentially uh because it guarantees you're not gonna get you're not gonna get front run um so yeah give it a shot at matcha.xyz um which is our user facing dex aggregator um or one of several xerox api integrators you know zapper metamask e5 saver coinbase wallet forgetting a bunch and if you're using matra and you you know do want that insurance you are making a really large trade um there is this otc tab uh you could check it out and that'll just be trading 100 with this rfp system uh so it's not even going to bother looking at the other liquidity sources in this case um that is all uh i guess my closing comment is uh you know it's a super simple system which i think is desirable uh it's it's really hard to reason about a lot of these solutions but with xerox rfq i think it's actually like really black and white and uh yeah hope you enjoy the presentation
Automatic transcript — names and jargon may be misspelled.