A mathematical analysis of Uniswap markets
arxiv.org
arxiv.org
A big problem with current cryptocurrency exchanges is that they're centralized. In order to trade on them, you have to take coins out of your own wallet and send them to the exchange's wallet, which you don't have control over. In the event that the exchange decides to take the money and run, you have no recourse.
The Ethereum blockchain's smart contract system has enabled the rise of decentralized exchanges, like Uniswap. What this means is that trades between users' wallets are mediated by the contract's code, never requiring you to relinquish control of your coins.
Unlike the traditional order book of most exchanges (centralized or decentralized), Uniswap has developed a way of trading centered around the concept of liquidity pools (see this [1] post for more information). Traders have wondered if this system provides comparable or better pricing compared to conventional order book exchanges, and this paper makes the case that it works well as a pricing system.
The lack of an order book makes it extremely simple (and transaction cost efficient).
The down side is that to "bootstrap" a market, you need a liquidity provider willing to put up twice the value of the asset. There's also slippage costs and front running concerns.
An order book that could handle 1 million TPS could be written in Java and run on a single cheap (sub $1000) piece of commodity hardware. And it wouldn't require much development effort - the mechanics of automated order matching is really very simple - almost trivial and implementations have been around since the 1960s.
In the context of all the inefficiencies and frictions in financial industry, the cost of actually matching orders by computers is effectively zero.
Uniswap is simple in the sense that for liquidity takers, the UI makes it feel like you're not trading, but rather that you're buying/selling coins at an offered price, with an assurance that the transaction will be canceled if it's not possible to fill the order without exceeding a certain amount of slippage. Almost like buying from a decentralized Coinbase. Yes, this is essentially just a market order, but you can have unrestrained slippage concerns in limit order books (especially in crypto where spoofing is commonplace), and beginners need to be taught about limit orders to avoid those pitfalls.
For intermediate traders and beyond, it's simply another exchange that can be used, but this paper does give validation that their pricing mechanism is competitive.
1. An on chain order book. But saving state on chain is expensive
2. An off chain order book. With an off chain order book, you have to hash and verify signatures for every order, which is expensive.