What you see is NOT what you get: Quoted vs Executed price Gap in onchain swaps

EthCC[8] · 3 Jul 2025 · 11:59

Eric Wong examines why executed swap prices differ from quotes. The presentation discusses slippage, failed trades and the roles of simulation and routing in making on-chain trading more predictable.

Speakers

Topics

From EthCC[8], hosted by Ethereum France.

Transcript

[Music] All right, thank you everyone for coming. Uh, good morning. Uh, happy last day of ETCC. Uh, sorry for the wait. Um, I'm here to, uh, talk about a topic that I think isn't talked about enough or even when talked about isn't very honest when it comes to ontrain trading. Um, so just a quick poll here. Uh, who here trades on a centralized exchange? Just a quick show of hands. Lovely. Thank you.

And, uh, who here trades on a decentralized exchange? Sweet. And for those of you who don't trade, hopefully this is still interesting to you, uh, and you get something to take away from it. Um, so wanted to walk through like what that experience looks like, uh, on both of those, uh, centralized and decentralized exchanges. Uh and so on the left here I have Coinbase's uh uh experience and then on the right uh it's matcha but honestly a lot of DeFi looks like this today. Uh and the experience at least from a UI perspective looks very similar. Both of them have the same concept of what you would get when you execute this trade. Uh both give you what you're selling and what you're buying. Uh, but one more quick poll here

is when was the last time have any of you ever checked what you got versus what you were quoted. Okay, got a couple. Kudos to you. Uh, and then the other common element within the trading experience is this big call to action of placing your order. Uh, you know what you're expecting is once you do it, it's going to happen. Um but one last question I have is how many of you had had a a revert experience in the last month? Okay, quite a few. Um so yeah, I think in to me uh in Tradfi both of these aspects of getting what you see as well as executing every transaction that you

want to do uh we're calling that execution quality is guaranteed. Uh but in DeFi that isn't. Uh and I think that's something that we should talk about more. uh and really hold ourselves to a higher standard. There's no reason we should get something that isn't what we're uh promised. Uh and there's no reason why we should have, you know, very high revert rates. We all want the same thing and we should have the experience on DeFi, uh be able to match what we're expecting. And so, uh we at Zerox, we do DEX aggregation. And so, trading is very core of what we do. Uh and this is a problem that we think, uh should be addressed more. And so uh there's really one big thing that we do at Zerox that deals with this uh and kind of killing

two birds with one stone uh is that we do quote simulation on default. You can think of it as every API response gets fact checked. Uh what you're seeing is uh as honest as we can give you what we think you can get. Uh the very quick TLDDR of how we do that is we're simulating uh what we are uh calculating at the top of the current block and it's an ETH call with some magic here and there just to make sure that everything can execute and that we can catch issues uh before they happen. And the benefits that we think this brings uh both to our developers and then their users is that it is an accurate response. the buy amounts, uh the gas, uh limit that we're telling you to set is all based on what

we think you uh is actually going to happen on chain. And we think that leads to lower revert rates um because what we're catching these issues before it happens. We're letting you know if you have an allowance or balance issues for your user. Um the routes are checked to make sure that liquidity actually exists and that the it will behave as we think it will. Uh and then both uh the buy amount affects the min amount that you're going to set and so you should be running into less slippage issues. Uh and we should never be setting too low of a gas limit uh and ended up being reverting due to out of gas. So that's the main thing that we do. Uh we think it really kind of really benefits that trading experience.

Uh and so what can devs do uh for their users uh across the industry? Uh the first thing is they could try to simulate it themselves uh and kind of do all this work that we're doing. Call out a couple of our integrators who do it. It's a pretty small list. Uh and I think that list that list of names should be a lot longer. Uh or the alternative is just to use us. Uh we're already doing this work for you. Uh and you know uh skip the step of making extra ETH calls yourself. And so kind of circling back to this trading experience, right? this is what it looks like today. A better one would really fix those two address those two issues of what you see is what you get.

Uh and that every trade will succeed. But that also got us thinking of like what is an even better trading experience, right? You're probably looking for the best price you can get. Uh and so we started to just skeleton something out. We want to probably keep that main UI component the same, keep that familiarity, but we're also going to check like, you know, why not check other sources? uh you know there's obviously a lot of other great teams out there uh why not see what they can get but at the same time don't necessarily trust them and simulate what their responses are uh and so we did build it uh and this is just a little sneak peek of what we'll announce uh later this year uh we are going to have an upcoming product called Matcha Meta uh and so we

very much took all those elements and put in UI plus a couple other uh additional features that we think really enhances the user experience experience uh and makes trading on DeFi more like CFI. The first thing that we have is user opt-in simulation mode. Uh so if you see on that top right there's a little simulation badge. And what this does uh if this is enabled is that every quote that we receive from us as well as other providers uh go through that same simulation step that we do uh on Zerox API. Uh and this shows everything from uh you know what the simulated amount uh buy amount is, the amount of gas that it will take uh as well as highlighting reverts that might happen. Uh and so whether you're trying to trade a large

uh large amount or you're trying to trade a virtual token that we all know is a fon transfer uh or it's the newest Zora postcoin, you should be seeing exactly what you get. Um, and so reverts will be shown ahead of time, saving you the cost of executing a transaction that won't even land. Um, and also showing you which aggregators have some fun routes. Uh, the other big thing that we're doing here, uh, related to this talk is that on every post trade toast, uh, we are showing you that information that you probably aren't checking. uh which I think in the earlier question there were maybe three of you who did uh honestly even a higher number than I was

expecting um and we are showing you what you were quoted what we had simulated and what actually ended up settling on chain this way we should constantly remind ourselves like uh given the state of like you know this dishonesty that like hey this is what's actually happening and so using this product we've also been collecting a ton of data on these things that we think are relevant to trading experience so the first thing that we're collecting is simulation revert rates. Uh this is a chart of all chain uh on all chains uh across I guess the 3-month period that we've been in closed beta. Uh in the blue line is us uh and then in the purple line is the other providers that we have integrated.

And you'll see that uh you know other integrators actually have quite a few uh quotes that they'll return that actually revert just in simulation. Uh this is it broken out by ch uh by chain. Uh I will say there's obviously a little bias here. This simulation mirrors what we do. Uh so we shouldn't be failing these but uh we also don't expect other providers to be failing it. And so we think there's more that can be done here. The next thing that we tracking is the difference between what was quoted and what we simulated. Uh and so the ideal here is that everything is on the zero line. There's no there's no deviation between what you see and what we think you can get. Um, but obviously

blocks change, the state changes, and so the routes aren't always perfect. Uh, so we don't expect it to be zero, but it shouldn't be very large either. Uh, and so breaking it up by chain, uh, you know, overall on Ethereum, you see that there's at least with 0x, we're quite honest and what we think is what what we simulate is close to what we are quoting. Um and uh I think the ideal trading experience is actually for these dots to be on the positive side because it means that you know what we think you can get is even more than what you quoted. And so the last thing that we're tracking here is the quoted amount minus the settled amount. Uh and again here ideally you are getting the the best experience is getting even more than

what you're shown. Um and so breaking it by chain uh we have this data if any of you are interested in this and digging more into it. uh please find me off stage. Uh we are going to be talking more about this uh within Macheta as well. And so yeah, that's the the upcoming product uh for anyone who wants to trade hopefully and and see more honest um a more honest UI, this will be the one for you. Uh and so public release is coming soon. Um but for those who want a sneak peek, uh that is the URL that you can find it at. Uh, and there's an invite code that works for the first 20 people. Uh, and then after that, you'll just have to find one of us at our booth. Uh, and

we'll talk to you and and see if we uh, you know, see if Macho Meta is the right thing for you. And so, this all kind of circles back to this trading experience. Uh, right now there is a difference even though the UIs look very similar, uh, the reality of it and going through it is not the same between trading on a centralized exchange and trading on DeFi. And if we want to get more people to end up trading on chain, I think we need to improve this experience a lot more. It's always frustrating to get a revert. It's always frustrating to not get exactly what you think you're going to get. And so, uh, yeah, that's all I have for right now. Uh, thank you. Uh, there's a QR code for our link tree overall at ZeroX. Uh, and then just some quick me.

I'm Eric. I'm a PM on the API. Uh, so work with a lot of our engineers on our routing, uh, on our simulations. And you find me at ywaka flocka on most channels. Thanks. Thank you, Eric. Do you have any questions? Yeah. Um, one question. What is coming? Is it that comparison of the the other uh aggregators? So is that one already live? The the normal trading API and that already includes the um simulation.

So only just the right part is not yet live. Correct. What's coming soon is this uh new trading UI uh within matcha. But today all Xerx API quotes are simulated. Uh and so what you're getting in our responses is honest truth. Uh same with the normal Matcha product. It's powered by ZeroX. So the the what you see should be what you get. But what we're doing here is adding other providers in there and kind of seeing what they can do. Okay. Thank you. Any question?

Okay, cool. Thank you very much. Thanks everyone. [Applause] [Music]