11.05.2024|Ciamac MoallemiDan Robinson
In this post, we introduce a new automated market maker (AMM) customized for prediction markets: the pm-AMM.
AMMs and their predecessors, such as market scoring rules, were originally invented as a way to provide liquidity for prediction markets. They now dominate most decentralized exchange volume in crypto.
But ironically, despite prediction market volumes taking off in crypto, most of it uses orderbooks, not AMMs.
One possible reason is that existing automated market makers are a poor fit for outcome tokens (tokens that resolve to $1 if an event occurs and $0 if it does not occur). The volatility of outcome tokens is dependent on the current probability of the event and the time until the prediction market expires, meaning that the pool provides inconsistent liquidity. Liquidity providers (LPs) are also essentially guaranteed to lose all of their value once the prediction market expires.
We present a new AMM optimized around these considerations. This required addressing a longstanding question in AMM research: what does it mean for an AMM to be optimized for a particular type of asset? In other words, given a model for some asset (such as an option, a bond, a stablecoin, or an outcome token), how should that affect what AMM we use for it? We present a possible answer to this question, based on the concept of loss-vs-rebalancing (LVR).
We develop a model for the price processes of some outcome tokens, which we call Gaussian score dynamics. This model is a potential fit for prediction markets on whether some underlying random walk (such as the score difference of a basketball game, the vote margin in an election, or the price of some asset) will be above some value at a particular future expiration time.
We use this model to derive a new invariant-based AMM for those tokens, the static pm-AMM invariant:
where
To derive this, we make use of the powerful concept of loss-vs-rebalancing (LVR), which can be thought of as the rate at which an AMM loses money due to arbitrage. Loss-vs-rebalancing depends on both the shape of the AMM and the price process for the underlying assets traded on it.
We define a uniform AMM for an asset as the AMM which, if used for that asset, has LVR that is proportional to its portfolio value at an instant of time, regardless of the current price. Milionis, et al. establish that constant geometric mean market makers (like Uniswap and Balancer) are the unique uniform AMMs for assets whose prices follow geometric Brownian motion (a popular model for the price process of ordinary assets like stocks and cryptocurrencies). The static pm-AMM is a uniform AMM for assets that behave under our model of Gaussian score dynamics for outcome tokens.
While the static pm-AMM has uniform LVR (as a fraction of portfolio value) for all prices, LVR will still increase as the expiration of the prediction market approaches. This is because prediction markets can be very volatile near expiry. We show how the pm-AMM can be tweaked to reduce its liquidity over time, so that the AMM’s expected LVR at all moments over the remaining time to expiration is constant. This gives us the dynamic pm-AMM invariant, which is dependent on the time to expiration
The dynamic pm-AMM isn't magic—it prevents LVR from increasing as expiration approaches by providing a decreasing amount of liquidity. This may not necessarily be desirable on a real pool, particularly because non-arbitrage trading activity (and thus fees) may increase over time as well. But the pm-AMM provides a framework for liquidity providers to adjust their liquidity over time based on expected fees and how they want to allocate their exposure to arbitrage.
These AMMs may be useful for bootstrapping passive liquidity on onchain prediction markets. The concept of uniform AMMs, and the methodology for finding them, may also be more widely applicable for decentralized exchange designers looking to customize AMMs for other types of assets whose behavior does not follow geometric Brownian motion, such as stablecoins, bonds, options, or other derivatives.
Figure 1 shows the invariant curves for the static and dynamic pm-AMMs, compared with other well-known invariant curves, namely for the constant product market maker (CPMM) and logarithmic market scoring rule (LMSR). Note that the reserves curve for the dynamic pm-AMM provides less liquidity over time.
Figure 2 shows the liquidity fingerprint of the static pm-AMM, showing what it would look like if the invariant was implemented on a Uniswap v3 concentrated liquidity AMM, as compared to the CPMM and LMSR. The horizontal axis corresponds to ticks in relative price (the price of the
Prediction markets are an increasingly popular application in crypto. Polymarket saw over $2 billion in volume in just October 2024.
However, most crypto prediction market liquidity is available on orderbooks, rather than AMMs, despite AMMs being dominant for most other decentralized exchange volume across crypto.
One possible reason is that outcome tokens don’t behave like ordinary assets, so AMMs designed for them don’t work very consistently.
For example, imagine a prediction market on the result of a game in which someone flips a coin 1,001 times. There are two tokens corresponding to each outcome of this game:
The volatility of these outcome tokens is highly dependent on both the number of flips remaining and the current score. The closer the current score is to even, and the fewer flips remain, the more volatile these tokens will be. This means that the losses of a constant product market maker, which as discussed below are dependent on volatility, will vary wildly over time.
Figure 3 shows the volatility of the outcome token price process under Gaussian score dynamics—where the event is determined by whether a certain random walk ends up above zero—as a function of the token price and the remaining time.
Many popular prediction markets could loosely be thought of as similar to this coin-flipping example—a bet on whether some random walk ends above or below 0 at some future expiration time. For example:
In this post, we define a model for the price evolution of outcome tokens—the Gaussian score dynamics model—inspired by examples like these. The model assumes that the prediction market price matches the probability that some underlying Brownian motion ends above 0.
This model resembles the Black-Scholes model for a binary option (an instrument that pays out a fixed dollar amount if an asset's price is above some strike price, and $0 if it is not). However, in our model, there is no requirement that the underlying process corresponds to the price of a tradeable asset.
We do make the simplifying assumption that the price of the outcome token matches the probability that it resolves to $1. This assumes away important features of the market, including risk and time preferences—examining how those affect this model is a subject for future study.
We should also that not all prediction markets are a good fit for the Gaussian score dynamics model, which assumes that the rate at which new information comes out is predictable. For example, basketball games are likely a better fit than soccer games, since scoring is much more frequent, so the evolution of the score differential is more consistent over time. And some types of prediction markets won’t resemble this model at all, such as prediction markets on whether some one-time surprising occurrence (like an earthquake) will occur before a particular date. But this model may be a useful starting place for deriving models for those other dynamics, and can serve as a demonstration of the methodology for deriving uniform AMMs for any model.
After specifying this model, we derive an automated market maker that may be better optimized for these tokens than existing AMMs like the constant product market maker or LMSR. The metric we use as a guide is the rate of expected losses for liquidity providers, which can be characterized as “loss-vs-rebalancing,” or LVR.
LVR captures the main adverse selection costs of an AMM: prices on an AMM are static in the absence of trade, and become stale as new information becomes known. LVR captures the costs that AMM liquidity providers suffer as these stale prices are picked off by better informed arbitrageurs who trade against the AMM at prices which are disavantageous for the AMM. Thus, LVR can be viewed as how much the AMM pays to arbitrageurs in order to have its prices corrected.
Furthermore, absent trading fees, LVR is also the loss incurred by a liquidity provider who delta-hedges their LP position by separately holding a short position in the exact same quantity of the tokens owned as part of the pool reserves. In this way, LVR builds on the main insight of the famous Black-Scholes model for option pricing: just as an option is valued by delta-hedging with the underlying asset to remove market risk, LVR values an LP position in an AMM once the market risk is removed. That is, LVR isolates what is special about being a liquidity provider in an AMM, versus simply taking the market risk of holding the same tokens as the AMM reserves.
We consider simple invariant-based AMMs, with no fees or MEV-recapturing mechanisms. In this context, the AMM is guaranteed to lose money due to arbitrage—no AMM invariant can eliminate LVR (other than one that results in no trading at all). Even “minimizing” LVR doesn’t really make sense here: reducing LVR would just mean reducing the liquidity provided.
But we can make LVR more consistent, so that the percentage of the pool value that is lost does not depend on the current price of the asset. We call this property uniformity.
One way to motivate the value of uniformity is to imagine a sponsor who is willing to provide liquidity on some zero-fee prediction market in order to learn the market's prediction about the outcome. This to lose money, but would naturally prefer to spread out their losses evenly, rather than concentrating their losses at a particular time or at particular prices. In this case, the current portfolio value of the pool can be thought of as the sponsor’s “budget.” On a uniform AMM, if the sponsor puts in $1 of liquidity at some time, their expected losses in the next timestep are independent of the current state of the pool.
But uniformity is potentially relevant for profit-seeking liquidity providers as well. Even if an AMM is able to capture some of its loss-vs-rebalancing or even turn a profit (from non-zero swap fees, or through auction mechanisms like MEV taxes), it still needs some strategy for how to allocate its liquidity at different prices and different times. We might think of expected losses for the zero-fee pool as one way to measure how much liquidity the strategy is allocating at a particular time, in a way that takes into account the price process of the asset.
We define a uniform AMM for a particular asset as an AMM whose expected LVR is a constant fraction of the value of the current value of the pool, regardless of the current price of the asset.
Note that whether an AMM has uniform LVR depends on the price process of the asset itself. As shown in Appendix B.2 of Milionis, et al., if the price of an asset follows geometric Brownian motion, then the essentially unique uniform AMM between that asset and the numéraire is the weighted geometric mean market maker with invariant
But constant-geometric-mean AMMs do not have uniform LVR for tokens that follow Gaussian score dynamics. Nor does the logarithmic market score rule (LMSR), an AMM that was originally developed for prediction markets.
Figure 4 shows the LVR experienced by the CPMM and LMSR when used for outcome tokens with Gaussian score dynamics at time
Motivated by these concerns, we develop two AMMs that are designed for prediction markets under Gaussian score dynamics—one that has uniform LVR at any given time but increasing LVR as the prediction market's expiration approaches, and one that has uniform LVR and constant expected LVR over the remaining time horizon.
As can be seen in Figure 4, the CPMM and LMSR suffer large LVR (as a fraction of pool value) when the outcome token price is at an extreme, close to zero or one. This is because, while price volatility is low around those points (cf. Figure 3), the pool value decays even faster at extreme prices. Hence, a uniform AMM should provide less liquidity at extreme prices, which is what the pm-AMM design does (cf. Figure 2).
AMMs have their origin in the world of prediction markets and market scoring rules, such as the logarithmic market scoring rule (LMSR). These rules motivated the discovery of constant function market makers (CFMMs), such as Uniswap v2, which are often characterized by an invariant relationship between the AMM's reserves of each asset. AMMs based on this design have emerged in recent years as the dominant market mechanism for decentralized exchange on blockchains.
More recently, ideas from financial economics have been applied to understand the costs of automated market making, in the form of loss-versus-rebalancing, or LVR, as discussed in Milionis, et al. LVR captures the losses incurred by an AMM to arbitrageurs due to stale prices. That paper considers assets whose dynamics follow diffusion processes, primarily focusing on geometric Brownian motion.
Prediction markets, on the other hand, have very different price dynamics because of their bounded payoffs and finite horizons. Taleb proposes dynamics based on an underlying and observable polling process, while we develop an alternative form of dynamics, based on an underlying and observable Gaussian score process.
There has been some prior applied work on designing automated market makers for non-GBM assets. One example is StableSwap, an AMM designed for stablecoin pairs, which is based on the intuitive premise that AMMs between correlated and mean-reverting assets should involve concentrating liquidity closely at a single price, but its derivation does not involve modeling the assets' price processes. Another is YieldSpace, an AMM designed for zero-coupon bonds. While the derivation of YieldSpace does involve a simple model for the pricing of zero-coupon bonds as a function of interest rates, it does not include a full model for the price process (since it does not model the evolution of interest rates), and the paper makes a largely arbitrary choice for how the interest rate should be inferred from the current reserves.
There has also been some academic work on designing AMMs based around beliefs about how asset prices will behave. One example is Goyal et al. Their framework is designed around maximizing the amount of liquidity that is expected to be active, rather than making expected losses uniform, and as a result sometimes reaches opposite implications from ours. For example, their paper suggests that LMSR (which, relative to the CPMM, concentrates liquidity around the price of 1) is a good fit if liquidity providers expect relative asset prices to remain around 1, whereas our framework suggests that there are reasons to concentrate liquidity around 1 if you expect prices to diverge (as with outcome tokens).
Automated market making. We consider a prediction market on a single event of interest, and an AMM which trades two assets against each other: a risky asset (denoted by
This is the value of the pool when the
We assume that there is a population of arbitrageurs who, at each time
Example 1 (Constant Product Market Maker). In the case of a constant product market maker (CPMM), where the invariant function is given by
Example 2 (Logarithmic Market Scoring Rule). The logarithmic market scoring rule (LMSR) created by Robin Hanson can be viewed as an AMM satisfying the invariant
which is proportional to the binary entropy of the event implied by the price.
Denote by
Lemma 1. For all prices
1.
2.
Gaussian score dynamics. We now describe how the risky asset prices evolve over time according to what we call Gaussian score dynamics. In particular, we assume there exists a stochastic process
We assume that
where
where
where
Loss-versus-rebalancing. From the discussion above, if we denote by
Since the price
Uniform AMM. A uniform AMM is a pool which loses money at a constant rate proportional to it’s value, i.e.,
This is not possible, since the left side depends on
To circumvent this issue, we allow
This is equivalent to the ODE
for
Pool definition. The above ODE can be simplified through the change of variables
with reserves given by
Here,
This defines the static pm-AMM. (This name alludes to the time varying, dynamic variation of the pm-AMM we will discuss shortly.) By design, this AMM satisfies the relationship
Defining
Solving this ODE,
In other words, in expectation, the static pm-AMM pool value decays according to the square root of the remaining time horizon.
One downside of the static pm-AMM is that, while its LVR per dollar of value is uniform over all possible prices, it changes over time. In particular, loss per dollar of value is inversely proportional to the time to maturity, so it will increase over time until losing all of its value by maturity
Dynamic liquidity. We imagine now a dynamic, time-varying variation of the static pm-AMM design where the AMM LPs withdraw liquidity over time to mitigate their losses. In particular, assume that the pool value is given by
where
Denote by
The AMM LPs’ total wealth
This implies that the expected LP wealth
where
Constant LVR. Now, consider the specific choice of liquidity curve given
We call the the dynamic pm-AMM. Then, from (7), the expected pool value
Solving this ODE, we have
In other words, net of withdrawals, the expected pool value decreases linearly in the dynamic pm-AMM. Further, because it inherits the static pm-AMM value function, the rate of LVR loss per unit time is given by
Then, the expected rate of loss is
which is constant over
Finally, following (8), this results in an expected wealth process
so that half the initial wealth is lost by the end.
The pm-AMM may be useful for prediction markets driven by dynamics that resemble the Gaussian score dynamics model.
Beyond this, our work suggests that uniform AMMs may be derivable for other kinds of assets, like bonds, options, and other derivatives.
The authors wish to thank Benedict Brady, Leo Lau, Allan Niemerg, Storm Slivkoff, Shouqiao Wang, Dave White, and Bill Zhang for helpful comments.
Copyright © 2024 Paradigm Operations LP All rights reserved. “Paradigm” is a trademark, and the triangular mobius symbol is a registered trademark of Paradigm Operations LP