As you can see, purchasing a significant portion of ETH in the pool is an expensive idea if it’s more than ~2% of the liquidity pool. Keep in mind, though, that these premiums are based on the current size of the liquidity pool. If the pool were 100x larger (i.e., 10 million DAI and 100,000 ETH), it wouldn’t be nearly as expensive to buy a mere 50 ETH. Ultimately, the price paid reflects how much the trade size shifts the x/ y ratio. When the liquidity pool is larger, it’s much easier to process larger orders (which is what you’d expect, of course).

One caveat to keep in mind is front running, which is an issue for all DEXes on Ethereum today. To help mitigate, Uniswap allows one to specify a maximum price when placing an order. Therefore, if a miner front runs an order, the user cannot be forced into accepting the worse price. They might miss the trade, unfortunately, but they won’t get a costlier price. Another feature Uniswap implements is expiring orders which prevent miners from withholding signed transactions and processing them later when the price has moved.

ERC-20 to ERC-20 swaps are also possible without requiring a separate liquidity pool. An order for REP <> ZRX, for example, would route through the REP/ETH pair, and then automatically through the ZRX/ETH pair.

For Liquidity Providers

Liquidity providers have an even more confusing task at hand. Let’s walk through the inception of the ETH/DAI market. The first thing to note for liquidity providers (and traders, too), is that the x / y ratio represents the price of the trading pair. In our case, x / y = 100,000 DAI / 1,000 ETH = 100. Let’s also assume the Coinbase price of ETH is $100. If x / y didn’t equal 100, there would be an arbitrage opportunity between Uniswap and Coinbase.

When a liquidity provider adds liquidity to the pool, he cannot only supply liquidity to one side of the pair. Otherwise, he will be shifting the ratio, and essentially setting a new price (which is dangerous, as he will be arbitraged away immediately and lose money). For example, if a liquidity provider only adds 1,000 ETH and 0 DAI, then the contract’s new ratio is 100,000 / 2,000 = 50. Arbitrageurs will push that market into line until the ratio is 100:1 again. Liquidity providers must supply an equal amount of both sides of a trading pair (and the Uniswap interface helps ensure no mistakes are made).

So let’s assume that after adding 10,000 DAI and 100 ETH (total market value of $20,000), the liquidity pool is now 100,000 DAI and 1,000 ETH in total. Because the amount supplied is equal to 10% of the total liquidity, the contract mints and sends the market maker “liquidity tokens” which entitle them to 10% of the liquidity available in the pool. These are not speculative tokens to be traded. They are merely an accounting or bookkeeping tool to keep track of how much the liquidity providers are owed. If others subsequently add/withdraw coins, new liquidity tokens are minted/burned such that the everyone’s relative percentage share of the liquidity pool remains the same.

Now let’s assume the price trades on Coinbase from $100 to $150. The Uniswap contract should reflect this change as well after some arbitrage. Traders will add DAI and remove ETH until the new ratio is now 150:1. What happens to the liquidity provider? The contract reflects something closer to 122,400 DAI and 817 ETH (to check these numbers are accurate, 122,400 * 817 = 100,000,000 (our constant product) and 122,400 / 817 = 150, our new price). Withdrawing the 10% that we are entitled to would now yield 12,240 DAI and 81.7 ETH. The total market value here is $24,500. Roughly $500 worth of profit was missed out on as a result of the market making.

Obviously no one wants to provide liquidity out of charitable means, and the revenue isn’t dependent on the ability to flip out of good trades (there is no flipping). Instead, 0.3% of all trade volume is distributed proportionally to all liquidity providers. By default, these fees are put back into the liquidity pool, but can be collected any any time. It’s difficult to know what the trade off is between revenues from fees and losses from directional movements without knowing the amount of in-between trades. The more chop and back and forth, the better.

The Big Idea

Alright, so this sounds a lot more complicated than a regular exchange with a normal limit order book. The premiums also make it prohibitively expensive for whales to transact large size. So what is so great about this style of exchange? In a nutshell, the pooled liquidity smooths out the depth of the order book. There are no more large holes or large bid/ask spreads. This is preferable for small traders who don’t want to have to deal with limit order books (the Uniswap UX is one of the slickest we’ve seen in all of crypto). No more having to make bids or offers or doing heavy calculations. Liquidity providers can also “set it and forget it.” There’s significantly less overhead in terms of management of orders and positions. It’s an incredibly passive way to provide liquidity and earn some fees.

Uniswap also breathes life back into app-to-app (or machine to machine) transactions. In a world with millions of microtransactions, it makes a lot more sense to dip into one giant liquidity pool than to have to be conscious of price specific liquidity needs. Lifting the best offer on a small order size isn’t dangerous anymore(imagine a DEX with an empty sell side order book). Another use case is for security tokens to utilize Uniswap to pay out dividends.

For the astute reader, this model is very similar to the Bancor network which launched last year. However, Uniswap charges no listing fee, costs significantly less gas, and is more decentralized. Bancor requires staking BNT tokens to create a market, along with filling out an application form. The BNT token is also susceptible to being frozen at will. Uniswap contains no such frictions. Uniswap will run in perpetuity as long as the Ethereum network is running.

Currently Uniswap has less than a couple thousand ETH of liquidity spread across all its contracts, so we’re still in the early days. And Uniswap is unlikely to replace other types of DEXes due to whales wanting to trade large size orders. Its unique capabilities, however, will definitely lead to a lot of usage for everyday traders who are looking to get quick and easy access to various tokens.

Big shoutout and thanks to Hayden Adams, Ameen Soleimani, Linda Xie, and Jordan Clifford for their valuable feedback.

Cyrus Younessi is Director of Research and Trading at Scalar Capital Management, LLC, an investment manager focused on cryptographic and blockchain related assets. Scalar Capital holds or may invest in the assets or asset classes described in this article.