# 3-way Constant Product

A 3-way Constant Product market is created where `constant = yes_balance * no_balance * invalid_balance`.

`1000000000 = (909 - yes) * (1100 - no) * (1000 + 1000)`
`yes = no * (909 / 1100)`
`1000000000 = (909 - (no * 909 / 1100)) * (1100 - no) * (1000 + 1000)1000000000 / 2000 = (909 * 1100) - (909 * no) - (1100 * no * 909 / 1100) + (no * no * 909 / 1100)(909/1100) * no^2 - 1818 * no + 999900 = 500000(909/1100) * no^2 - 1818 * no + 499900 = 0`
`yes = no * 909 / 1100yes = 322 * 909 / 1100yes = 266`

## Seeding Liquidity with Alternative Odds

It is worth noting that in most cases, the liquidity provider would actually hold on to some outcome shares so the market wasn’t seeded with 0.33/0.33/0.33 odds. The INVALID odds there are especially unlikely.

## Downsides

1. The liquidity provider has to be long some shares if they want to seed the market with alternative odds. It is possible to avoid this with a formula like Balancer uses, but while solving a quadratic equation is hard enough, throwing in there fractional exponents makes it nearly insurmountably hard because that requires logarithms, which are hard to do on Ethereum.
2. As with all market making of prediction markets, since all of the shares except for one will go to 0 (exception for scalar markets), the liquidity provider must exit their position before the outcome is known in order to prevent themselves from getting wiped out. This problem isn’t unique to constant product AMMs, but it also isn’t solved by them.
3. Solving a quadratic equation on-chain isn’t simple. It is possible and not terribly difficult, but since there are no native constructs for it you will have to use a library, and the gas costs will potentially be something that need to be considered.

# 2-way Constant Product Alternative

The market could just be a YES/NO market and the liquidity provider could hold their INVALID shares just like all other users. For an MVP, this is probably a good choice as it simplifies things and avoids the need to solve a quadratic equation. If the market ends up INVALID, the liquidity provider, and every user that traded on the platform, would get essentially a full refund (minus Augur reporting fees).

# Downsides

1. This system will struggle to identify invalid markets like the Augur v2 UI is planning on doing (by looking for INVALID shares trading at a higher rate than expected) because INVALID is not traded at all, it is just held by traders and market makers as insurance. On the flip side, it doesn’t really matter if the market is invalid because everyone is insured and gets a full refund, so there is really no opportunity for scamming, just trolling.
2. You cannot take all of your profits early. You can take profits out up to your insured amount, but after that you have to hold some position until market close. This is because in order to close out a position, you need to complete a set, and if you buy YES low and then sell YES high, that means you’ll end up with more YES+NO shares than you have INVALID shares. You’ll be able to close out your YES shares with the platform up to the number of INVALID shares you hold (taking profits up to how much you put in), and any excess YES shares you have beyond that you’ll end up holding as part of an incomplete set (either as YES, NO, or YES+NO). If the market continues to move you can continue to trade freely on it, you just cannot exit to DAI for more than you entered with unless you can convince someone to sell you their insurance.