One of the most exciting things about decentralized blockchains and protocols such as Ethereum is the promise of decentralized finance (DeFi). Not just providing another way to hold, transact, and earn - by way of smart contracts that run and execute on top of the protocol, users are increasingly offered new paradigms to be able to borrow and lend. What’s more, new instrument types are coming into existence, anchored because of the blockchain base layer (or even second layer solutions), and their Internet-native nature. These new instruments are creating a whole new financial world, or at least they have the potential to.
One of these instrument types is the decentralized exchange (also referred to as a DEX), and on Ethereum, perhaps one of the most well-known is the Uniswap Exchange, utilizing the Uniswap Protocol. A decentralized exchange is a decentralized application (dApp) that utilizes smart contracts to execute and fill trade orders of various types programmatically, without having to hold funds in a centralized clearing house or pool, theoretically minimizing the risk of that centralized account of funds being susceptible to hacking, as has been seen before, the most notable and notorious hack being that of the Mt. Gox Bitcoin exchange.
Uniswap, the protocol for decentralized, trustless, token swaps that Vitalik Buterin once asserted would outlive the company behind it, has been launched in its third version (v3) on the Ethereum Mainnet. When a project, smart contract, or dApp (decentralized app) launches on the Ethereum Mainnet, that generally means that it has been tested and is available for use of all of those on the network. However, deployment on the Mainnet does not always mean a contract is bug-free or unable to be exploited, even though bug-bounty programs, security, and talent seem to be improving as more investment is made into the space.
How Does Uniswap Work?
The protocol, started by Hayden Adams, trustlessly and permissionlessly connects liquidity providers (LPs), aka those who have ERC-20 tokens and who enter them into the Uniswap Protocol for use, with those who want to trade various different ERC-20 tokens, utilizing smart contracts atop the Ethereum blockchain where transactions and trades are processed or executed by the decentralized nodes of the network (which anyone has the opportunity to run), and proof of the transactions is easily recorded and accessible.
Liquidity providers can put their tokens into a liquidity pool for a trading pair (actually a smart contract) for the use of users wanting access to that liquidity in this token pair on the protocol, and the providers earn a certain fee for providing that liquidity. Liquidity providers are encouraged to always provide an equal value of the two tokens in the certain pair, to protect against possible arbitrage on the trading pair.
This liquidity is then accessed by anyone on the Ethereum network, they pay a relatively small fee for the ability to access that liquidity and to swap, sell, or get the tokens they desire. The fees are allocated to the liquidity providers in a certain pool, according to the percentage of the liquidity they provided, the fees are effectively paid out when the LP trades in the ERC-20 token (that they were programmatically issued when they first provided the tokens to the liquidity pool) to the smart contract that they were held in, receiving their share of the fees from the trades performed while their tokens were in the contract, as well as their original tokens.
One key difference between Uniswap and other decentralized exchanges is that the programmatic mechanism that takes the place of the order book of centralized exchanges is on-chain, and one does not need permission to add an ERC-20 asset to it, so that Uniswap could most aptly be called an Automated Market-Maker (AMM), because the access to the liquidity is automatic when sufficient liquidity exists in a pool in the protocol.
It is also worth noting that in order to transact on Uniswap, like all dApps on Ethereum, one needs to have sufficient ETH ($ETH) in the associated wallet in order to have the transactions approved by the network nodes, or miners - this price can vary depending on network capacity.
New Liquidity NFT SVG Images in v3
As a change in version 3, liquidity will be represented no longer as an ERC-20 token, but as an NFT (Non-fungible token) on Ethereum. (When liquidity was provided in the protocol, an ERC-20 token that represented that user’s share of contribution in that liquidity pool was returned to them, that they would later submit back to the Uniswap smart contract to receive their share of the fees that liquidity pool had earned). What is interesting about these NFTs is that they are a unique image produced by an on-chain SVG (Scalable Vector Graphics) generator, the particulars of the image are determined by the details of the liquidity provided. These liquidity NFTs even randomly include a sparkle, to spark joy in some people’s lives.
Adams wrote on Twitter that the NFT SVG generation contract is the only contract in Uniswap v3 that is upgradeable, paving the way for artists to vie for a chance to have their unique graphical contract design included in the protocol for a time, which means that these images can be different depending on when they were generated.
Fees from providing liquidity also represent a possible source of income for all holders of ERC-20 tokens, no matter where they are in the world, granted there is demand for trading for the tokens. With this aspect of Uniswap, one can see how this protocol can have a massive impact on the financial world, if Ethereum is able to reach scale, and especially so when one thinks about the many different things that can be represented by Ethereum tokens.
An ERC-20 token itself is actually a standardized smart contract atop of Ethereum, and can be issued by anyone with access to the network. This contract can have different functionalities depending on how it was crafted, it could represent special privileges (like voting), enable functionality in different types of protocols or services - among other things - all the while being based in a blockchain of transactions. Transacting in these tokens can be permissionless as well as traceable and proveable, just like any other transaction on the network.
Version 2 of the protocol is still live and able to be used on the Ethereum Mainnet, and traders will actually be alerted when a better exchange rate is available on v2, though they will now be first routed into viewing the v3 interface at first.
Improvements in Capital Efficiency
Uniswap v3 will allow for Liquidity Providers to have even more granular control of the liquidity they provide and the prices they provide it at in their respective pools, thereby making the whole protocol able to become even more capital efficient than its previous versions. As Uniswap explained, this would allow for the same depth of liquidity to be offered as in v2, albeit with less capital or liquidity having to be imputed into the protocol - potentially benefiting not only the LP, but the entire economy.
The major feature additions of v3 were summarized, in the words of Uniswap’s announcement:
"Concentrated liquidity, giving individual LPs granular control over what price ranges their capital is allocated to. Individual positions are aggregated together into a single pool, forming one combined curve for users to trade against
Multiple fee tiers, allowing LPs to be appropriately compensated for taking on varying degrees of risk"
In other words, an LP can decide that they would like their liquidity allocated to a certain price, aggregated together with the choices of other LPs in their liquidity pool, this creates a unique arc or curve depending on the preferences of those providing the liquidity. This concept of the curve is also reflected in the NFT image an LP receives. In version 3 of the protocol, “LPs can combine any number of distinct concentrated positions within a single pool.”
With liquidity able to be concentrated at certain prices, the traders on the protocol would also benefit from possible reduced slippage in the price they are quoted, as the liquidity for their trade is potentially even more granularly known beforehand.
Governance of the protocol is performed through the holders of the UNI ($UNI) token, meaning anyone who holds this ERC-20 token in their Ethereum wallet that is connected to the network is able to vote on decisions that will affect the trajectory of the protocol, the holders can also delegate their votes to a third party. At least 1% of the total supply of the UNI token is required to actually submit proposals for voting. The UNI token itself is able to be traded using the very protocol it is used to govern.
Uniswap plans a layer 2 deployment on Optimism (a solution for more transactions per second on top of Ethereum, which puts transaction data on-chain but performs computation off-chain) soon, which it says should bring the network gas fees for using Uniswap down more, even though they have already seen an improvement in this v3 Mainnet deployment for users.
This protocol upgrade is a very interesting development for the whole of DeFi - the Uniswap Protocol looks to continue to unlock and enable decentralized financial servicing to many more in the future with its simple yet very impactful design, and the technology it is built upon.
Note: The author owns a digital asset mentioned or referenced (ETH, UNI).