Uniswap is, in my opinion, the most interesting company in decentralized finance(DeFi). Already the leading decentralized exchange (DEX) by market share last year, it survived the infamous SushiSwap “vampire attack,” and has continued to release noteworthy product innovations since, including becoming a decentralized autonomous organization (DAO).
What is the full story of this leading DeFi player? What lessons can we take for building web3 companies? Strap in, as we journey through 12 lessons about buidling - spelling intentional - for web3.
2016
Like many things in crypto, our story starts with Vitalik Buterin. The founder of Ethereum, and prolific writer, published a Reddit post, “Let's run on-chain decentralized exchanges the way we run prediction markets.” The post sports a mere 132 upvotes, a far cry from even your C+ meme.
Such is the nature of historic innovation. The rewards go to those who pay attention.
One person paying attention was Karl Floersch. At the time an engineer working at ConsenSys, Karl read the post and filed the ideas away. He, too, felt that decentralized exchanges on Ethereum could be improved.
At the time, the leading decentralized exchange on Ethereum was EtherDelta. EtherDelta was based on the order book model. This is how Coinbase and Binance, the NYSE and NASDAQ, as well as all the leading global exchanges, operate. In the order book model, buyers come together with sellers, and trades happen when both parties converge on a price. Sellers try to sell for as high as possible. Buyers try to buy the same asset for as low as possible.
What if there’s no one willing to place orders at a fair place level? This is where market makers come into play. They facilitate trading by always being willing to buy or sell the particular asset. This helps users to always be able to trade, without having to wait for another party to show up.
The problem is that the order book model on a layer 1 protocol like Ethereum is slow and expensive. Eth v1 can only handle 12-15 transactions per second with a 10-19s block time, plus has high “gas” fees. This is too expensive and slow for significant market makers to operate. As a result, as Vitalik wrote, spreads become wide: up to 10-15%. That, a liquid market, is not.
Despite the challenges, EtherDelta was one of the most popular exchanges by the end of 2016. Permissionless and decentralized trading, where anyone could trade anything, proved too important an offering to be deterred by slow transactions with high fees.
2017
As the great Initial Coin Offering (ICO) boom kicked off in 2017, EtherDelta was the place to be. It was one of the first and most liquid places for the long tail of new coins being put into the market. At this point, decentralized exchanges clearly had an important place in the trading market. But, the user experience was not quite there.
One protocol that attempted to solve the problems with EtherDelta was Bancor. The important innovation of the Bancor protocol was that it utilized smart tokens to create a liquidity mechanism. Its ICO raised a record-breaking $153M. Using its BNT token, it had created a second layer scaling solution on top of Ethereum that avoided the gas fees and scaling issues associated with EtherDelta. It was briefly the talk of the town when it came to Ethereuem DEXes.
Lesson 1: Take the Leap and Embrace the Future
Concurrent to this boom in ICOs in 2017, the old world company Siemens - founded in 1847 - was not humming in every business segment. Several hundred mechanical engineers had to get the axe. Hayden Adams was one of them.
Hayden turned to texting with his friend, Karl Floersch. In this story, Hayden is the Karate Kid and Karl is Mr. Miyagi. Mr. Miyagi showed the Kid the future:
Mechanical Engineering is a dying field. Ethereum is the future and you’re still early. Your new destiny is to write smart contracts!
And the kid listened!
Lesson 2: Anyone Can Build for web3
A mechanical engineer by training, not a software engineer, Hayden was worried. “Don’t I need to know how to code?” he asked Karl. Karl’s response: “Not really, coding is easy. Nobody understands how to write smart contracts yet anyway.” So Hayden spent the next two months learning the basics of Ethereum, Solidity, and Javascript.
Right around the time Hayden was fired, Vitalik published on the automatic market makers concept again. This time, instead of suggesting improvements to EtherDelta, Vitalik was suggesting improvements to the way Bancor worked. It left room for improvement in both market maker efficiency and market exploitability.
As history has shown again and again, there is a lot of money to be had building what Vitalik suggests.
On Karl’s suggestion to graduate from getting his feet wet to working on a real project, from October to November, Hayden set out to build a proof of concept of the automatic market makers Vitalik described. Instead of serving as market maker, the project used the concept of liquidity pools. Liquidity pools are a Constant Product Market Maker. They utilize a smart token pool locked in a smart contract to facilitate trading and provide liquidity.
When Karl, by this time a figure in the Ethereum scene and acquainted with Vitalik Buterin, told Vitalik that Hayden planned to name the project Unipeg, Vitalik replied,
Unipeg? it sounds more like a Uniswap
And so Uniswap was born.
In two months, Hayden released the still functional demo of Uniswap. It had a single liquidity provider and simple swaps. Hayden had turned his learning about smart contracts and javascript into a fully functioning open source web app using the blockchain.
It is a remarkable story of Zero to One. Hayden and the early Uniswap prototype exemplify the message, “anyone can build for web3.” As Karl said, because the tech is so new, no one is particularly great right now anyways. So the only difference is programming knowledge, not context knowledge.
The initial version of Uniswap had a better automated market maker implementation than Bancor. It was 10x more gas efficient and used Ethereum as a common pair. Because the technology was so new, a single 25 year old in New York was able to go up against the hundreds of millions in funding behind Bancor.
Lesson 3: Engage With the Community
The next steps were to expand beyond a single ETH/ERC20 pair, and work with more than a single liquidity provider. In a talk at that year’s Ethereum developer conference (Devcon 3), Karl gave a talk on the power of programmable incentives and Cryptoeconomics. In it, he used Uniswap as an example.
An attendee at Karl’s Devcon talk, Pascal Van Hecke, would come to be an important number three on the Uniswap team. Pascal started by giving Hayden a grant to fund the next month of his work. The two then held weekly calls to discuss progress.
Not only did these provide a sense of structure and accountability for the nascent Uniswap project, Pascal was an experienced engineer. He had co-founded Token Engineers and added another dimension of expertise to the project. Together, the two had extended Uniswap to multiple tokens and liquidity providers. Score 1 for engaging with the community.
Then in December, Hayden attended a NYC Mesh meetup with Karl. By this time Karl was famous in the crypto world and extensively quoted by a Coindesk reporter at the event. But Hayden also created the opportunity to chat with the Coindesk reporter himself. He was mentioned as “actively looking into how the meshcoin concept would operate”.
As a result, a friend of Hayden’s from elementary school reached out, Callil Capuzozzo. A designer at Microsoft and Google, he was able to quickly diagnose the next problem for Hayden to work on: front end design. Callil would go on to be a very important founding teammate of Uniswap.
Because of Hayden’s attendance of a meetup - yes, those horrible in-person events most developers loathe going to - he was directly connected to his next team member. Score 2 for engaging with the community.
Lesson 4: Prioritize Security First and Foremost
In December of 2017, EtherDelta was hacked. The hackers accessed the exchange’s DNS server, and replaced its web domain with a fake. When users traded their tokens, they went into the wallet of the hacker. Users were ultimately scammed for $800K. The founder, Zachary Coburn, was also unfortunately charged by the SEC for operating an unregulated security exchange. He settled for $400K. This further opened up space for a new leading DEX.
2018
Then, in July of 2018, Bancor was hacked. A wallet on its network was compromised, leading to the theft of $12.5M of ethereum and $1M of altcoin Pundi X. Immediately, it was compared to Mt. Gox, EtherDelta, and Coincheck. Once a reputation is compromised, it is hard to get it back. A further space was opened up in the DEX world.
On the other hand, Hayden kept building Uniswap’s reputation. Till this date, it has not had a hack or breach. Throughout the rest of the story, you will see Hayden’s consistent emphasis of security over speed. When building for web3, prioritize security first and foremost. One breach is enough to forever tarnish your reputation.
Lesson 5: Solve a Big, Unfulfilled Goal
In January of 2018, Hayden and Pascal had worked out the major smart contract issues. Uniswap supported multiple tokens and liquidity providers. Hayden reconnected with Calil, who helped design a sleek new interface for Uniswap. When it was clear that Hayden’s front-end code needed to be refactored, Hayden worked with his college friend Uciel to rewrite the front-end.
By March, Hayden, Calil, and Uciel had built a fully featured demo of Uniswap. But by this time, Hayden had been working on the project without a steady income for 10 months. After the great crypto crash of late 2017, his portfolio was down 75%. Despite the circumstances - including having never left the US in his 24 year life - he “yolo-bought” a last minute flight to Seoul, South Korea for the Decentralized Economy Conference (Deconomy 2018).
Unable to afford a ticket to the conference itself, he was rejected at the gate. The scene was set for a Hollywood-level disaster.
Instead, it had a Hollywood turnaround. Karl arrived and introduced Hayden to none other than Vitalik Buterin. Karl mentioned Hayden had built Uniswap. Vitalik asked if it were open source. Upon hearing it was, he asked for the URL. Without saying a word, Vitalik read the salient points of Uniswap’s github - on his phone, quickly. Then he provided the next steps for Uniswap:
Have you considered writing it in Vyper? Also, you should apply for an Ethereum foundation grant.
Immediately after returning from Seoul, Hayden rewrote the Uniswap smart contracts in Vyper. Unlike Solidity, Vyper had no guides or developer tools. At the time, there was only one complex example in the core Vyper repo. So he used that as an example to rewrite Uniswap.
The productiveness of Hayden’s meeting with Vitalik would not have been possible without Hayden having worked on a big, unfulfilled problem that Vitalik had written about. Uniswap was designed with the ideals Vitalik cared about in mind - censorship resistance, decentralization, permissionless, and security. To create serendipity with the founder of the blockchain you are building on, virtually a must to build an industry leading project, build things they will care about.
The world becomes smaller when you are building important things.
The story continues with 7 more lessons, one click away:
Hope you enjoyed this week’s deep dive. Hit reply with any questions. I also wrote four short form pieces this week. And I finish up with my top Tweet of the week:
Top Solana Gaming Projects
Today, an all star consortium of investors announced a $100M fund dedicated to Solana gaming. This is a big deal. It can kickstart blockchain gaming on Solana significantly. The investors, including FTX and Lightspeed, represent the cream of the crop in crypto investing.
Here are three of the top Solana gaming companies to watch.
The Rivian Story: From Founding to $55B IPO in 9 Years
Nissan Deliveries 2020 – 4.1M. Market Cap – $20B.
Kia Deliveries 2020 – 2.6M. Market Cap – $30B.
Hyundia Deliveries 2020 – 3.7M. Market Cap – $44B.
Rivian Deliveries 2020 – 0. IPO Market Cap – $55B
A breakdown of the 4th largest IPO ($RIVN) of the decade.
PolicyBazaar: 25% of Any Market is Amazing
This Softbank backed Indian InsurTech play is going public – don’t you want to know the story? Last year alone, it recorded 126 million unique visits to its website.
From Soccer Star to $2B IPO
In 2012, Tim Brown retired after 6 years as a professional soccer player. This week, his company IPOd for over $3B. What a story.