One of the places to exchange/swap cryptocurrencies is uniswap. So, What Is Uniswap and How to trade on Uniswap ?.
What is Uniswap?
Uniswap is a decentralized exchange in the form of two smart contracts hosted on the Ethereum blockchain, as well as a public, open-source front-end client. It’s a 100% on-chain market maker allowing the swapping of ERC20 tokens, as well as ETH to an ERC20, and vice-versa.
Users can interact with the exchange through multiple wallets such as MetaMask, WalletConnect, Coinbase Wallet, Fortmatic or Portis. Because Uniswap is decentralized, users can interact with the exchange without needing to trust anyone with their funds. The funds will always remain in the user’s wallet.
Uniswap also rewards users that provide liquidity on trading pairs.
Uniswap: Understanding the Decentralised Ethereum Exchange
Decentralized Exchanges (DEXs) have seen enormous growth this past year. The interest in DEXs grew because of liquidity rewards/availability, no KYC, and no need to trust middlemen to be able to trade on the exchange.
Examples of decentralized exchanges are Uniswap, Curve Finance, Compound, 0x Protocol, Cyber Network and plenty more to name. Currently, Uniswap is by far the biggest decentralized exchange.
Uniswap can be very easy to use for people that simply want to buy/sell ERC-20 tokens. For traders however, Uniswap offers various ‘advanced’ trading options that enable you to customise your trading slippage and gas fees. On Uniswap trades work via the liquidity pools. There are no order books as seen on centralized exchanges, and anyone can list their ERC-20 token on the exchange, provide liquidity and start trading. That said, it is extremely important for users to do their own research before interacting with any token.
How does Uniswap work?
Because there are no order books, pricing of ERC-20 tokens happens based on a decentralized pricing mechanism that takes into account the liquidity depth. Traders essentially trade agains automated market makers (AMMs) that hold the liquidity reserves funded by liquidity providers.
Anyone can provide liquidity, this needs to be done 50/50 to keep the pool in balance. E.g. if $2,000 in ETH were to be provided in liquidity, this user would also need to provide $2,000 in USDT. Trading pairs can be ERC-20 tokens vs stable coins, stable coins vs stable coins or basically any ERC-20 token against any other ERC-20 token.
When providing liquidity to Uniswap, a user gets UNI-V2 liquidity tokens in return. Which essentially reflect the total % of the liquidity pool you hold and therefore the % of trading fees you will earn from the total trading fee pool (0.3% of each trade).
For traders / users, Uniswap works fairly simple. For example, I want to purchase $2,000 USDT worth of ETH on Uniswap. I find the trading pair on https://info.uniswap.org/ or directly on app.uniswap.org . I fill out the number of USDT I want to swap to ETH and the number of ETH I’ll receive is automatically calculated.
I enter the amount and then hit ‘Swap’. A smart contract transaction will pop up, which I then approve and the swap will be executed through a smart contract.
After this, I will automatically receive the ETH I just purchased in my ERC-20 wallet. In this case, I use the MetaMask extension in my browser. That’s all there is to it!
- Go to https://app.uniswap.org/
- Connect with the wallet you use.
- Select the ERC-20 token you would like to sell
- Select the ERC-20 token you would like to buy
- Click on Swap
- Confirm the transaction that pops up
- Wait for the transaction to confirm, your purchased ERC-20 token will be in your wallet.
Uniswap also recently introduced their own token ‘UNI’. 60% of all UNI was distributed to early Uniswap users and liquidity providers when introduced by the team. This has covered many user’s their trading fees and many users have seen significant profits thanks to this. However, UNI wasn’t just airdropped, UNI has a strong use-case within the (future of the) platform.
The introduction of UNI can be read here: https://uniswap.org/blog/uni/
As mentioned Uniswap has a trustless and highly decentralized financial infrastructure. The UNI token allows for shared community ownership and a dedicated governance system which will guide the protocol towards the future.
The token treasury will be fully managed by the community opening up all kinds of possibilities. It’s hoped this will result in continuous growth of and benefits for the Uniswap community.
UNI holders will have the immediate ownership of: Uniswap governance, UNI community treasury, the protocol fee switch, uniswap.eth ENS-domain, Uniswap default list, and SOCKS liquidity tokens.
1% of UNI total supply (delegated) is required to submit a governance proposal, 4% of UNI is required to vote ‘yes’ to reach quorum, there is a 7 day voting period and 2 day time lock delay on execution.
Governance can be fully discussed on the Governance Forum
It is anticipated by the community the UNI token will have more use-cases after the Uniswap V3 launch.
Take a deep breath before we continue, also check this article too
What do I think about Uniswap?
As you can see, I am very active on the Uniswap governance forum. This is because I strongly believe in the future of decentralized exchanges and especially Uniswap.
Decentralized options are necessary and need to be encouraged. Uniswap is easy to use and so I could see the platform be very beneficial to attract new people to purchasing cryptocurrency.
Benefits in my opinion are:
- Easy to use
- The option to put idle assets to work by becoming a liquidity provider
- HUGE range of trading pairs
- No listing fees
Downsides in my opinion are:
- Any ERC-20 token can list on Uniswap and so there have been many scams
- Bots leeching slippage fees of unaware traders (should be fixed in V3?)
- ‘High’ trading fees because of current high gas fees on Ethereum Network + 0.3% liquidity fees.
Uniswap sounds like a big deal; being able to exchange any ERC20 token, including the native ETH token, without middlemen, and allowing anyone with an Ethereum address to contribute to the exchange’s liquidity, and thus earn from it, is no small feat.
This article will break down exactly what the exchange can do and how you can benefit from it, as well as the underlying formulas for calculating exchange rates for each token.
Uniswap Exchange at a High Level
- Uniswap is a public, open-source, non-profit project aimed to benefit the Ethereum ecosystem. The smart contracts of the project have been written in both Vyper and Solidity.
- It’s 100% on-chain. There are no dependencies required outside the Ethereum blockchain for it to operate. As a result, anyone can access Uniswap’s full capabilities using web3 and embed Uniswap functionalities within their apps as they please.
- Uniswap consists of 2 smart contracts — a “Factory” contract and an “Exchange” contract.
The Exchange contract can support any ERC20 token. But how do we set up an exchange for a particular ERC20? With one method call from the Factory.
By calling the create Exchange method from the Factory contract, an Exchange contract is then deployed for a particular ERC20 token you specify. Every ERC20 token, therefore, by design, utilizes its own Exchange smart contract
Liquidity Pools at a High Level
Liquidity pools are Uniswaps’ decentralized liquidity solution, allowing anyone to take part in them and to be rewarded for supplying this liquidity.
- Liquidity (deposits) can be freely added and removed (withdrawn) from each ERC20 Exchange contract.
- Adding liquidity to an ERC20 also requires an equivalent value of ETH to be deposited: Concretely, 50% value ETH and 50% value ERC20. In reality, this is very simple to do: Within the official front end app (Github , Live Exchange ), one simply chooses the amount of ETH to deposit and the ERC20 equivalent will automatically calculate using the current exchange rate from the contract.
Advantages and Disadvantages Of Uniswap
Advantages of using Uniswap
- Decentralized, not reliant on third parties. Anyone can connect to a Uniswap contract via web3 and create custom apps on top of them.
- Ability to create an exchange for any ERC20 token.
- Whales will most likely not target Uniswap because of the market rate equation and limitations it entails.
- Cheap to trade compared to other decentralized exchanges
- Liquidity pools where anyone can contribute, with 0.3% commissions that are split between all liquidity providers.
- It can be expanded/built upon. Custom pools can be initialized adding flexibility to developer needs.
- The front-end React app can be forked and run on test-nets, such as Rinkeby, where you can experiment with the pooling and swapping of tokens in a risk-free environment.
Disadvantages of Uniswap
- Relies on arbitrage trading to keep exchange rates in check, so there will always be a need for other forms of exchange to keep the Uniswap exchange rates balanced — (but where is this not the case?)
- Gas prices are needed to be spent to perform swaps — even more so for ERC20 to ERC20 token swaps. As Ethereum scales, (ETH2.0 sharding / Casper implementation underway) these gas prices will dramatically reduce and eventually become a non-issue.
- Still experimental. Uniswap is still under development — even their documentation is not yet complete (one of the reasons that prompted this article). The true benefits and pitfalls of the exchange will become apparent in time as usage increases.
How to use Uniswap
- Go to the Uniswap interface.
- Connect your wallet. You can use MetaMask, Trust Wallet, or any other supported Ethereum wallet.
- Select the token you’d like to exchange from.
- Select the token you’d like to exchange to.
- Click on Swap.
- Preview the transaction in the pop-up window.
- Confirm the transaction request in your wallet.
- Wait for the transaction to be confirmed on the Ethereum blockchain. You can monitor its status on https://etherscan.io/.
This article is the opinion of several people in an internet discussion forum, disclaimer on