NEAR - Sponsor Image NEAR - Confidential swaps across 35+ chains Friend & Sponsor Learn more
01:33:39 · 3 years ago
DeFi

Announcing Uniswap V4 With Hayden Adams

Hayden Adams joins us to announce the release of Uniswap V4!

Up next

All episodes

Inside the episode

Hayden Adams joins us to announce the release of Uniswap V4! He walks us through innovations new to Uniswap like hooks and singleton contracts in addition to a new upgrade that can lower gas costs up to 90%.

To launch V4 we need your help, the community, to contribute your opinions and decide the fate of this new protocol.


Timestamps:

0:00 Intro

5:56 Introducing Hayden

7:37 V4 Launch Date?

9:12 What Goes Live Today?

10:28 How Far Has Uniswap Come?

12:14 Can Uniswap Get Any Bigger?

13:52 Are Centralized Exchanges Competitors?

16:28 Why Do We Need V4

20:10 V4's Flagship Feature

24:47 Introducing, TWAM

28:29 A New Uniswap Fee Structure

33:57 How V4 Solves Efficiency

38:27 Singleton Contracts

41:08 The Gas Refund

43:29 The Hook Centric Roadmap

46:59 What Rollups Will Uniswap Live On?

51:34 Who Will Be Building Hooks

58:20 Fees On Withdrawals

1:05:35 Why Hooks?

1:10:18 Will Liquidity Migrate To V4?

1:16:34 How V4 Is Like a Centralized Exchange

1:20:47 Is This The Last Uniswap Upgrade?

1:22:38 Has Defi Peaked?

1:30:10 How To Get Started On V4

Transcript
00:00
Hayden Adams

One cool thing about the singlet design is it actually reduces current estimates have it have it reducing the gas cost of pool deployment by about 99%.

00:07
Ryan Sean Adams

Wait, what?

00:08
Hayden Adams

Sometimes people pay when gas costs are high, like north of a thousand dollars to deploy a pool, just a gas cost. And uh that same deployment would be something like ten dollars.

00:19
Ryan Sean Adams

Bangless Nation, there's a big announcement for everyone in DeFi today. Uniswap. Version 4. It's coming out. We have Hayden Adams on the podcast to tell us more. We talk about a few things. What is Uniswap version 4? V4? What does it do? When's it coming? How big of a deal is this? From an order of magnitude size, is this as big as V3?

00:42
Ryan Sean Adams

We also talk about hooks, this idea of a modular Uniswap. What are hooks? What do they do? What is the future for liquidity on Ethereum? And finally, we talk about DeFi. Has DeFi slowed down? Has it diminished? Does Hayden still think we're on track to eat traditional finance? All of these topics unpacked in the episode today. Guys, before we begin though, want to tell you about a prize linked ETH denominated savings account.

01:07
David

Ryan, diving into this episode when I was learning about Uniswap v4, I really just got visions of a microcosm of Ethereum. So I'm I'm calling this Uniswap the hook-centric roadmap for Uniswap, whereas Ethereum has its roll-up centric roadmap. Uniswap now has hooks. And it allows for Uniswap base to be extremely primitive, but hooks to reintroduce complexity into the Uniswap AMM on an opt-in basis. And I think this really gives a lot of power to builders who want to make their Uniswap pools very expressive. Overall, it starts off as a very small update. V4 is a small update to V3, but the cool thing is that the size of how awesome and powerful Uniswap V4 is actually grows alongside the open source developer community around Uniswap. So I'm very bullish on this new update. Hayden's gonna unpack it for us in this episode. Uh small disclaimer, Uniswap Labs is a sponsor of Bankless. They currently sponsor the Bankless podcast. Uh, but Uniswap V4 is an episode that we would never miss. And so we're having Hayden Adams, the inventor of the Uniswap Protocol, on to discuss all about Uniswap V4. So let's go and get right into the conversation with Hayden Adams. But first, a moment to talk about these fantastic sponsors that make this episode possible. Bankless Nation, I would love to introduce you to Hayden Adams, the inventor of the Uniswap Protocol and CEO of Uniswap Labs, a software company building on and around Uniswap. And today, Hayden is here to talk about the vision behind Uniswap V4 and what it could mean for liquidity on Ethereum. Hayden, welcome back to Bankless.

02:45
Hayden Adams

Thank you for having me. So excited to be here and to talk about Uniswap before.

02:48
David

Yeah, Hayden, we getting a new Uniswap?

02:51
Hayden Adams

Uh short answer is we are. Um long answer is that you know the the process of getting a new Uniswap is gonna look a little bit different this time around.

02:59
David

Hmm.

02:59
Hayden Adams

I think that a really important starting point is that we see Uniswap as very similar to Ethereum itself, where Ethereum where it's a core piece of infrastructure, public infrastructure on which thousands of teams are building, there's hundreds of thousands of liquidity providers. And it's really just this like public infra for the entire space. On Ethereum at least.

03:27
Hayden Adams

Similar to how Ethereum has this like public process for it being rolled out, and there's a lot of time for people to respond and react and give feedback and input. There's time for all the different projects building on top of it to begin preparing their infrastructure and build on top of it. With this version of Uniswap, we really wanted to build it in public. And so what we're rolling out today is basically a vision for Uniswap v4, as well as a white paper and a draft of the code. So the code is, you know, we have an initial code base and it works and it proves that it can work, but it's not final. And we don't expect it to be final for many months.

04:07
David

Okay, so the big new announcement is Uniswap V4, Jazz Hands. Yay, we're getting a new Uniswap. And also the way that Uniswap V2 and V3 were built was it was built, and then I think within a month, both of them were live on mainnet. And this is not what is going to be happening with v4. There I'm that there is no release date, if I'm correct. And it's just a very long open period for public collaboration, community engagement, public conversation to tinker with Uniswap v4. Is that correct?

04:38
Hayden Adams

Yeah, I think that you know Uniswap E3 was kind of like a Beyonce lemonade album drop where when we released it, it was this cool thing and it was entirely ready and it was a surprise. And, you know, I think this time around, and honestly, one of the pieces of feedback we got at the time was hey, this is really cool. This is gonna take me like a month to understand, let alone, you know, build an entire integration on top of. And so, you know, that was one aspect of it. The other aspect of it is that, you know, there were even like minor that at the time that we announced it, the code base was basically frozen and already well underway of auditing. And so there wasn't time to incorporate any pieces of public feedback. And there were like very, very minor things that people call I mean, it was like a very good code base. We did a really you know good job, but it was like there was like minor pieces.

05:22
Hayden Adams

Very minor improvements people found at the time. And they weren't really able to be integrated. And so with Uniswap v4, there's gonna be many, many months. There'll be time for people to open issues, to submit code, you know, submit PRs, there's contribution guidelines, and there's m a lot of time for people to start planning integrations and start building on top of it.

05:43
Ryan Sean Adams

So, what are we getting right now, Hayden, at the time this episode is released? What can people go um get busy with and start digging into?

05:51
Hayden Adams

Yeah, so you know, first we have the blog post, which just outlines a high-level overview of what it is, uh, or at least what our vision for it is. Uh, you know, similar to like Ethereum, right? You you sort of have a sense of where things are going, right? We had this sort of vision of proof of stake, and then everyone started marching towards it. Um we have this vision for what Uniswap V4 is. Uh, we have a white paper that you know gives a lot more background and technical information, uh, you know, and supporting you know math, et cetera. And then we have a code base, and the code base really just contains a full draft implementation, so it kind of proves it works. Uh, it's definitely not audited, it's not you know production ready. Um, and we aren't you know going to march straight towards audit or production ready. We're actually gonna you know give space and time uh for people to contribute and to to you know uh give feedback into it. And so yeah, right now we have an initial implementation, we have a vision, excited to talk about what that vision is, and yeah.

06:45
Ryan Sean Adams

Before we um get into the vision of of uh v4, I I want to just maybe zoom out for a minute because it's not often, Hayden, that um we're able to get you on on bankless and have this kind of conversation, but like let's zoom out all the way back to to 2018, and I'm wondering if you could kind of like share how far Uniswap has come from that point in time. I was reading the blog post a little bit earlier, something like 1.5 million or tr sorry, trillion with a T. My God, million, how quaint of me. Trillion uh in in in value flows through this platform. Give it give us some stats, give us some um some of the numbers that you look at to understand.

07:30
David

Deflex.

07:31
Ryan Sean Adams

Uniswap's progress and its impact. Yeah, flex on us for a minute.

07:35
Hayden Adams

Yeah, I mean it's it's been an absolutely insane journey. We have the the previous Pankless episode we did where we really went through a lot of the early days. Uh but since then it's just been absolutely insane. Um I guess a few of the things that we look at that that are pretty interesting. Um definitely like total all time volume traded is you know north of 1.5 trillion at this point, uh which is which is pretty crazy. There's you know billions of dollars in daily trading, hundreds of thousands of liquidity pools created, uh, hundreds of thousands of liquidity providers, uh, you know, millions of traders.

08:07
Hayden Adams

There's, you know, the I think you know, even just like the the amount of um like the market share on on Ethereum, it's like you know, north of 90% at times uh of on-chain trading on Ethereum

08:19
Hayden Adams

uh happens through the Uniswap protocol. Uh you know, it trades off at different times. But um

08:24
Hayden Adams

you know it's been trading off with Coinbase in in total uh trading volume. Um

08:29
Hayden Adams

Yeah, all sorts of things that we look at to just show like the amount of activity happening on top. Definitely, uh I wish I had a number for the amount of projects building on top of it. My like intuition says tens of thousands, not just thousands, you know, just because of the number of you know tokens and projects that exist.

08:45
Ryan Sean Adams

So so given all this, Hayden, one question in my mind is like, can Uniswap get even bigger?

08:49
Ryan Sean Adams

Like, I mean,

08:51
Ryan Sean Adams

haven't we seen all the growth? Isn't aren't the growth years already behind us? How can this thing possibly get any bigger?

08:56
Hayden Adams

Uh I I definitely think that Uniswap can get much bigger. There's a few ways for it to get bigger. Definitely, like in terms of like market share on Ethereum, it's hard to get much bigger. Um, you know, there's there's very marginal gains to be had there, right? In the order of like 10 to 15%. Um and so I'd say that where Uniswap grows bigger is about, you know, basically growing the entire space, um, about having you know more.

09:20
Hayden Adams

uh uh enabling more, you know, things to be built on top of it. Um, you know, and basically growing the entire growing the space around it and

09:28
Hayden Adams

Really, um, you know, taking innovation that currently happens external to Uniswap and having that innovation happen within Uniswap. I I think that like one, you know, pretty important like nuance here is that you know Uniswap has this like dominance in market share, but there is a lot of innovation today that does happen in the AMM space and a lot of experiments. And you know, maybe a little bit of a spoiler alert for some of the stuff that's coming is that like a big part of what we're trying to do with Uniswap v4 is make it easier for people to experiment and innovate, uh, even within you know, uh on AMM design and and uh functionality, but having that happen still within the Uniswap ecosystem.

10:04
Ryan Sean Adams

Well what's the goal here, Hayden? I mean, I remember at one point in time when um DEXs were still in their infancy and we were just hoping to get like a um like 5% market share from centralized exchanges. So basically all of the exchange volume happened with with centralized uh exchanges, and like wouldn't it be great if um we could actually get this whole decentralized exchange thing off the ground and we we could like eke out maybe double digit percentage of um volume? Like, how do you think of the competitive landscape these days? Do you do you consider centralized exchanges as uh competitors, or would you like draw those lines differently than maybe we did back in uh 2018, 2019?

10:44
Hayden Adams

Yeah, I think that it's you know a pretty kind uh interesting. I I'd say that generally like decentralization offers some fundamental advantages. And the way that we always think is how do we expose those advantages to more people?

10:56
Hayden Adams

And so it's definitely possible. Like I think central like centralized exchanges are going to continue to exist. But I think that there are really strong advantages of decentralized exchanges. And even like things that are centralized exchanges today will start tapping into the liquidity from decentralized exchanges over time. In terms of where you know where it actually ends, really, I think that first it's DeFi growing bigger than C Fi, and then it's DeFi growing bigger than ChadFi. That's like the long the long term of it. And uh the purpose of that is not like for its own sake, but because we think that you know uh that leads to a world uh you know uh with with fairer, better financial system, you know.

11:36
Hayden Adams

More accessible financial system, uh, you know, just a better world in general.

11:42
Ryan Sean Adams

These are what we call uh bankless values. And um yeah, we don't talk about them maybe well, maybe we talk about them too much, David. I'm not sure. We'll let the listeners decide. But it's uh it's definitely why we enjoy having Hayden on the podcast to kind of re-articulate it. It's been baked into the DNA of Uniswap um from day one to provide a bankless uh exchange experience where user can retain custody of their private keys and their assets. And that is certainly um we don't talk about it as as as much now in 2023, right? Um we're off chasing other things, but like that is the core of this entire movement. I mean, that is why we're here.

12:20
Hayden Adams

Yeah, I think it you know it's what you said, like a lot of the time, kind of people who've been in the space for a really long time like take it for granted and sort of like, yeah, of course we're doing all that stuff. Let's talk about what's new. But um yeah, I agreed, like the the values are super important and really important to like guiding you know even day to day decisions.

12:36
David

So Hayden, I'll admit when uh Uniswap V3 came out and concentrated liquidity, uh, added in just a whole entire layer of expression onto Uniswap V3, uh Uniswap uh uh gener in general. I was like, oh, that's that's the last Uniswap, that's the final completion of Uniswap. It's the logical conclusion uh that Uniswap V3 is is now Uniswap. Uh so clearly I was wrong about that. Uh so what was what was incomplete about Uniswap v3 that we need uniswap v4? So let's start unpacking the Uniswap v4 box. What does v4 bring to the table that that uh v3 still had left to complete?

13:15
Hayden Adams

Yeah, so you know, Unsolv3,

13:17
Hayden Adams

I I don't think we uh I think it was a really, really good protocol, right? It's it's really proved itself. Um there's a reason it has such dominance today. Um it's you know really extreme you know it's really efficient, uh really flexible for liquidity providers relative to previous editions. I think that like what the the maybe the one

13:36
Hayden Adams

Thing, right, that we really wanted to tackle with v4 is Uniswap V3 was also extremely opinionated. And what I mean by that is you know when you have these immutable smart contracts, uh the rules for it are kind of set in stone at creation. And the more you can modify and upgrade, uh the the in certain ways it it compromises on certain security properties and compromises on you know um.

13:58
Hayden Adams

Other things as well. And so I think that, you know, with uh as an example, right, uh in the process of designing Uniswap V3, there were like a million trade-offs that had to be made. And you know, one example trade-off is the price oracles. Uh so the price oracles were really just, you know, basically at the beginning of every swap, uh, the contracts store the, you know, the first swap of every block, it stores the price and you know adds it to these like accumulators. And with that, you can basically, other, you know, other applications can extract uh really efficiently uh average prices across any period of time in the Uniswap, uh, in that Uniswap pair. And that's a really, you know, it was a really good almost like public good for the space. Many other projects have started have built on top of that uh feature. Um at the same time, running that logic for these price accumulators actually is a gas cost that is paid by swappers every swap. And so you could think of maybe something like 10%, don't quote me on it, uh, of all gas you know, of the gas of swaps as going to like updating these price oracles.

15:01
Hayden Adams

And that amounts to a huge amount of money over over that swappers are paying over a period of time. And the thought process was basically like, well, you know, if Uniswap can be used in more ways and in more places, then ultimately that will lead to more like you know usage of the protocol, more liquidity in the protocol, and that will you know be better for swappers and offset the increased gas cost. Now, has that played out? Um probably in certain situations. Some pools, the oracles do get used, and they're tightly integrated into important protocols. Um and in some pools, maybe they don't get used at all. Uh probably the majority of pools, actually, they they don't get used at all, and that's just like a tax on swappers paid over time. And the kind of like opinionated uh way that V3 was was implemented that isn't like a choice that you can make when you deploy a pool. Um

15:46
Hayden Adams

So I'd say that like the flagship feature of Uniswap, actually before I even I'd say like another area that you know

15:56
Hayden Adams

is really

15:57
Hayden Adams

interesting as it as it relates to like the the sort of opinionated nature is like fees and how fees are implemented. Um most like there's a lot of different people who kind of experiment with we're gonna build our own AMM. And usually what they're doing is actually just like experimenting with the fee logic. Sometimes they're doing other things, but that's like the most common thing that people do. And there's like a few other changes. Um

16:16
David

So people are building entirely new Uniswap forks, and what you're saying is like, and they're really just tinkering with the fee model. And so they're building out entirely new exchange just to tinker with fees.

16:26
Hayden Adams

Sometimes. And maybe sometimes they're doing other changes as well. But sort of no matter what, they're probably doing more work than than they should have to. If all they're really trying to do is modify the functionality of a pool. And so I guess you know we'll get to the point of it, which is the you know the flagship feature of Uniswap v4 is what we're calling hooks, which are essentially modules or customizations that you can make when you deploy a pool. And anyone can build a hook, anyone can you know can implement one, and anyone who's creating a pool can choose what hooks their their pool uses. And these hooks are pretty expressive and they allow you to add on new features, new functionality, modify parameters of the pool in really uh interesting and meaningful ways.

17:10
David

So hooks. Okay. So you you started off this conversation with uh oracles and then also talked about fees. And these are all things, opinions that you're saying Uniswap V3 had. If you wanted to start a new Uniswap uh V3 pool, you had embedded in it this Oracle feature, whether you asked for it or not, and then because of that feature, uh swappers who uh touch the logic of every single v3 contract every time they swap, pay for that uh complexity to be built into that v3 pool. So what what you're saying is um uniswap v4 has these things called things called hooks that are like generalizable pla things to insert into a v4 pool. So I'm guessing a base v4 pool, a v4 uniswap exchange, uh has almost zero features built into it, just like by default. And then the idea is you can opt into certain features like the Oracle, like fee structures, et cetera, after the fact. But the standard issue Uniswap V4 exchange is just like bare bones, primitive, reductive, maximally simple, maximally cheap, maximally efficient. Is it am I am I on the right track here?

18:22
Hayden Adams

Yeah, exactly. I think that the, you know, the funny enough, Uniswap V4 actually has like the base system has almost less features, right? Because the oracles have been taken out of the contract, and now they can be implemented as a hook. And so, you know, in the process of building v4, we also built a whole bunch of uh example hooks uh to show how expressive it is and the types of things that you can do. You know, the the simplest form actually has has fewer features in in a in a certain sense. So Uniswap v4, uh I I could just start going through some examples of what you can do with hooks. Maybe we'll make it more make it more clear. Um

18:55
Hayden Adams

One example is definitely dynamic fees. So right now, you know, all right now when you deploy a new pool, the pool creator gets to choose between a few fixed V tiers. And actually the reason we choose V3. The reason

19:08
Hayden Adams

Yes, in V3, you choose between, you know, there's like four different V tiers today, and governance has the ability to add more. And the reason that there weren't like arbitrarily many is you know to encourage, you know, to kind of discourage liquidity from overly fragmenting and encourage people to kind of consolidate around specific pools. With Uniswap V4, when you deploy a pool, you can choose any fee you want as a static fee, or you could attach a dynamic fee hook. And the dynamic fee hook could actually customize the logic of your fee in any way you you want. One example would be that you could do.

19:40
Hayden Adams

You know, um, you know, you could basically try to do some sort of Oracle that tracks on-chain volatility and automatically adjust the fee based on that. And that's an interesting experiment we've wanted to run for a long time, but we didn't want to, you know, hard code it into v3 because it was unclear if that was the optimal design. And so with Uniswap V4, people can experiment with a whole different uh you know world of fee implementations, um, you know, volatility-based, uh, you could imagine DAO controlled, um, you know, et cetera. And so that's one example. I think that's like a hook that will probably get a lot of usage. Other you know, pretty major features that you can add onto a pool. We we have a you know an implementation of a limit order hook, which allows you to place limit orders at ticks. So right now, you know, you can you do you can provide, you can kind of simulate limit orders a little bit in Uniswap v3 by providing liquidity to very narrow ranges and withdrawing your liquidity after it's filled. Uh but with UnSwap v4, you could actually just create straight up limit orders that execute at, you know, and basically maybe to step back quickly, hooks are basically code that rec uh that run at certain points in like the lifecycle of a pool and a transaction. So you could imagine there's a hook that runs at the beginning of every swap. Before every swap, run this code. After every swap, run this code. At the moment of pool creation, run this code. Before adding liquidity, run this code. Before anyone removes liquidity, run this code. And so you know the the hook for a fee might be like code that runs uh before every swap or after every swap.

21:07
Hayden Adams

Limit orders might be, you know, would also be code that runs during the swap transaction. So uh maybe another kind of interesting hook that we designed is uh there was this paper that uh you know Dan at Paradigm put out a while back uh called TWAM, uh which stood for time weighted average market maker. Um kind of don't don't want to go way into the the complexity and the weeds of it, uh, but essentially.

21:33
Hayden Adams

When you think about a Uniswap pool

21:36
Hayden Adams

and people who want to make very large orders,

21:38
Hayden Adams

very large orders if the you know relative to the size of the pool,

21:42
Hayden Adams

you're gonna get a lot of you know price impact and you'll get a worse price. And so usually when you have to make a very large order, if you want to trade it over Uniswap,

21:49
Hayden Adams

you know, you would probably want to break that order up into many pieces. Uh and you'd have to submit a separate transaction

21:56
Hayden Adams

through you know spanned over multiple blocks. And that kind of like reduces the sort of price impact of your trade.

David Hoffman

1490 posts

Co-owner at Bankless. Optimistic storyteller of frontier technology.

A huge thanks to our Friends & Sponsors
No Responses