Market makers and order books are at the beating heart of markets. They're how we ensure there's a buyer for every seller and a seller for every buyer. They're how modern financial exchanges work. It's a model that works well in big markets. Automated Market Makers change the game. They can operate - profitably - in small markets. It's a powerful new invention that's beginning to transform markets as we know them.
Hey friends -
Welcome to all of the new subscribers! Every week, I go deep on a topic from fintech to crypto to money. I wrap up each letter with some cocktail talk and a recipe for my cocktail of the week.
You can join me and my good friend, recently minted (!) top analyst Steven Dickens, the following week as we discuss the topic in depth. Find the full letters archive here and sign up for the podcast here.
This week we're looking at the innovation shaking up the beating heart of markets - how to ensure there's a buyer for every seller and seller for every buyer.
In this week's letter:
Total read time: 16 minutes, 59 seconds.
Markets are simple concepts at their core - a place for buyers to buy and sellers to sell. Despite their simplicity, they are wonderfully powerful.
Well-functioning markets mean that you have known prices for known quantities of goods. I can exchange something I have for something I want. Markets are so fundamental to how the entire economy works that we often overlook just how extraordinary they really are.
The simplest way to facilitate transactions is for buyers and sellers to meet directly. Let's say I have money and the seller has bananas. I meet the seller, they tell me it's $5 per banana1, and I purchase 10 bananas.
It's a great start, but this basic matchmaking model breaks down pretty quickly. What if...
Our simple model won't work. Order books will.
Like markets generally, order books are relatively simple. Don't let that simplicity fool you. They're one of the greatest inventions of all time.
An order book is a record of purchase and sale interests by market participants. They're typically hosted by an exchange that is responsible for updating the order book and matching orders. Every entry has four key inputs:
We can flip all four of the examples to get the entries to sell bananas:
The order book allows us to aggregate all of the buy and sell orders - regardless of price or quantity - in a single location. That's hugely powerful. It lets us know the quantity of a good we can purchase or sell at any point in time, a dynamic that becomes evident when we turn the order book into a graph.
Here we have a market where I can buy and sell Litecoin (LTC) for USD. The y-axis indicates the quantity of LTC and the x-axis indicates price. The green represents all of the outstanding buy orders. The red represents all of the sell orders. The place where the two overlap is the current market price for LTC.
So what happens if I try to sell 909 LTC at the current market price? The price for LTC will fall! It's supply and demand. I'm quite literally adding LTC supply to the order book and removing the supply of dollars. The market price will shift to a new midpoint of $62.83. This trade is a market order - an order sent to the order book to be executed at whatever the best available price is at that moment.
All of the other orders on the order book are limit orders - only buy or sell below or above a specific price. When we talk about liquidity in financial markets, this is at the core of what we mean. How much of the good can I sell right now without the price moving too much?
Market orders use up available liquidity - they remove orders from the order book. Limit orders supply liquidity - they create new orders on the order book.
You can actually build entire businesses supplying liquidity to order books. These businesses - called market makers - buy when people want to sell and sell when people want to buy.
Market makers are critical to healthy, functioning markets. They're the middlemen that help bridge buyers and sellers. It's the same role played by importers who sit between goods manufactured abroad and the store you buy them from.
Market makers' job is to take the opposite side of every trade - buy when market participants are selling, sell when they are buying. How can that be a profitable business?
Modern markets move very fast. Market makers exploit the very short-term price fluctuations to make money. They generally hold for no more than a few seconds and more often for a couple hundred milliseconds. Remember - they're just trying to make money as middlemen, not predict the longer-term changes in price.
In modern stock markets, market makers are regulated entities who are required to maintain two-sided limit orders - a buy and a sell - within a designated percentage range around the current market price. In return, market makers are given privileges including special access to the order book not allowed to most other market participants. It's a role mostly performed by high frequency trading firms. They compete to build ever faster systems that can both rapidly ingest new price information and send orders to the order book.
One of the major information inputs is the order book itself - all the trades that other market participants have posted. Exchanges that maintain order books and match trades jealously guard order book data. The cost to access order books is high and regularly increases. It's one of the reasons that professional traders have major advantages over retail.
A high frequency trading firm acting as a market maker might submit 100,000 orders a day. The firm might cancel 98% of them - removing them from the order book - before they're ever executed. The market maker is trading to exploit short-term price movements. As new information comes in, they reprice their orders accordingly.
This a law of large numbers business. The goal for a market maker isn't to make money on every single trade, but to make many small trades and make money 51%+ of the time. Jane Street, one of the largest and most successful market makers, transacted $17 trillion in 2020 and generated $1.6 billion in revenue. While that's a lot of revenue, it represents just a 0.009% margin.
While powerful, this is the Achilles heel of the order book model - market makers have to do a huge volume of trades to generate meaningful revenue.
If huge volumes of trades in a market aren't possible, market makers won't operate because they won't be able to generate enough revenue.
Huge volumes aren't possible in many markets. Take the market for shares of Schmitt Industries for example. They're a public company (ticker: SMIT), but the entire company is only worth $20 million. On an average day, about 35,000 shares trade hands. At their current $5 per share price, that's $175,000 of SMIT shares being bought and sold per day.
Jane Street probably can't be a profitable market maker in SMIT. If they tried with their 0.009% revenue margin, they'd make just $15.75 per day. It wouldn't justify the costs.
This creates problems for many markets. Liquidity doesn't improve linearly with market size, it improves step-wise. A big market may have 1000x the liquidity of a market just half its size. The liquidity acts as a lubricant in big markets - buyers can buy and sellers can sell without affecting the price too much. But smaller markets are left to struggle.
That is, until recently.
There is tremendous innovating happening in cryptocurrency markets. For those of you readers less than enthusiastic about crypto, I ask of you to put those thoughts to the side momentarily. We're focused here on a new way to match buyers and sellers. Objecting to new mechanisms for match-making simply because you're not interested in what is being exchanged is a bit like preferring cars to airplanes because you don't like where airplanes travel to - it misses the point.
Cryptocurrency startups invented an entirely new way to create markets called an automated market maker (AMM). If you've heard the term Decentralized Finance - or DeFi for short - AMMs are at the heart of how it works.
AMMs flip the traditional market maker model on its head. In the existing market maker model, a single large firm acts as a middleman. AMMs are instead powered by liquidity pools that many people can contribute to. The AMM itself is a software program that uses the pool to buy assets that sellers are selling and sell assets that buyers are buying. The pool plus the software program replaces the traditional market maker firm.
A liquidity pool is a new term to describe the "pooled" assets that power the AMM, similar to how a fund manager "pools" investor assets to invest on their behalf. Just like with an order book, the pool will always contain at least two assets such as dollars and bananas.
The startups who developed AMMs faced real challenges to make them work as intended. The solutions to those challenges resulted in tradeoffs - AMMs are not a good fit for all markets. A deeper understanding of how AMMs work will allow us to better understand when AMMs are useful and when they fall short.
There were three critical challenges to solve for AMMs to work:
We'll solve each challenge in turn.
No one manages the pool. It's also just software.
This is part of the magic of blockchain. A program running on the blockchain, known as a smart contract, can do everything. It can hold onto contributors' assets and transact with other market participants. It can also return contributors' assets when they no longer want to participate in the pool. It replaces multiple roles in traditional markets including fund manager and custodian.
If the concept of a smart contract is new, I recommend watching this short Youtube video to get acquainted.
The software prevents market participants from emptying the pool of one asset by dynamically managing the relative price of the assets in the pool based on supply and demand.
That's a mouthful.
What it means in practice is that as the bananas in the pool are purchased, the price goes up. The cost of the last banana in the pool is infinite - you can't buy it. The price-supply dynamic is typically achieved through a constant product AMM.
In a constant product AMM, the product of quantities of the two assets is always equal to a fixed constant. The equation looks as follows:
Each incremental asset we buy from the pool gets more expensive relative to the other asset. The reverse happens as we sell assets to the pool - they get cheaper relative to the other asset.
Imagine the two assets are bananas and dollars. As we purchase bananas from the pool, the supply of bananas decreases, and the price per banana increases. As we sell bananas to the pool, the supply increases, and the price per banana decreases.
We could flip the asset ratio on its head and express it as bananas per dollar. The dynamic would stay the same. As dollars become scarce in the pool, the bananas-per-dollar increase. As dollars become plentiful, the bananas-per-dollar decrease. The graph below displays how the incremental price change per banana purchased or sold to the pool.
You'll notice from the shape of the chart that the prices change exponentially, not linearly. The last banana in the pool quite literally costs an infinite number of dollars to purchase. Or, in reverse, the last dollar in the pool costs an infinite number of bananas. That stops buyers and sellers from emptying the pool.
AMMs require liquidity pools full of assets to work. Those pools pay fees to incentivize market participants to contribute assets. That presents a new problem - how to generate fees.
Liquidity pools charge fees to the buyer or seller on every transaction. The fee is in addition to the price paid for the assets in the pool. Think of it similar to a sales tax - there's a price for the goods you're purchasing and then an additional fee.
The fees are collected by the liquidity pool and paid out to whoever contributes liquidity to the pool. Contributors are known as liquidity providers. If there are a lot of transactions with the pool, it can generate substantial fees.
How does contributing liquidity actually work? Let's start with a banana-dollar pool of 10 bananas and 50 dollars.
Let's say I want to add $20 worth of liquidity to the pool so I earn a cut of the fees. If I just try to add 20 dollars and no bananas, the price-per-banana will balloon from $5 per banana to $7 per banana. If someone can still purchase bananas elsewhere - outside the pool - for $5, they can arbitrage the two prices. They can buy the cheap $5 bananas and sell them to the pool until the price in the pool decreases from $7 back to $5. They'll pocket the profit at my expense.
Most of the time, when liquidity providers contribute assets to the pool, they keep the ratios of the two assets in the pool the same to prevent such arbitrage. To add $20 of value to the pool, I actually add 10 dollars and 2 bananas. That keeps the price at $5 per banana.
Once I add liquidity to the pool, I can collect fees. Fees are paid pro-rata, a fancy term that just means the fees are proportional to how much of the assets a liquidity provider contributed to the pool. If you added 10% of the assets, you get 10% of the fees.
While these fees can be paid out regularly, more often they're paid when the liquidity provider removes their liquidity from the pool. That makes the math easier and reduces transaction costs. When liquidity providers redeem their liquidity, they receive their proportional share of the fees and the assets in the pool.
It's a lot of moving parts. In short:
Why are automated market makers so interesting?
It's the first at-scale mechanism to create a market maker in any market. There are far fewer constraints on how small the market can be. AMMs can operate profitably in markets much, much too small for traditional market-making firms to consider.
What this means is that there can be a market price - a price at which you can buy or sell - for any asset at all times. You can avoid the problem that many small markets encounter - sellers want a price too high for the buyers, buyers want a price too low for the sellers, and it's unprofitable to be a middleman to bridge the gap. AMMs are now that middleman. They solve a very real problem traditional order books simply can't.
The first real experiment with AMMs is happening right now in the cryptocurrency world. They allow people to trade thousands of different tokens. It would never be profitable for an exchange to maintain order books for every possible pair of tokens. Even if they did, it wouldn't be profitable to operate a market maker for most of the markets. AMMs fill the gap.
In the first 10 months of 2021 alone, AMMs handled over $1.1 trillion in transactions.
Like with traditional market makers, the market-making activity generated substantial revenue - over $4 billion in the same period.
Cryptocurrency startups allow anyone to click-button start a new AMM and liquidity pool for any pair of assets. A dollar stablecoin for Ether. Ether for MATIC. MATIC for LINK. LINK back to the dollar stablecoin. If you just want to trade and there's no pool for the two tokens you want to exchange, new smart contracts will string together multiple pools into a single transaction. Among other future uses, AMMs are a solution to a well-known problem in currency markets - how do I go between bespoke currency pairs like the Mexican Peso to the Thai Baht when there aren't liquid markets.
That doesn't mean that AMMs are a perfect solution for market making. They come with a major constraint.
Impermanent loss is the loss by the changing ratio of the assets in the liquidity pool. It's possibly the worst-named concept in finance.
Impermanent loss is easiest to understand by example. Let’s reset our banana-dollar pool back to 10 bananas and 50 dollars, $100 of value.
A bunch of market participants transact with the pool. We now want to redeem our assets from the pool. The end state of the pool when we redeem our assets is 13 bananas and 38.46 dollars.
At the pool price per banana of $3.21 ($38.46 / 13), my redemption includes $41.73 worth of bananas and 38.46 dollars. I put in $100 of value and got back out $80.19. The $19.81 difference is my impermanent loss.
The math of liquidity pools is that almost any change in the ratio between bananas and dollars in the pool will result in impermanent loss. I take a loss even when the price of bananas in the pool goes up because bananas have been purchased out of the pool. Even though the value of my assets is higher when I redeem, the value would have increased even more if I simply held onto my bananas rather than put them in the pool.
There are two scenarios where I don't take an impermanent loss - when the price of both assets decreases as more liquidity providers join the pool and when the ratio stays the same. The latter is where the "impermanent" term stems from - if you leave your assets in the pool, the loss is only temporary until the ratio returns back to where it was when you originally joined.
The fees the AMM collects on every transaction help offset the loss. When I contribute liquidity to the pool, I'm hoping the fees more than offset the loss.
That creates a tradeoff between fees and impermanent loss. It's the fundamental constraint for AMMs.
Each AMM tries to optimize the fee rate so that it is high enough to cover the impermanent losses but not so high that no one transacts. That optimization is one of the most active areas of innovation in cryptocurrencies today.
We are still very, very early in understanding just how and where AMMs will be useful. As their designs improve, as we invent new ways to solve the fee-loss constraint, we'll find ever more uses for them.
Diving into the ongoing innovations is a full letter in and of itself. A quick highlight will give you a sense of the breadth of just how much experimenting is happening.
For the time being, exchanges with traditional order books and traditional market makers reign supreme for most markets. The current designs for AMMs simply cannot compete with the efficiency and effectiveness of the existing providers and their approaches. AMMs dominate the long tail of smaller markets where order books and traditional market making fail.
New AMMs with new models for match-making will slowly but surely encroach on the traditional models. This isn't just idle speculation. Jane Street and Citadel, two of the largest traditional market makers, have both launched crypto teams in recent weeks. Some of their former employees figured it out first - CrocSwap's founder is formerly of Citadel and FTX's founder is formerly of Jane Street. The existing market makers see what's on the horizon and are making investments accordingly.
This is an area I will personally be paying very close attention to. We've seen an explosion of markets in recent years including trading cards, watches, shoes, and shares in startups. All of them suffer from a lack of effective middlemen. AMMs are a hugely promising solution and they're just getting started.
A bastardization of a modern classic.
2.5oz Laphroaig 10 Year Single Malt Whisky
1.0oz Barrow’s Intense Ginger Liqueur
Lemon peel for garnish
Pour all of the ingredients into a mixing glass. Add ice until it comes up over the liquid. Stir for ~20 seconds until the glass is frosted, ~50 times. Strain the drink into a cocktail glass. Squeeze the lemon peel over the drink to express the oils and drop in.
First, an apology. Gary “gaz” Regan invented the original Debonair in the 1990s. It called for Speyside single malt scotch. With complete and utter disregard for geography and canon, I replaced it with Islay single malt. And not just any Islay, but one that used to print “Like kissing a mermaid that had BBQ for dinner” on the bottle. My apologies to gaz for bastardizing the cocktail that first opened the doors to using single malts in the modern cocktail canon.
But I have no ragrets. As raw and unsophisticated as this cocktail might be, it suits me perfectly well. The uncompromising peatiness from Laphroaig is just barely held in check by a ginger liqueur with equally brash boldness. You might say there’s no excuse for visiting Disneyland Paris, but I’m enjoying it all the same.
Cheers,
Jared
That banana inflation sneaks up fast.