Status: Draft idea, not currently implemented as of December 21, 2022
Maniswap V3 is an AMM for prediction markets that modifies Maniswap to use Uniswap V3’s concentrated liquidity.
Liquidity providers (LPs) can provide capital within a specified probability range on a prediction market and earn fees on trades conducted in that range.
By concentrating capital within a range, LPs can avoid situations where informed actors or news releases cause the probability to suddenly converge to 0 or 1. This allows them to more efficiently provide capital, meaning more liquid markets in general.
Maniswap V3 uses the same trick as Maniswap of parameterizing the pricing curve in terms of the current probability to allow the more efficient deployment of capital.
The probability range (0%, 100%) is divided into a number of discrete ticks or buckets.
LPs can place a range order of a certain capital amount over a given probability range, e.g. $100 on [30%, 33%), to provide liquidity to the market.
Market orders use the aggregate of all the liquidity provided by range orders containing the current market probability.
Trade execution within a bucket:
Suppose the current market probability is p.
A market order to buy YES shares comes in.
Find all the range orders whose range contains p.
Next, we calculate the liquidity l of each range order’s liquidity pool P
If $P_i = (y_i, n_i)$, then the liquidity is equal to $l_i = min(y_i, n_i)$
Find the total liquidity L, which is just the total quantity of dollars in this bucket:
$L = \Sigma l_i$
Now, we use the Maniswap pricing function with the parameter p set to the current market probability to find y, the number of YES shares to return for the order:
$$ (b - y + L)^p (b + L)^{1-p} = L $$
The new market probability is
$$ p_{new} = \frac {p(b +L)} {(1-p)(b - y + L) + p(b +L)} $$
We then update each order’s liquidity pool by linearly interpolating the change in YES and NO shares and adding in the fees $f:
$$ P_i^{new} = (l_i\frac{b- y +L +f}{L} + y_i - l_i,\space l_i\frac{b +L +f}{L} + n_i - l_i) $$
A large market order that moves the probability by several percentage points will need to be broken up into smaller orders and processed bucket by bucket.