Small/Midcap and suffering from illiquidity? Try an AMM. — Three Body Capital


Photo by Museums Victoria on Unsplash

One of the biggest issues that plague the lives of anyone dealing in the world of small/midcap equities is liquidity: for the brokers, making a market is hard; for the companies, it seems like no matter what they say, no one seems to be interested in buying their stock.

For the few strategic investors who do buy the stock, they end up sitting on it, ironically removing liquidity from the market. As a result, regardless of how innovative a company is, barring the occasional miracle, getting listed at an early stage simply doesn’t cut it (even if you’re profitable!). The ticket out of the illiquid, “no one except small cap funds which are suffering equally gives a damn” pot is to get into the index and draw in passive flows. But one doesn’t get into the index by being small. The catch-22 is clear: small = not in index; not in index = can’t get big.

The result: frustration.

The traditional “solution” has been to engage a specialist broker in the small/mid-cap space who supposedly provides the service of making markets and providing liquidity in the stock. In exchange for some pretty generous fees, these brokers are meant to be able to get things moving for a stock, drum up some interest via research and eventually help smaller companies grow their market presence, trading volumes and market cap.

But in all honesty, has this really worked out as planned? Against the tide of passive flows sucking liquidity into the top index names and away from everything else, arguably the only party that wins from this is the broker – for multiple reasons.

Perhaps it’s time to try another approach and take a leaf out of the books of another class of assets that faced a shortage of market makers.

We’ve been reluctant to write about such a technical topic for a while, but now seems to be the right time.

Ladies and gentlemen, we present to you: Automatic market makers.

Origins of the AMM

The idea of an automatic market maker came about as a result of the initial failure to implement a “real life” solution to the liquidity problem in crypto markets. Traditionally, prices are quoted as a function of what is known as a “Central Limit Order Book” (or a “CLOB”), where buyers and sellers queue up their limit orders (bid and ask prices) and transactions happen at the intersection of the highest bid and the lowest ask.

This worked decently well for stocks, especially liquid ones, since the existing liquidity in the market allowed brokers and market makers to always have opportunities to make money from crossing the bids and asks, looking for arbitrage opportunities. Of course, the onset of high frequency trading (recommended reading here is “Dark Pools” by Scott Patterson) suggests that even the bids/asks being posted may be fluff, thanks to the quick reflexes of trading bots especially on the top index names.

Nonetheless, the underlying principle is that someone needs to be willing to offer liquidity in the market. The problem with early crypto was that few parties were willing to sit in the market and provide liquidity, ESPECIALLY in smaller tokens and given the overall volatility in the space. Initial iterations of crypto CLOB systems were abject failures – market makers were willing to make prices around the current price, but as prices moved away from the status quo (especially if the move was downwards), liquidity quickly disappeared, exacerbating price moves and contributing to the overall reputation of the space being “volatile”. Furthermore, the number of crypto assets was growing faster than centralised exchanges could (or were willing to) list them, and the market needed a way to build liquidity independent of the whims of the powers that be at the large exchanges.

And necessity truly was the mother of innovation. The crypto world needed a way to ensure trading could happen at all levels (even a poor price was better than no price), and that liquidity providers could be incentivised to commit liquidity on a somewhat permanent basis.

Thus, the team at Uniswap pioneered the first Automatic Market Maker, built on what is now known as the “constant product model”.

AMM math

As we mentioned earlier, we do try to keep our notes readable and not heavily technical, but for the purposes of demonstrating the brilliance of the AMM model, we do need some math. We will try to keep it simple, so bear with us.

The underlying equation for the constant product model is a simple one: x * y = k. This formula denotes the equilibrium relationship between the quantities of two assets in a pool (x and y being the quantities of asset 1 and 2, and k being the product of those initial quantities).

The value k is known as the “invariant” because it remains constant regardless of the fluctuations in the relative prices. Governed by such a relationship, a quick look at a graph plot of such a function should yield one clear conclusion: there exists a combination of x and y for all values of x and y. In plain English, it means that the x*y=k function will be able to provide a trade for any prevailing market price.


This is important because it means liquidity never dries up completely. You may get a bad price, but you won’t get no price, and that’s a HUGE improvement. As long as the proposed trade size is smaller than the total liquidity in the pool, any trader could come with a proposed trade, and the pool would make an offer for the other side: automatically, dispassionately and mechanically.

And where did the liquidity come from? None other than the tokenholders themselves: as a source of passive income, liquidity pools offered liquidity providers a large chunk of the 25bps trading fees charged per trade, which accrued mostly as additions to the liquidity pools denominated in either side of the trade.

This was crowdsourced liquidity from tokenholders, and it was this dynamic that bootstrapped the explosion in on-chain liquidity, way beyond what the centralised exchanges and their market makers could provide.

The discussion on AMMs can continue for hours more, with debates around the optimal pricing curves, capital efficiency, fungibility of liquidity and stability, to name just the topics that are top of mind – but those can be left for another note.

  • We’ve included a worked example in the appendix for anyone who’s interested in the math.

Take the humans out of the picture

The underlying issue here is actually the humans. More accurately, it is a fundamental misalignment of incentives when it comes to using a broker as a market maker. Let’s break it down.

The interests of the issuer (whether of token or stock) are as follows: ideally the asset price goes up, but most importantly there needs to be liquidity AT ALL TIMES so that in times of duress, prices don’t implode.

The interest of the market maker/broker engaged to provide liquidity on the other hand is profit. Make markets when prices are stable so that profits are maximised when others cross the bid/offer spread, but avoid making markets when prices are volatile to minimise risks to internal P&L.

The problem is clear: when the market makers are MOST needed, they are LEAST likely to be around.

Furthermore, a broker has multiple market-making mandates: naturally they will focus on the ones that make them the most money, which will naturally be the ones that are most liquid. Those that are illiquid will be charged larger bid-offer spreads, which make them ever less attractive to trade, thereby reducing volumes and liquidity, making them less attractive…

Turning to the AMM model takes the human discretion out of the picture: a pool of liquidity, say cash and asset, is set aside and provides an underpin to market liquidity, ensuring that there is always a price for a trade to get done.

Lessons from the other side

So now the question is: if it worked for crypto, why can’t it work for stocks?

We think there is no reason for this not to work for stocks, other than the inadvertent protestations of small/midcap specialist brokers who may lose out on a lucrative pot of business. Of course, there are functions such as the publication of research including ratings and target prices that a broker can perform, but in a world of increasingly transparent information transmission and unbundling of execution/research costs (remember Mifid2?), that investor education function is increasingly taken on by companies themselves.

It will most certainly be economically unviable for a smaller company to have an internal dealing desk which helps to stabilise its own stock and provide liquidity in the market, not least having to deal with the inadvertent issues of insider dealing and market manipulation. But perhaps that’s where an unbiased, emotionless automatic market maker comes into play. It’s really just an algo – simple and quite clever.

That budget allocated for buybacks? Allocate that into the AMM pool. And that stock of treasury shares? Stick that in too. Then we get a two-sided pool, dictated by an invariant that mechanically dishes out liquidity on either side, buying or selling, and making sure that the stock trades in a liquid market at all times. No human intervention removes the temptation to break the law with insider dealing, as well as the inefficiencies of greed and fear.

And who should administer that pool?

Certainly not your average broker given the scope for conflicts of interest (although maybe a more forward-looking establishment might be up to the challenge!), but perhaps that’s where some of that expertise in the world of cryptos can come into the legacy world and give things a bit of an upgrade.

It’s at the very least worth a thought.

And seems like a much better alternative to having great businesses with stock that no one cares about.

  • * * * *

AMM worked example

Suppose there is a pool with 1m units of an asset (let’s call it Asset A: shares, crypto tokens etc) and the equivalent amount of another asset in the pair (call it Asset B).

Let’s say Asset A is priced at $10 each at inception of the pool, and Asset B is USD cash.

The pool contains 1m x A and $10m of cash (priced at $1 each for simplicity).

Let x0 be the initial quantity of asset A, and y0 be the initial quantity of dollars. In this case, x0 = 1,000,000 and y0 = 10,000,000.

Therefore, with a constant product model, x0 * y0 = k. So, k = 10,000,000,000,000.

How to price a trade and calculate slippage in the pool

Assume a buyer comes and wants to buy 100,000 of Asset A.

The proposed trade is to remove A from the pool and add dollars.

The end state of the pool is that there will be 1,000,000 - 100,000 = 900,000 units of Asset A remaining.

Let x1 be the quantity after the trade is done. x1 = 900,000. k is invariant = 10,000,000,000,000. Therefore the resulting quantity of dollars in the pool, y1, has to be 10,000,000,000,000/900,000 = 11,111,111.11.

The price per A quoted in this transaction would therefore be y1-y0/x0-x1 = $11.11 each.

The slippage from the trade size being large (10% of the pool) is 11.1%, and it follows that the larger the pool is relative to the size of the proposed trade, the lower the slippage. To put things in context, the most liquid pair on Sushiswap is WBTC-ETH, with $527m of two-sided liquidity available.

From that point, additional trades in the same direction (buy A) would push the price of incremental units up, while trades in the other direction (sell A) will lower the price of incremental units down, in an exponential manner reflecting the availability of supply.

Variations on the constant product model also exist: for example, Curve uses a constant price model , which in general only applies for swapping assets that have largely stable relative prices e.g. stablecoins, wrapped/pegged versions of other tokens (e.g. wBTC-renBTC, ETH-stETH etc).

A commission parameter can be added for the pool to receive commissions denominated in the asset paid in (i.e. if buying A, pool receives more USD; if selling A, pool receives more A).

Finally, there is also the matter of “impermanent loss” from LP pools – the counterpart to the arbitrage profit made from correcting the price differential implied in the pools to the prevailing market price. Unfortunately, we’ve been advised that extending the worked example to include calculations for IL would be overkill, but if anyone wants to see a simple example, please drop us a line, happy to provide it!


Photo by Elsa Tonkinwise on Unsplash

This is the hundred-and-fortieth weekly edition of our newsletter, Weekend Reading, sent out on Saturday 16th October 2021.

To receive a copy each week directly into your inbox, sign up here.

  • ****

What we're thinking.

What markets dislike is uncertainty – “to taper or not to taper” was the question du jour, but now it’s been answered, the market can move on to examine the question of “how much” and whether it’s enough.

Taking a glance at the S&P and NASDAQ one could be forgiven for thinking that there are two parallel worlds in existence. Taper tantrum? What tantrum? The S&P and NASDAQ have both seemingly shrugged off fears of impending doom as recently as last week. Will these now tech-heavy indices go on to make new highs, notwithstanding worries about a global credit event driven by China (which seems to be equally irrelevant for the commodities, at least at this time) and completely in the face of the theory that higher rates (which we are getting) are “bad” for tech? Only time will tell, but it does seem like the pain trade is upwards.

And why not? As we have written ad nauseum, we continue to watch the dynamics of passive flows, including a potential rotation of assets out of a credit (it’s been a multi-decade bond bull market with falling rates!) and money markets into equities, specifically PASSIVE equities (which was the subject of our note a couple of weeks back here). The resulting disconnect between “the real world” and “the market” should no longer be unexpected, especially given how markets hit new highs post-covid while the world was ravaged by COVID over the past year. Passive buyers don’t mind, they just copy the instruction and action the order.

When we wrote our piece about video games and their brave new world, we saw the open worlds of NFT games as a direct threat to the traditional, incumbent pay to play model, and argued that the way forward for incumbents was to embrace these new business models. Unfortunately, it seems like they have chosen the opposite, with Steam choosing to remove all blockchain games (including those that allow exchange of cryptocurrencies or NFTs) from their platform. According to Age of Rust, one of the blockchain games that has been removed, they believe that from their understanding, “Steam’s point of view is that (NFT) items have value, and they don’t allow items that can real-world value on their platform.”

Let the REAL games begin.

As a follow up to our main piece this week, one can only wonder if Game Theorists will become the next “in-demand” profession, as crypto projects increasingly compete to have the best token economic design for their protocol, of equal importance to the underlying technological prowess of the development team. But before anyone who still has a choice of course of study decides to dive head-first into Game Theory specialisation, be warned: for most people, it’ll entail some pretty serious mental gymnastics. EL

With the novelty of homeworking having firmly rubbed off, the below cartoon from this week’s New Yorker perfectly sums up what my wife now feels when I work at home on Tuesdays and Thursdays.... EJP


What we're reading.

The myth of Xi Jinping has been superbly crafted but as always behind the man are many other people. Wang Huning has been around a long time and is credited with sowing the ideological roots for much of the policy behaviour we see today. This deep dive in Palladium Magazine is titled, “The Triumph and Terror of Wang Huning” and if you thought you knew a lot about China ( I did until I read this) think again.

A favourite of mine is the balanced political commentary of Bruno Maçães, who in this short blogpost asks the question we all want to know. With an actual election 3 years away it seems like Donald Trump is going to run again and Maçães wonders how, having effectively cancelled Trump, the social media juggernauts are going to navigate a potential political campaign. He uses the analogy of a fictional Central Asian country to get his point across. Whatever you may think of President Trump, Maçães hits the nail on the head by articulating something that surely, we all think about. Another illustration of a country in decline?

And finally, this week I stumped up the obscenely low subscription fee for Dominic Cummings’ newsletter. Cummings has been a divisive figure in the UK, but he sure as heck doesn’t care. Its almost as if he enjoys it judging by his gunslinging on Twitter. His musings are world class and his intellect unparalleled. The insights from his newsletter are worth hundreds of times what it costs to subscribe. Highly recommend. (This is a massive alpha leak). DC

This Thursday, John le Carre's posthumous release, Silverview, hit the shelves. Writing this on Friday morning, I'm pleased to say that I just finished it on the bus on the way into the office and I'm even more pleased to report that it's fantastic and everything a le Carre fan would want, made even more special and poignant by the fact that this is (unless there's another one stuffed in a drawer somewhere) his last book. I've bored everyone in this newsletter about my love for le Carre, the master of spy fiction, to my mind, and so to enjoy his final work so immensely was a great joy and no little relief. The hero in this work is Julian Lawndsley, a young man who now owns a bookshop in a sleepy East Anglian town following a successful career in the City. As he builds his new life, Julian encounters Edward Avon, a man “as mad as a flute”, whose wife, Deborah, used to be a big cheese in the British intelligence service... and there’s the link to the world of spies, as our story unwinds and comes together again from that starting point. It's a le Carre that ticks all the boxes and, I'd contend, is a good one for anyone who has never read any of his books to date and fancies dipping a toe into his world. The story is great. The dialogue - as always - sublime. And the length of this one, a mere 200 odd pages. So, if you're a fan like me and it hooks you in, it should take no more than one evening and one bus ride to navigate. EJP

Off the back of a summer of overindulgence, I thought it was time to hit the health train in the lead up to Christmas festivities. I came across The Plant Paradox by Steven Grundy. This is a fascinating read for anyone interested in being as healthy as nature has designed them to be. The book explains how eating the wrong food at the wrong times immeasurably hurts our health and reveals that gluten is just one variety of a common, and highly toxic, plant-based protein called lectin. Lectins are found not only in grains like wheat but also in the gluten-free foods most of us commonly regard as healthy, including many fruits, vegetables, nuts, beans, and conventional dairy products. People spend billions of dollars on gluten-free diets in an effort to protect their health, so the book illustrates where most people are going wrong when it comes to detoxing or eating healthy. DK

What we're watching.

Shows adapted from books can often go either way. Your feelings towards a book either be exceeded or disappointed when you watch an adaptation. Normal People and The Night Manager being two examples that I believe were excellent and clever adaptations. Little Fires Everywhere being one that I think fell short of the mark. Maid is a new Netflix series inspired by Stephanie Land's memoir Maid: Hard Work, Low Pay, and a Mother's Will to Survive. The book was a tough read and not my usual fare, but I was glad I finished it. It was rewarding and important and it made me thankful for everything I’m lucky enough to have, which is a pretty good feeling to come away from a book with. The television adaptation (what I’ve watched of it thus far) goes further, improving the book, to my mind, and bringing a harsh, bleak story to life. It stars the excellent Margaret Qualley as single mother Alex, who leaves her partner Sean and finds work as a maid in order to make a better life for her daughter, Maddy. It’s a depressingly real but truly hopeful piece of television, far from the jolliest (although I haven’t got to the conclusion yet!) but it watchable and gripping. The fact it is based on a real-life experience adds a depth that some works of straight fiction miss. I’d highly recommend it, especially if you’re a parent. EJP

2021’s ‘The Dig’ starring Ralph Fiennes isn’t particularly the sort of film I expected to find myself watching. A historic drama set in pre-second world war Britain, the film tells the real-life story of Basil Brown, an excavator who is commissioned to investigate and dig out a set of mysterious mounds in the Suffolk countryside. As far as films about digging go, it somehow manages to remain entertaining throughout with deeply touching and well-developed character arcs. It is a perfect film, relaxing and enjoyable. Well worth a watch! HS

Squid Game seems to be the flavour of the week/month according to Netflix and was brought to my attention through the school newsletter where they were warning parents around its content. This is a result of children coming across the topic via games like Roblox etc... My kids have asked if they can watch it and after indulging in several episodes, the answer is a hard no. Definitely not suitable for younger children (and even mildly squeamish adults). The series revolves around a contest in which 456 players, all drawn from different walks of life but each deeply in debt, play a series of children's games with deadly penalties if they lose for the chance to win a ₩45.6 billion prize. Worth a look. DK

What we're doing. As I’ve written about several times over the summer, since it’s reopening, I’ve become somewhat of a regular visitor to North Greenwich’s driving range. With stunning views overlooking Canary Wharf and the River Thames, it’s a great little spot for dates or even an evening out with a small group of mates. It’s by no means the cheapest driving range around…but a friend of mine from Sweden was quick to cheer at how significantly cheaper it was than his local range back home in Stockholm. I’d personally recommend it on an evening given the great views you get of the skyscrapers lit up at night, or alternatively on a Sunday afternoon as a nice relaxing unwind. There’s something incredibly therapeutic about the driving range, pelting balls as far as you can although understandably some frustration can arise when the machines tend not to track left handers’ shots with as much accuracy. Nevertheless, I’m sure I’ll be back again soon, or perhaps even on the fairway elsewhere in hopes of one last game before Winter arrives. HS

What we're listening to.

If you like the movie Heat as I do, and I’ve declared in this newsletter before that I think it’s the best movie of all time, then this podcast episode is for you. The Supercontext podcast is where hosts, Chris and Charlie, choose a different media artifact each week from the fields of comics, music, movies, books, or television, and investigate how it was made, how it was consumed, and what it seems to say about our culture, both then and now. This is for those who really want to geek out on a particular piece of content and so, for me, the Heat episode that was recommended to me via the Spotify algorithm was the perfect place to begin. The guys look at Mann's attention to detail and his attempt at authenticity in light of the movie's influence on audiences, filmmakers, and real-life criminals. If you liked the movie, this will really add to the context around what makes it so great and shines a light on the genius of Michael Mann. Other cool Supercontext episodes I've enjoyed include one about The Goldfinch, a great novel by the sensational Donna Tartt, and a couple of episodes they did looking at the music of Nick Cave. As said, they go deep on this show, so if you find an episode where you've already got a passing interest, this show will surely teach you something new. EJP

One of my constant curiosities is the nature of consciousness. I just don't get how we go from having all the physical infrastructure we have to actually having the omnipotent “I”. I mean come on, where does it come from? I’ve read a few books and as ever listened to lots of podcasts. This one was particularly good. It features theoretical physicist, Sean Carroll, in his Mindscape podcast. This episode is with a chap named Anil Seth, a professor of cognitive and computational neuroscience at Sussex, as well as co-director of the Sackler Centre for Consciousness Science. Anil has a special interest in the neuroscience of consciousness and has recently written a paper (with Lionel Barnett) about something called “emergence”. This was exactly what I was looking for! The topic of emergence looks at how consciousness comes about. What makes us conscious? Is there a leap from the physical parts of our body and in particular our brain and its neurons to creating consciousness? Or is it even the other way around? I can’t say that Seth has all the answers (neither does he!) but he has thought about it a lot and done lots of interesting work. For the more curious, it's worth an hour of your time (or 30 mins on 2X speed). DC