Uniswap v1 to v4 History ELI5: Tale of the Forest Villages

Atis E
10 min readApr 2, 2024

--

A short history of the Uniswap protocol — dad-in-a-story-mode version.

See the “References and comments” section brief explanations & links to sources.

Once upon a time, there were only blueprints of structures and designs, dreamed up by visionaries. Some sketches were drafted even before the crypto land was discovered. Though the Uniswap villages could have been built elsewhere, the dark forests of crypto did turn out to be their natural home.

In those early days the crypto land was a remote wilderness, visited by few and inhabited by even fewer. At the time, the first prototypes were assembled by explorer-architects. Once they showed that inhabiting the forest was indeed possible, more explorers, architects and builders joined in. They dedicated themselves to crafting the homes and communal spaces of a forest village.

Before long, the village opened its doors. Traders and visitors flocked in. The rules were straightforward: anyone could build a home here. For those who haven’t visited the crypto land, it might be hard to imagine — there were no building permits to obtain, no zoning laws to follow. Furthermore, once a trading house was built, not only the original builder but anyone else willing to abide by the rules could set up a trading desk and trade there.

The magic of crypto meant that rules are binding for all who wished to take part in village life. Although many dubious characters set up trading houses in these frontier villages, they could not evade the rules or disobey them. Thus, in a way, no wrongdoing could remain concealed for long.

First Village

The village was constructed from reinforced wood, a stylish yet uncommon building material in the crypto land. The houses are all connected through a central plaza; there are no direct paths between them except through this gathering place. In its early days, it served as a prominent frontier outpost of crypto. Now, as time has passed, almost all trading has shifted to its newer counterparts. However, the first village remains very much alive and will continue to do so indefinitely, even though access may become more challenging over time, as the roads and footpaths become overgrown.

Second Village

The architects of the second village chose brick as the construction material. While wood is appreciated for its reliability and some even consider it the material of the future, certain advanced aspects of the house designs required components that, at that time, could not be made from wood.

The layout of the village also underwent significant changes, moving away from the concept of a central plaza. Instead, houses were connected directly or through smaller plazas. Although there is still a large plaza connecting many of the houses, the village features numerous smaller plazas, and its layout is flexible. Anyone can add new areas without relying on this central connection. The design of the houses was updated too. Each house was required to include a clock tower with a working clock, for the benefit of all. The traders operating within each house were responsible for its maintenance.

Third Village

To the passing eye, the third village might appear similar to its predecessors, yet beneath the surface, it represents a wholly distinct entity, with the interiors of its houses differing markedly from those before it. As in previous villages, traders could establish their trading desks in any house, and this flexibility continued in the new settlement. The significant innovation in the third village was the freedom it offered traders to customize their trading spaces. Unlike its forerunners, which mandated uniformity in the appearance of trading rooms, this village embraced diversity in design.

This shift, however, did not please everyone, as many traders lacked expertise in interior design. They discovered that while reverting to the simplistic designs of yesterday was possible, these failed to attract as much attention in the face of the more elaborate and often more costly designs favored by the less conservative traders. Initially, it was believed that this so-called room design problem would find its resolution through servicemen specializing in the design and outfitting of such spaces, catering to those traders either incapable of or uninterested in undertaking this task themselves. Yet, it quickly became apparent that this solution fell short unless a trader’s preferences were straightforward and easily articulated. For instance, designs focused on selling a portion of a trader’s stock proved simple enough to delegate; however, aims as broad as “creating a profitable business” eluded the capabilities of these servicemen. In time, a potentially more effective strategy emerged, proposing that traders purchase automation as a service. This approach allowed traders to retain control over the strategic aspects of their design while outsourcing the technical execution.

Fourth Village

Even in the third village, where the interior rooms and desks varied, the exteriors of the houses largely remained uniform — differing only in size. The fourth village, however, marks a departure from this tradition, embracing diversity in house designs. Traders now will be empowered to modify and decorate their houses as they see fit. Balconies, ornaments, and flower pots could adorn the outer walls, enhancing their beauty, while roofs and walls could be painted in a myriad of colors. Even the core structure of the houses could be radically altered. The standard-issue clock tower was previously mandatory. It incurred costs for all traders, although it was made cheaper to maintain in the third village compared with the second. In the new village, it is no longer a requirement. Houses may feature towers with various styles of clocks, but only if their owners chose to build so.

Significant changes are also made to the communal spaces, though these might not be immediately apparent to a casual observer. Unlike in the earlier villages, where each house had its own plumbing and heating sources, the fourth village introduces a communal grid. As a result, construction of new houses is going to be more convenient and less expensive.

Conclusion

Years have passed since the inception of the first Uniswap village. Today, while it can still be visited, perhaps it’s best to treat it as a museum-like curiosity. Meanwhile, the second and third villages thrive with life and activity. The fourth village, with its diversity in design and communal advancements, is under construction, and represents the latest chapter in this ongoing story. For many who venture into the crypto land, the Uniswap villages continue to serve as the first step on their journey.

References and comments

Introduction

“there were only blueprints of structures and designs” — the ideas behind Uniswap were formulated by Vitalik Buterin, in his Reddit post “Let’s run on-chain decentralized exchanges the way we run prediction markets” (V. Buterin, 2016)

“Uniswap villages” — Vitalik is also responsible for naming the protocol “Uniswap”, according to a Hayden’s blog post “Uniswap Birthday Blog — V0” (H. Adams, 2019)

“Some sketches were drafted even before the crypto land was discovered” — Robin Hanson — an economist famous for his research on prediction markets, futarchy, the Great Filter and other interesting ideas — is one of the unsung heroes of automated market makers. In his paper from 2002, Hanson introduces “marker scoring rules”, a form of an AMM. (R. Hanson. “Logarithmic markets scoring rules for modular combinatorial information aggregation.” The Journal of Prediction Markets 1.1 (2007): 3–15.)

“could have been built elsewhere” — as Hanson’s research shows, prediction markets had the idea of AMMs even before blockchains were born

“dark forests” — in the context of crypto, this term was first popularized by a research post from Paradigm. (D. Robinson, G. Konstantopoulos. “Ethereum is a Dark Forest”, 2020.)

“the first prototypes were assembled by explorer-architects” — Uniswap was not the first DEX and not even the first AMM deployed on Ethereum. It’s forerunners such as Bancor attacked a lot of skepticism, and Vitalik had to step in and argue in favor of the AMM idea. (Buterin, V. On Path Independence, 2017.)

“Before long, the village opened its doors” — Uniswap v1 was deployed on mainnet on November, 2018.

“many dubious characters set up trading houses in these frontier villages” — scams on Uniswap unfortunately remain part of its daily life. Academic research suggests that “Uniswap is flooded with scam tokens”, which make up more than 50% of its pools. (Pengcheng Xia et al. “Trade or trick? detecting and characterizing scam tokens on uniswap decentralized exchange.” Proceedings of the ACM on Measurement and Analysis of Computing Systems 5.3 (2021): 1–26.)

First Village

See Adams, H. Uniswap Whitepaper, 2020.

“reinforced wood, a stylish yet uncommon building material in the crypto land” — Vyper, the programming language Uniswap v1 was written in, remains overshadowed by Solidity

“The houses are all connected through a central plaza” — on Uniswap v1, all trades are routed through ETH; direct ERC20-to-ERC20 swaps are not possible.

“the first village remains very much alive” — according to a Dune dashboard by KARTOD, Uniswap v1 continues to have $10k to $100k daily swap volumes.

Second Village

See Adams, H., Zinsmeister, N., Robinson, D. Uniswap v2 Core, 2020.

“The architects of the second village chose brick [as the material] for the construction of their houses” — v2 and other iterations of the protocol are written in Solidity, unlike v1, which was developed in Vyper. (It’s also worth noting that large parts of V4 are written in Yul / inline assembly, due to limitations and inefficiencies of Solidity)

“wood is appreciated for its reliability” — to this date, Vyper contracts have lost less per unit of TVL to hacks than Solidity contracts

“certain advanced aspects of the house designs required components that, at that time, could not be made from wood” — at least the CREATE2 opcode, extensively used in Uniswap v2/v3 to make pool addresses predictable, was not supported in Vyper

“layout of the village also underwent significant changes” — V2 and V3 only support ERC20-to-ERC20 swaps, no native assets

“there is still a large plaza connecting many of the houses” — most of the pools in v2 and v3 are interconnected through the WETH token, see this visualization for instance

“Each house was required to include a clock tower with a working clock” — all v2 and v3 pools implement price oracle functionality. The costs for updating these oracles are paid by the swappers, but due to increasing the friction of arbitrage swaps, they add to the costs borne by the LPs

“for the benefit of all” — Uniswap pools remain widely used as price oracles by other DeFi protocols

Third Village

See Adams, H., Zinsmeister, N., Salem, M., Keefer, R., Robinson, D. Uniswap v3 Core, 2021.

“the interiors of its houses differing markedly from those before it” — v3 introduces concentrated liquidity positions

“This shift, however, did not please everyone, as many traders lacked expertise in interior design” — managing concentrated liquidity positions is significantly different and more complex than full-range positions. Academic research argues that “obtaining high returns as a liquidity provider on Uniswap V3 is a highly complicated undertaking requiring active management and a good know-how” (L. Heimbach, E. Schertenleib, R. Wattenhofer. “Risks and returns of Uniswap v3 liquidity providers,” Proceedings of the 4th ACM Conference on Advances in Financial Technologies, 2022)

“these failed to attract as much attention in the face of the more elaborate and often more costly designs favored by the less conservative traders” — to be clear, “traders” here is used to describe liquidity providers, not swappers. V3 reinforces the competition between LPs. The dynamic of this competition has been analyzed by several research papers, including the paper introducing the FLAIR metric (J. Milionis, X. Wan, A. Adams. “Flair: A metric for liquidity provider competitiveness in automated market makers.” arXiv preprint arXiv:2306.09421 (2023))

“it was believed that this so-called room design problem would find its resolution through servicemen specializing in the design and outfitting of such spaces” — this alludes to liquidity management protocols, first of which popped up almost immediately after the launch of v3, for example, Charm Finance

“this solution fell short unless a trader’s preferences were straightforward and easily articulated” — to the date, on-chain liquidity management, especially automated liquidity management that outsources decision making to the protocol, has not proven to be a sustainable solution aside a few edge cases

Fourth Village

See Adams, H., Salem, M., Zinsmeister, N., Reynolds, S., Adams, A., Pote, W., Toda, M., Henshaw, A., Williams, E., Robinson, D. Uniswap v4 Core, 2024.

“diversity in house designs” — hooks allow to customize liquidity pools in v4

“the core structure of the houses could be radically altered” — v4 pools are not required to use the v3 concentrated liquidity swap algorithm; they can outsource the swapping to a hook, which is free to use a custom swapping curve

“The standard-issue clock tower was previously mandatory” — v4 pools are not required to implement oracle functionality

“fourth village introduces a communal grid” — in v4, pools are not deployed as separate contracts; instead, all liquidity is located at the PoolManager contract

“construction of new houses is going to be more convenient and less expensive” — v4 reduces the gas costs of a pool deployment by several orders of magnitude

Conclusion

“while [v1] can still be visited” — this used to be the case when the story was first published, using the IPFS link from v1.0.0 release notes, but now (November 2024) it appears to be gone, unfortunately

“For many who venture into the crypto land, the Uniswap villages continue serve as the first step on their journey” — for an analysis confirming this, see this blogpost. (A. Adams. “New onchain? 80% of wallets make their way to Uniswap on day one”, 2024)

--

--