Episode Summary for Uniswap: Creating Liquidity in DeFi with Noah Zinsmeister

Traditional financial institutions are siloed and often put up barriers, both regulatory and artificial, that prevent interoperability and introduce market efficiency. DeFi on Ethereum promises to provide a shared and uncensorable network that provides financial products that are universally accessible and interoperable with applications and products across the globe. However, much of the underlying infrastructure that underpins traditional finance must be remade so that Ethereum can provide the same functionality at the same efficiency. Their “Money Legos” are primitive building blocks that more complex applications and products can build upon.  

DeFi Money Lego Development: Messari Twitter

Uniswap is one of those “legos”, a liquidity pool that complex applications can use to exchange assets at a fair market value trustlessly and on demand. For example if complex contracts need a liquidation layer to execute once certain conditions are met, they can use Uniswap to execute that liquidation. 

Uniswap as a liquidity pool serves fairly unique purposes in the DeFi space and has no analogous even in traditional finance. Its primary purpose is that it provides a way to exchange assets without a centralized exchange. These decentralized exchanges or “DEXs” are important and they are completely trustless, which as shown by Robinhood’s recent troubles is a fairly important safeguard. It also provides massive liquidity through unsecured loans, or “flash loans” by virtue of atomic transactions on Ethereum. This enables arbitrage opportunities that make the overall market more efficient. Finally, they can serve as a decentralized information source, or “oracle”, enabling other contracts to access price information without having to access the internet or other centralized sources. All of these abilities enable more complex contracts and serv as a building block for the DeFi space on Ethereum.

Uniswap Contract Setup: Ocean Protocol

Uniswap works as a “factory contract”, which holds the template and creates separate “pools” that handle the exchange of two specific assets. This simplifies both the accounting and the development logic of the contract. In addition if there was ever a bug there is limited bleed into the entire system. Uniswap exchange pools work as a two sided market: there are the liquidity providers and the traders.

Uniswap Pool Setup: Uniswap Docs

Liquidity providers provide both assets in exchange for LP shares. Traders exchange one asset for another at a floating price plus a fee. In exchange for providing assets, liquidity providers receive a portion of the fees, prorated based on the percentage of LP shares each provider has. If a liquidity provider ever wishes to reclaim their assets, they simply return their LP shares to the pool, receiving their assets in return. By trading with the contract, you actually change the price, which subsequent trades will continue to change it by a small amount. 

Uniswap Price Mechanism: Uniswap Docs

 

This floating price ensures that if there is ever a difference between the “real world price” and Uniswap’s price, arbitrage will ensure a quick correction. Since this price follows the real world price of the trading pair, it can then be used as an “oracle” for other decentralized contracts.

Uniswap is currently developing and testing v3 of their protocol. V1 was a proof of concept that enabled swapping between Ethereum and ERC20 tokens. V2 served to extend that functionality to any token pair and introduced quality of life improvements such as flash swaps and price oracles. Uniswap v3 is focusing on bringing professional features to the protocol and making it on par with the capital efficiency of central exchanges. The crypto space is evolving quickly, however Uniswap looks like it is going to stay. 

This summary is based on an interview with Noah Zinsmeister, engineering lead @ Uniswap. To listen to the full interview, click here.

Ashvin Nihalani

San Francisco, CA
Education: B. Eng, EECS, University of California

Originally from Texas. Graduated from Berkeley with an B.Eng in EECS. Interested in basically anything, well anything interesting. More recently focused on Machine Learning, Blockchain, and Embedded Systems.

Software Weekly

Software Weekly

Subscribe to Software Weekly, a curated weekly newsletter featuring the best and newest from the software engineering community.