Uniswap is arguably the most popular decentralized exchange (DEX) on the Ethereum network, boasting over $2.7 billion in total value locked (TVL) at the time of this writing. To be more specific, Uniswap is an automated market maker (AMM). It allows anyone to swap ERC-20 tokens without having to find a buyer or seller on the other side of the trade.

Through being a DEX, people can use Uniswap in a trustless manner. They don’t have to deposit their funds or KYC identity documents to a central server where they can be hacked. After all, hackers do break into centralized exchanges (CEXs) quite often. So, to its credit, Uniswap has never had a hack or major bug inflict damage to its protocol. This has led to ever-increasing trust and has helped Uniswap vault to the top of the DeFi Pulse rankings.

The decentralized finance (DeFi) sector is hotter than ever, and Ivan on Tech Academy is your guide to all things blockchain-related, such as DeFi. What’s more, Ivan on Tech Academy has a wealth of cryptocurrency and blockchain courses ready for you. Dive in! 

How Does Uniswap Work?

Users get to exchange ERC-20 tokens because of Uniswap’s global liquidity pools. If a user wants to swap ETH for DAI, for example, a pool of ETH and DAI exists to handle that trade. Hence, there is no need for the traditional order books or bid/ask spreads that the typical exchange uses to accommodate traders.

Uniswap’s protocol design employs the Constant Product Market Maker Model (CPMMM). It does not eradicate price slippage but it does ensure the pools have plenty of liquidity. It’s a bit complicated for this article, but you can read more about the CPMMM if you’re interested.

History of Uniswap

Uniswap proved that you can launch an amazing DeFi protocol without a million-dollar ICO launch. Back in 2018, founder Hayden Adams set out to improve the messy UI of EtherDelta, the reigning DEX at the time. He learned to code and started building a decentralized liquidity market. That’s how Uniswap came into being without a lot of hype, fanfare, or funding. 

After experiencing slow but steady growth in its first year, Uniswap took off in 2020 fueled by the Yield Farming rage. 

Liquidity Providers on Uniswap

However, users can do more with Uniswap than simply swapping ERC-20 tokens. They can also provide liquidity. To become a liquidity provider (LP), users must fund a pool with an ERC-20 token and an equivalent amount of ETH. So, if the price of ETH is sitting at $400 and DAI is pegged at precisely $1, a user would have to kick in 1 ETH and 400 DAI to the ETH-DAI pool.

Now, when traders come along, Uniswap essentially balances out the tokens in a pool based on the demand from users to buy and sell them. Thus, any ERC-20 token can be listed and traded on Uniswap based on their CPMMM equation x * y = k. The characters, “x” and “y” represent the amount of ETH and ERC-20 tokens in a pool and “k” is a constant. 

So, if a user comes in to buy ETH with DAI, the supply of ETH will go down causing its price to rise. At this point, the protocol incentivizes LPs to provide more ETH to rebalance the pool. 

LP (Pool) Tokens

When liquidity pools – or LPs – provide liquidity, they receive pool tokens in exchange and they earn LP fees. Each pool token represents the LP’s share of the pool’s assets along with the trading fee percentage. So, these LP tokens are generated whenever funds are deposited into a pool. LPs can then trade these tokens or move them to other exchanges. And when an LP decides to reclaim their funds, their pool tokens are burned.

So, users can use Uniswap to swap tokens or to provide liquidity to a pool. It’s fast and simple. Users just select the tokens to swap and then approve the transaction. There are no forms to fill out nor is there a central authority to censor or approve the trade. 

Uniswap Version 2.0 (V2) 

V2 launched in May 2020, adding a host of technical improvements such as:

  1. Direct ERC-20 to ERC-20 swaps
  2. Lower Gas Fees
  3. Increased Token Support
  4. Flash Swaps (which are similar to Flash Loans)

V2 provided a lot of improvements that launched Uniswap out of the reach of its competition. However, despite all the success surrounding V2, some community members expressed discontent with the lack of decentralized governance. Also, some LPs complained of meager sized rewards. Especially with so many lucrative opportunities popping up all over the DeFi ecosystem. 

The Launch of SushiSwap

Then, at the end of August, seemingly out of nowhere, SushiSwap appeared. Spearheaded by “Chef Nomi,” SushiSwap forked off of Uniswap to ride the wave of Yield Farming hype. 

SushiSwap promised to be a community-governed AMM with SUSHI as its governance token. Taking advantage of Uniswap’s lethargic steps to provide a decentralized governance token, they launched their SUSHI token and divided it up amongst stakers.

LPs earned SUSHI token rewards by providing liquidity into a pool—nothing new there. However, unlike Uniswap, SUSHI tokens granted users a portion of the protocol fees whether they provided liquidity or not. This incentivized early adopters to become significant stakeholders. In an early tweet, SushiSwap promised 0.25% to LPs, and 0.05% to SUSHI holders. 

SushiSwap Finds a Vulnerability

SushiSwap denied that their project intended to steal all of Uniswap’s liquidity, even though their actions spoke louder than their words. However, despite the looming threat to their liquidity pools, Uniswap felt secure in their position at the top. After all, they were the largest and most popular DEX. 

So, initially, it seems that SushiSwap’s fork was not taken seriously. This laissez-faire attitude led to a failure to innovate. Nor did it inspire the Uniswap team to fast track a decentralized form of governance. Instead, they seemed content to carry on brand building. 

But SushiSwap’s strategy was based on a vulnerability in Uniswap’s liquidity model. To gain control of Uniswap’s liquidity, they first had to gain control of Uniswap’s LP tokens. So, they made SUSHI liquidity mining contingent upon staking Uniswap LP tokens. It meant that SushiSwap’s users could earn SUSHI by staking their Uniswap LP tokens.

So, is it ethical to copy someone’s code, tweak the UI, and throw in a governance token, and then harvest their liquidity to boot? Well, that is basically what SushiSwap did. And whether people think it was ethical or not, the pejorative label, “Vampire Mining,” says a lot.

First to Be Second

A harsh dose of liquidity migration followed on the heels of the vampire mining strategy. This must have been a scary time for the UniSwap team. Possessing great technology is one thing. However, without a unique rewards program to keep the faithful LP token holders on board, the circling bystanders stood a chance of draining their luscious liquidity pools.  

“Be the first to be second,” has been a long-standing saying in Hollywood. Creative movie studios love to be the first to snatch up that dynamite script or innovative filmmaker to churn out the next blockbuster—or maybe even an Academy Award!

However, uncreative studios don’t bother with all that hassle. They just look for what’s hot and quickly churn out a “knock off” film to ride the wave of popularity. It’s a lot easier to copy what someone else has done than to create it from scratch.

SushiSwap appears to have followed that maxim. And within a week of their launch, their TVL rocketed upwards of $1.5 billion. This caused SushiSwap’s co-founder “0xMaki” to proudly boast, “It took Uniswap two years to get to where it is today. It only took us seven days.” 

Uniswap took a big hit. Their TVL dropped from around $1.8 billion to $400 million by early September. It was an outrageous hit and some wondered if the days of Uniswap’s dominance were over.

Uniswap Hits Back 

However, one could say that a dose of food poisoning had tainted the SUSHI roll. And that poison was “greed.” Luckily for Uniswap, things began to unravel across town when co-founder Chef cashed out tokens previously earmarked for development.

Seeing all that unattended SUSHI stacking up seemingly was too much for the co-founder. Distrust quickly followed when the news broke and SUSHI’s price fell sharply.

Chef eventually repented of his deeds after some social arm-twisting on Twitter and returned the developer’s fund. But SushiSwap’s TVL continued to plummet at a near-uninterrupted pace. It fell from an all-time high of roughly $1.5 billion to a lowly $490 million in just over a week. That works out to about a two-thirds drop! 

UNI Token to the Rescue

SushiSwap’s “kick in the pants” revved Uniswap’s creative engine into high gear and the team quickly launched their UNI governance token to great fanfare. 400 UNI was airdropped to anyone who had used the Uniswap protocol before September 1st. It was one of the most high-profile airdrops of recent times, creating hype, a wave of enthusiasm, and a flurry of tweets and articles. 

Those who had used the Uniswap protocol made out well, while those who had never used it, didn’t. But the fortunate ones who had used Uniswap with multiple wallet addresses made out better than everyone. They received multiple batches of 400 UNI. 

This was Uniswap’s way of giving back to the faithful as well as punching back against SushiSwap’s vampirism. The strategy worked. The UNI token was an instant hit. Both Coinbase and Coinbase Pro quickly listed it on their exchanges and the price spiked from $1 to over $8 in a few hours. It floated back down to the $5 mark and is currently hovering around $3 on CoinGecko.  

No one likes a copycat, but there’s something about audacious competition that kicks us, humans, into gear, keeps us sharp and innovative, and prevents us from resting on our laurels for too long.  

UNI Tokenomics

Uniswap wants to unload a capped total of UNI over the next four years whereby 60% is earmarked for the community, 21.5% goes to employees and 18.5% is set aside for investors. With 1 billion UNI minted in the genesis block, the community will have to earn their 60% allocation by supplying liquidity (or other community initiatives). 

For the would-be LPs, Uniswap has four designated pools to earn UNI

ETH/USDC

ETH/USDT

ETH/DAI

ETH/WBTC 

However, to earn the same 400 UNI provided in the airdrop, a sizable amount of liquidity would need to be provided. So, the fortunate airdrop recipients are in a much better position than someone just starting as an LP. 

1 billion UNI is not the max, however. After four years, 2% inflation kicks in which ensures governance participants get rewarded. By staking and voting, users will get a share of the protocol inflation. This should be a great economic model and incentivize more community participation in governance.

So, for those who got the airdrop, it might make more sense to “hodl” rather than having to buy UNI on the open market or become an LP later. And participating in governance will be more financially rewarding than just hodling. That’s because hodlers will face the 2% inflation rate each year. 

Conclusion

Uniswap was one of the first automated market-making DEXs. And the fact that its founder accomplished so much without conducting an ICO only adds to its allure. The UNI token airdrop was an exciting event as was watching how Uniswap overcame its first vampire mining attack.

It’s survival and its return to dominance testifies to the long-term value of a trusted brand with a true community. There will always be those out to make a fast buck. But fast money is just that—fast. It comes fast and it goes fast. Uniswap has legs and it is the first DeFi exchange protocol to pass the $2 billion mark.

Uniswap’s founder learned to code and he built a phenomenal platform. Do you ever imagine what you could create in the DeFi space if you had the skills? Well, if you want to build your own amazing DeFi platform, head over to Ivan on Tech Academy and get started. There you will receive the best blockchain education available on the market today! What’s more, you can get 20% off if you enroll today using the promo code BLOG20!

Author: MindFrac