Uniswap: Immutable Crypto Trading Platform
Author: Chahat
Uniswap is a breakthrough technology that has resolved the matter of liquidity and pushed the usage of DeFi to new heights. It allows exchanging Ethereum-based tokens directly while leaving all the problems of centralized exchanges behind and allowing users to interact completely decentralized.
What is Uniswap?
The Uniswap protocol is a peer-to-peer system to trade cryptocurrencies (ERC-20 tokens) on the Ethereum blockchain. It is defined by immutable, non-upgradable, persistent smart contracts running on Ethereum and is also designed to enable trades without reliance on any intermediaries. The Uniswap protocol is designed to be censorship-resistant, secure, and self-custodial.
And what enhancement is offered with all this?
Well, as a result of these design principles, the Uniswap protocol will operate perpetually with 100% uptime, provided the Ethereum network continues to work.
For more clarity around the fundamentals around Uniswap, here is an overview of its different areas:
- Uniswap Labs: The business responsible for creating the web interface and the Uniswap protocol is called Uniswap Labs.
- Uniswap Protocol: The Uniswap Protocol is an automated market maker that enables peer-to-peer trading and exchanging ERC-20 tokens on the Ethereum blockchain. It consists of a collection of persistent, non-upgradable smart contracts.
- Uniswap Interface: A web interface that makes it simple to communicate with the Uniswap protocol.
- Uniswap Governance: A governance framework for the Uniswap Protocol that is made possible by the UNI token.
How is Uniswap protocol better than a regular market?
Most openly accessible markets employ a central limit order book method of trading.
What is it?
In the central limit order book, buyers and sellers create orders arranged by price level that is gradually filled as demand changes. A system known as an order book will be familiar to everyone who has traded equities through brokerage houses.
Instead of an order book, the Uniswap protocol employs an Automated Market Maker (AMM), also known as a Constant Function Market Maker.
And what is its benefit?
At a very high level, an AMM substitutes a liquidity pool of two assets that are both valued concerning one another for the buy and sell orders in an order book market. The relative prices of the 2 assets change as they are exchanged, and a new market rate for each is established. Rather than dealing with specific orders placed by different parties, a buyer or seller in this dynamic deals directly with the pool.
Wondering about what else there is to make Uniswap a better option? Here is what is more to it!
The immutable and permissionless Uniswap protocol is the second departure from conventional markets. Anyone may freely trade, offer liquidity, or establish new markets. Traditional financial services usually limit access depending on a person's location, level of money, and age.
Additionally, the protocol is immutable, meaning it cannot be upgraded. No party can reverse trade execution, pause contracts, or alter the protocol's behavior.
Here is the number of all-time trades and trade volume of Uniswap as of 1st September 2022:
Understanding Uniswap's Smart Contracts
The Core and Periphery of Uniswap, a binary smart contract system, comprises several libraries.
- Core: One factory, a pool deployer, and all the pools the factory will produce make up the core. All parties interacting with Uniswap are provided with fundamental safety guarantees through core contracts. They specify the pools themselves, the rationale behind how they are generated, and the interactions between the various assets contained within. The core contracts have given gas optimization much thought and consideration.
- Periphery: The periphery is a collection of smart contracts created to support interactions with the core that are specialized to a given area. The contracts listed below have no special privileges and are only a small subset of all feasible periphery-like contracts because the Uniswap protocol is a permissionless system.
Here is a list of libraries included under Core and Periphery:
- Factory: The logic for creating pools is defined by the factory.
- Pools: Pools generally act as automated market makers for the paired assets. They also reveal price oracle data and can be a source of assets for flash transactions.
- SwapRouter: The swap router complies with all the fundamental specifications for a trading front-end. Both single trades (from x to y) and multihop transactions are supported natively (e.g. x to y to z).
- Position Manager (Nonfungible): The position manager manages the logic transactions involving the creation, modification, or departure of positions.
- Oracle: Available in every deployed pool, oracle offers price and liquidity data helpful for a wide range of system architectures.
- Peripheral Libraries: The libraries offer a range of support tools that programmers may require, including safe transfer routines, pool address calculation, and more.
Uniswap $UNI
Governance over the Uniswap protocol is the primary function of the UNI token and, thus, the funds within the treasury.
Another aspect of UNI's utility could also be a possible revenue share. The governance contract contains a fee switch that, if activated, will enable UNI holders to earn a number of the protocol's fees.
Community AirDrop and UNI mining initiated UNI token launch. This happened in Sept 2018. The genesis supply for UNI is 1 billion.
Governance
Uniswap governance has access to several governance venues, each with a specific function.
- uniswap.org: A Discourse-hosted forum for discussions about governance is located at gov.uniswap.org. Before sharing or liking posts, community members must register for an account. Before they are allowed to post themselves, new users must enter four subjects and read 15 posts over 10 minutes.
- Snapshot: Users of Snapshot's straightforward voting interface can express their feelings off-chain. The number of UNI delegated to the voting address determines how heavily votes on Snapshot are weighted.
- Governance Portal: Through the Uniswap app interface, one may easily access the formal governance portal. The site is used to delegate and cast votes.
What is Timelock, as depicted in this image?
The Timelock contract allows for the 'time-delayed, opt-out' modification of system parameters, logic, and contracts. The smallest amount of notice that can be given for a governance action is 2 days; the minimum delay Timelock has hard-coded. Every suggested course of action will be made public at least two days after it is announced. Upgrading the risk management system may take up to 30 days. The governance module manages Timelock, and the Timelock Dashboard allows users to keep track of ongoing and finished governance operations.
#NOTE: Uniswap Governance has the authority to direct a portion of the swap fees for any pool to a specific address. However, all participants are aware of this potential beforehand, and to prevent abuse, the percentage is restricted to 10% to 25%.
How to swap on Uniswap?
The most popular way to use the Uniswap protocol is through swaps. Swapping is simple for users: they choose an ERC-20 token they own and another token they want to trade it for. When a swap is carried out, the tokens already possessed are sold for the proportionate quantity of the requested tokens, less the swap charge, which goes to liquidity providers.
To do this, the users must hold some Ethereum in their wallet for transaction fees and something to trade on Uniswap. Below we will cover how to swap on Uniswap:
- Step 1: Wallet connect - First, go to the Uniswap platform, click on the top right corner Connect to a wallet; this will automatically pop up the wallet window; you can connect with any wallet like metamask, wallet connect, coinbase wallet, fortmatic or portis wallet.
- Step 2: Once logged in to the wallet, You can swap between different tokens.
- Step 3: You can choose how much you want to spend or how much to buy. Enter how much you want to spend ETH to buy, for example, UNI token. In this example, we'll buy 0.1 ETH worth of UNI tokens.
- Step 4: At the bottom, you will see how much you can receive from this order. If you are happy with these numbers, click the Swap button. Then your wallet prompts you to confirm the trade and add some transaction fees that will suit your transaction.
- Step 5: The last step, confirm the transaction, and it will be processed. Finally, your UNI token will appear in your ERC20 wallet.
Understanding Range Orders
By offering a single asset as liquidity within a specific range, Uniswap enables one to approach a limit order. The target asset may be withdrawn once the spot price has crossed the full range of the order, much like traditional limit orders, which are established with the intention that they would execute at some point in the future.
In contrast to some markets where limit orders may be subject to fees, the creator of range orders makes money as the order is filled. This is because, rather than being a standard swap, the range order is technically a sort of liquidity provisioning.
How to provide liquidity on Uniswap V3?
In Uniswap, LPs can "concentrate their capital within custom price ranges, providing greater amounts of liquidity at desired prices."
It gives options to LPs regarding what price range they want to provide liquidity so that LPs generate the highest returns.
- Select pair
The first step, shift to the pool section and click on "new position". This will travel to another screen, and there you can see the pair option. Select the pair that you want to provide liquidity for.
Each pair has different characteristics like trading volume, risk factor etc. You will see these after the selection of the pair.
2. Review Fee Tier
After selecting the pair of tokens, the next task is select the right fee tier.
- 05% fee tier: Ideal for stablecoins - Liquidity provider takes the minimal risk, and traders pay minimal fees
- 3% fee tier: Ideal for most pairs - 0.3% fee tier is ideal for less correlated token pairs like ETH-DAI. Which has significant price movements to the upside or downside. 0.3% fee has a greater price risk for LPs than they take on stablecoin LPs.
- 0% fee tier: Ideal for exotic pairs - This fee tier is ideal for exotic pairs like ETH-GTC, where LP wants to take extreme price risk.
Uniswap will auto-select the fee tier with the most liquidity. If you are new to the liquidity provider, we recommend choosing the auto-select fee tier.
3. Set Price Range
Next, you would like to settle on a price home in which to supply liquidity. When making a price range decision, you ought to consider the degree to which you think prices will give way over your position's lifetime. You ought to also consider your willingness to actively manage the position because the market evolves, and therefore the economics of transactions required to manage an edge actively.
Your position will be stable in one of the two assets, and you'll not earn trading fees until the worth returns to its Range if your price range is outside of the worth.
You can provide liquidity with the complete Range by clicking the complete Range button. However, your rate of return will be significantly less than an identical position with a more narrow price range.
4. Deposit Amounts
With your fee tier, pair, and price range selected, you'll now decide what proportion of capital to contribute to the present position. Enter a worth in one of the 'Deposit Amounts' boxes; therefore, the other box will automatically populate the corresponding amount. The ratio of those two fields is predicated on the position of your price range around the market value. If your price range skews more towards the market value's one side, then you'll provide more of that asset. This will be okay -- it's not necessary to focus on a 50/50 ratio though a few strategies may choose it.
You can adjust the ratio by sliding the worth range left-right along the chart or dragging the min or max price boundary. The deposit amount you simply typed in will remain fixed, while the second asset amount will suit the new ratio supported by your new price range.
If you choose a price range that doesn't include the present market value, then you will only get to provide one asset rather than both.
5. Approve and Add
Finally, you're able to submit the transaction. First, you'll get to approve the Uniswap router contract to spend tokens on your behalf, and this is often only necessary when you provide liquidity with a token.
Once the approved transaction has been confirmed, you'll press preview, review the transaction details, and then click increase to trigger the transaction in your wallet.
Congrats! Once that transaction is confirmed, your assets now provide liquidity to Uniswap traders, and your position is earning fees. You'll monitor and manage your position on the Pool page.
Conclusion
With Uniswap's impressive growth and, therefore, the development of V3 within the pipeline, it's likely to continue moving ahead of the foremost valuable platforms in Web3. If the protocol's fee switch (enabling UNI holders to earn some of the trading fees) is activated - which it almost certainly will be - the potential for sizable ongoing returns for UNI holders is extremely real.
Subscribe to receive Alpha!
Join 4.3k subscribers from renowned companies worldwide and get a weekly update in your inbox. Stay updated on the latest and finest projects and product updates.