Shortlink: bit.ly/maniswap

Maniswap is Manifold Market’s automated market maker (AMM) for binary prediction markets.

Maniswap is based on a modified version of Uniswap, designed to allow the more efficient deployment of liquidity. The original idea for Maniswap was suggested by Pepe, a user of Manifold Markets.

Uniswap for prediction markets

You can think of a prediction market as a place to trade shares in an event, which will pay out if an event does or does not happen.

Imagine a prediction market created for the question: “Will it rain in Manhattan on May 10th, 2025?” A YES share of this market will pay out $1 if rains in Manhattan on the specified date; a NO share will pay out $1 if it does not. Shares that do not pay out on the specified date immediately become worthless.

The price of a YES share thus corresponds to the market’s estimate of the event’s probability. If a YES share for this market is trading at $0.35, the market believes there is a 35% chance the event will occur.

An AMM can be used to facilitate trades between different parties for this market. Conceptually, a trade placed using an AMM works like this:

  1. A trader believes the true probability of an event is higher than the chance implied by the current price of YES shares, so they place an order to buy $10 worth of YES shares.
  2. The AMM receives the order, and converts the $10 into 10 YES shares and 10 NO shares. (Since 1 YES share + 1 NO share always equals $1, the AMM can always issue shares in equal amounts for cash they receive.)
  3. The AMM adds the new shares to their pre-existing liquidity pools of YES and NO shares.
  4. The AMM uses a formula based on the number of shares in the liquidity pool to figure out how many YES shares to give back to the trader in return for his $10 wager.
  5. The trader now has some number of YES shares which will pay out if the event happens.

One of the simplest ways an AMM can process these transactions is to use a Uniswap-style constant-product formula.

Suppose that there are y YES shares and n NO shares in the AMM’s liquidity pool. The AMM will adjust shares in the pool such that their product is held constant (k):

$$ yn=k $$

For example, if the AMM initializes the pool with 3 YES shares, and 2 NO shares, the initial constant will be 6. If someone wants to buy $1 of YES, the AMM will update the pool to 4 YES, 3 NO. Since the product of 4*3 is not 6, the AMM will figure out how many YES shares to remove to restore the condition, (4-x)(3) = 6. In this case, x=2, which means the trader will get 2 YES shares back for their $1, and the AMM’s resulting liquidity pool will be 2 YES, 3 NO.

Notice that when a trader buys YES, the number of YES shares in the liquidity pool decreases. In other words, the higher the probability, the lower the number of YES shares.

In a Uniswap-style market-marker, the market probability (i.e. the probability implied by the current prices of shares) is given as:

$$ P = \frac {n} {y+n} $$