Uniswap is one of the prominent DeFi protocols in the crypto sphere. It has seen unprecedented growth in its user base, having grown by nearly four times in 2020 alone. Uniswap currently has the second-largest number of users (roughly 82,000).

DEXs used to be associated with subpar user experience and thin order books. But today, permissionless trading platforms like Uniswap have evolved to become marketplaces with high liquidity that enable token swaps with just a few clicks. In fact, DeFi DEXs are so good that they are already competing with large centralized crypto exchanges in market share.

Uniswap allows anyone to list any ERC-20 token as long as they have a web3 wallet and can provide liquidity for the token. And with the release of Uniswap V2, the exchange has now been upgraded and features new functionality like flash swaps, ERC-20/ERC-20 pairs, pricing oracles, etc.

And no DeFi guide is complete without a ‘How to make money section’ so be sure to read until the end.

Background

Hayden Adams

The Uniswap protocol was founded by Hayden Adams, an Ethereum developer. He received a grant of $100,000 from the Ethereum Foundation to build a DEX with a team of less than ten.

Uniswap was launched in November 2018 and has gained significant traction in less than two years of operation.

In April 2019, the team was able to secure a $1 million seed round lead by Paradigm, which allowed them to build Uniswap’s second iteration which was launched in May 2020.

What is Uniswap?

Uniswap is an open-source protocol for swapping ERC-20 tokens and runs on the Ethereum network. It consists of a series of smart contracts that allow anyone to directly trade with other users on the Ethereum chain. In this regard, Uniswap is technically a decentralized exchange (DEX).

In contrast to centralized exchanges that take fees for profit, Uniswap is a public tool that rewards its fees to community members (liquidity providers). These liquidity providers support and maintain the exchange by locking up tokens to allow others to trade in a decentralized system.

And like all DEXs, the platform requires no registration nor any KYC and AML compliance procedures. All you need is a web3 wallet like MetaMask.

What sets Uniswap apart from other DEXs is the use of the pricing mechanism called the “Constant Product Market Maker Model.”

Instead of specifying the price to buy and sell at, users need to choose an input and output token as the exchange provides a market rate. Therefore, the exchange can provide liquidity at all times since the price of a particular cryptocurrency would simply rise asymptotically as the desired amount for it rises.

Router contracts are deployed to enable as many pairs as possible. If two ERC-20 tokens do not have a direct pair, these router contracts will still be able to get them swapped as long as there is a path between them via multi-step swaps.

Uniswap Exchange

The Uniswap DEX can be accessed by going to https://app.uniswap.org and connecting a web3 wallet. The perks of being a DEX is that it doesn’t require you to deposit coins to trade since you can do it directly via a wallet.

The exchange interface is simple and intuitive. You have three main commands: Swap, Send, and Pool.

The Swap option is for trading. For instance, if I want to trade my FUN tokens for SNX (Synthetix tokens), I must choose FUN from the drop-down list and input the amount. Then, I choose SNX on the next drop-down list at the bottom.

It turns out that I’m gonna get at least 1.082 SNX if I give away 787 FUN. As you can see on the bottom part there is the ‘price impact’ and the liquidity provider fee.

The price impact is the difference between the market price and the price given to me based on the size of my trade. Since my trading amount is merely $3, it doesn’t impact the price much.

If you look further below you could see the trade route from FUN to DAI to USDC, and ultimately SNX. This is an automated mechanism that determines the most optimal token routing that would give you the best price for your trade.

The ‘Send’ option is basically is similar to withdrawing funds. It allows you to send any of the tokens connected to your web3 wallet to any compatible address or ENS name.

Although you can do the same thing with just your web3 wallet, the Uniswap platform has the option to add a token to swap when sending. For instance, if you only have FUN tokens and you’d like to send some Enjin tokens to your friend, you could do so automatically with the exchange.

Simply click the ‘Add a swap’ button and choose your desired output token. In this example, I’ll choose ENJ.

With FUN and ENJ, the price impact is merely 0.03%. However, the liquidity fee or exchange fee is the same regardless of the amount.

Adding Liquidity

The ‘Pool’ option enables users to become a liquidity provider.

Uniswap does not contain order books like most DEXs. Its liquidity is maintained through a liquidity pool. Anyone can become a liquidity provider for a token pair by simply depositing equal amounts of each token in exchange for token pools.

For instance, if you want to deposit FUN and DAI pairs; 1 DAI is equivalent to 268.68 FUN. So if you want to deposit 3 DAI, you need to also deposit 806 FUN to balance it out.

Start by clicking the ‘Join a pool’ button and choose a pool or input a token on the search bar to find your chosen pair. In this case, I’m looking for FUN/DAI.

After choosing your pool, input the amount you’d like to deposit and click the button to add liquidity. This will trigger a confirmation on your Metamask, so be sure to confirm it.

Once you have successfully added to the pool, you will receive a proportional amount of pool tokens. These tokens will track your pro-rata shares of the total exchange reserves, which can be used to redeem your deposits anytime.

Uniswap V1

Uniswap V1 was the old version of the protocol launched in November 2018. It is still in operation and will remain that way as long Ethereum exists.

The drawback with V1 is that it requires liquidity providers to deposit an equivalent value in ETH for every token they add to a pool. As a consequence, they would have to be exposed to Ethereum’s volatility on top of their deposited token’s. Furthermore, all liquidity pools are between ETH and a single ERC-20 token only.

Uniswap V2

After realizing that pooled automated liquidity technology’s potential was bigger than they’ve previously conceived, the Uniswap team raised a seed round to build a dedicated team to develop Uniswap further and bring it to the next level.

Uniswap V2 is the second iteration, as well as the new and improved version of Uniswap which offers various new features and improvements. And the most noteworthy of them all is likely the implementation of ERC-20/ERC-20 liquidity deposits.

As you have seen from the previous examples above, Uniswap now allows any ERC-20 token to be pooled directly with other ERC-20 tokens.

Fees

The exchange has a trading fee of 0.30% for every token swap. But instead of going to Uniswap, the fees will be rewarded to liquidity providers as a reward for providing liquidity. Additionally, a user will also need to pay gas since the protocol runs on the Ethereum blockchain.

How to Make Money Yield Farming on Uniswap

In order to make money from Uniswap, all you need to do is become a liquidity provider. We’ve already detailed the steps in becoming one above so let’s talk about how much you could earn.

The 0.30% fee is divided to all liquidity providers of a particular pool. For instance, if you provide 25% of the liquidity for FUN/DAI pools, you earn 25% of the collected fees. And these fees are added back into the liquidity pool.

How to track collected fees

After adding liquidity, you’d want to track how much you’ll earn. To do that, you need to visit uniswaproi.com and create an account. Once that’s done, enter the address you’ve used to deposit liquidity to the pool on the Home page.

Then click ‘Analyze ROI’. The system will process your liquidity position and display them on the summary table.

Click the address on the table to access the page analyzing your address’ ROI and other KPIs.

You can check this page regularly to view how much you are making from your collected fees. And that’s it! You can watch your money grow.

Cashing out

By the time you think you’ve earned enough or simply want to take profits, you can withdraw your liquidity and fee earnings on uniswap.exchange/pool. Connect the web3 wallet you’ve previously used to deposit the liquidity and it will automatically detect your pool.

Click the down arrow to access the information details. This will give you the option to Add or Remove liquidity. Simply click Remove and confirm it in your web3 wallet when prompted.

Flash Swaps

Another update from Uniswap V2 is flash swaps, which allow users to withdraw as much as they want from the exchange with no upfront cost. However, Uniswap does require you to meet any of the following conditions:

  • All withdrawn ERC-20 tokens will be paid.
  • A percentage of ERC-20 tokens will be paid while the rest are returned to the pool.
  • All withdrawn ERC-20 tokens will be returned.

The only downside is that flash swaps incur a fee of 0.3% even if the input ERC-20 tokens are returned.

Flash swaps are amazingly favorable since they eliminate upfront capital requirements and other constraints when doing multi-step transactions on the protocol.

Arbitrage

One use case for flash swaps is that it provides opportunity for leverage with upfront capital. For instance, let’s say you want to swap 200 DAI to 1 ETH on Uniswap then sell the 1 ETH on Oasis for 220 DAI.

You want to make a profit of 20 DAI but the problem is that you don’t have any DAI in your wallet to begin this operation. Fortunately, flash swaps allow you to concurrently withdraw 1 ETH from Uniswap, exchange it for 220 DAI on Oasis, and pay for the ETH on Uniswap with your newly-purchased DAI. Now you have an arbitrage profit of 20 DAI.

Price Oracles

Another new functionality has been added in price oracles under the implementation of Uniswap V2. This tremendously strengthens Uniswap’s price feeds, making them more decentralized and manipulation-resistant.

The price oracles measure prices when they are expensive to manipulate, as well as accumulate historical data. As a result, external smart contracts are able to create gas-efficient and time-weighted averages of Uniswap prices.

Every pair calibrates the market price at the start of each block on the Ethereum blockchain, making it hard to manipulate. This requires an attacker to create a bad trade at the end of the previous block to set a measured price that is out of sync with the real market price. And this gives them no guarantee that they could arbitrage it back in the next block.

Conclusion

As exchange regulation and KYC requirements become too stringent, there is a growing demand for DEXs like Uniswap where anyone can directly trade tokens using only a web3 wallet and without the need to create an account. This is all thanks to the liquidity providers that are locking up their assets in pools so that others could use them to trade.

As long as liquidity providers are incentivized to provide liquidity in Uniswap, the DEX can continue its operation even if the Uniswap team disappears.

However, Uniswap has one main drawback, which is the fact that only ERC-20 tokens are supported. If you want to trade BTC, they have to be locked up in Ethereum contracts and become wrapped BTC (WBTC) first.

All in all, Uniswap has proven itself to be a phenomenal DeFi platform. It has a great track record and a growing user base. We’ll see if it can gain as much traction in the next few months or years.