Gnosis's Conditional Tokens
Conditional tokens are a powerful primitive created by Gnosis that unlocks a lot of very interesting possibilities, like flexible prediction markets. In this issue, we’ll see how they work and what they can be used for.
Let’s make a thought experiment. Imagine there’s a “token splitter”, a smart contract where you can send 1 DAI (or any ERC20) and receive two tokens in return: 1 LeftDAI and 1 RightDAI. These “half tokens” are also ERC20-compatible, so you can do things like transferring them, using them for placing limit orders, or whatever else you want. And at any point you can send 1 of each back to the contract and get 1 DAI back. They don’t even have to be the original ones: these half tokens are completely fungible.
Here’s a question for you: assuming there are enough half tokens available to buy, how much would you be willing to pay for each one? Would you buy them if someone was selling them at 0.4 DAI? Of course you would! You could buy 100 of each for a total cost of 80 DAI, merge them and get 100 DAI, earning a profit of 20 DAI. On the other hand, and for a similar reason, you wouldn’t buy them at 0.6 DAI. So the price in an economic equilibrium is of 0.5 DAI for each half token.
Coin toss tokens
Let’s make another experiment. Like before, we have a token splitter, but this one receives 1 DAI and gives you one HeadsDAI and one TailsDAI in return. As before, you can merge N of each at any time to receive N DAI. But here’s the catch: at some point in the future, a coin will be tossed and, if it lands on “heads”, then all the HeadsDAI tokens will be exchangable for 1 DAI and all the TailsDAI will become worthless. Ignore for now how to do this in a fair way: assume you trust the person or contract that is going to enter the result of the (fair) toss.
Again, how much would you pay for one of these tokens? The argument is very similar to the one in the previous section: if someone is willing to sell some HeadsDAIs to you for 0.4 DAI each, and since they have an expected value of 0.5 DAI, then you would buy them. But you wouldn’t pay 0.6 DAI for them. Again: the price in equilibrium is 0.5 DAI.
What happens if the coin is biased and everyone knows it? For example, if everyone knows that there’s a 75% chance of the coin landing on heads? In that case, the price of HeadsDAI will be 0.75 and the price of TailsDAI will be 0.25.
And what if the coin is biased but only you know it? In that scenario, you would be willing to pay up to 0.75 DAI, and the people that don’t know better would think they are the ones that benefit from the trade. If you have enough money (or if enough other people know about the bias), then the price of HeadsDAI will move up. Put another way: your “inside knowledge” will make the price reflect the real odds in a better way.
Ok, one last experiment. This time our token splitter receives 1 DAI and returns one BidenDAI and one TrumpDAI. You can probably guess what happens next: if Biden wins the 2020 US election, then the BidenDAI can be exchanged for 1 DAI; same thing for the TrumpDAI if Trump wins. As before, you can take one of each and exchange them for 1 DAI.
What price would you be willing to pay for some BidenDAI? Suppose someone is willing to sell them to you for 0.1 DAI each. Surely there’s more than 10% chances of him winning, so in probabilistic terms it’s a profitable purchase for you. On the other hand, if they were being sold at 0.9 DAI you probably wouldn’t buy them. So the price is somewhere in between. Unlike the biased coin example, here it’s harder to assign an exact probability, but let’s assume that you are pretty sure that he has 45% chances of winning. In that case, you would be willing to buy a BidenDAI for less than 0.45 DAI and sell it for more than 0.45 DAI. Similarly, you would buy a TrumpDAI for 0.55 DAI.
And here comes the main idea behind prediction markets: if enough people participate in buying and selling BidenDAIs and TrumpDAIs, then the prices will approximate their “real” odds of winning. So if BidenDAI is trading at 0.4 DAI and TrumpDAI is trading at 0.6 DAI, then you can interpret this as the market predicting a 40% chance of Biden winning.
These prices can change over time, of course. If one of the candidates says something that can make him lose voters, then people holding his token will start selling it, reducing its price. Again, as we’ve said a couple of times now, this assumes that enough people are participating in this market.
Gnosis’s conditional tokens are a primitive that lets you create these kind of tokens in a very flexible way. They are completely application-agnostic: you can split any ERC20 this way for any future event you can think of. For example, you could create a couple of tokens that can be exchanged for 1 MKR depending on which football team wins a match.
So far we’ve avoided the question of who reports the result of these future events to which the conditional tokens are tied (that is, who acts as the oracle). And the answer is that the conditional tokens framework avoids that question too! When you split tokens, one of the things you have to specify is an address that will report the result of the event. This is a smart decision, because it means that you can use anything here: a trusted single person, a multisig controlled by a group of people, a decentralized oracle: anything. As an example, Omen uses reality.eth as its oracle, but the possibilities are endless.
Another thing we’ve ignored and that, again, the protocol doesn’t answer, is how these conditional tokens are traded. And again, not having an answer is wise, because you can do whatever you want, like trading them with 0x or using an automated market maker (this is what Omen does).
Finally, we’ve been talking about scenarios where there are two possible outcomes and either one or the other happens, but the conditional tokens protocol is way more powerful than that. You can have any number of potential outcomes (say: team A wins, team B wins, or it’s a draw) and you can also have non-binary results, for example tying the value of the tokens to the percentage of votes obtained by a candidate. In this scenario, if one candidate wins with 65% of the votes, you’ll be able to redeem his token for 0.65 DAI and the token of the other candidate for 0.35 DAI (the sum is always 1, because remember that we created each token from splitting 1 DAI)¹.
What can you do with conditional tokens? Creating and trading on prediction markets is the obvious answer, and there already are applications like Omen, Sight and Polymarket built on top of them for that purpose. But that’s not the only possibility.
Another commonly cited use case is futarchy. The idea here is to use prediction markets as a decision mechanism in some organization. In the context of Ethereum, this could be a DAO that makes some decisions only if some prediction market gives, say, an 80% chance or more of that decision producing a certain benefit for the DAO.
You could also use conditional tokens as a mechanism for paying someone. For example, Alice could create a prediction market on “Will Bob complete the project Alice assigned him before the end of the year?”, split some amount of DAI in the “Yes” and “No” outcomes, and pay him with the “Yes” tokens. (As always, we are assuming that the oracle reporting the result is to be trusted.) This is not very different to depositing the payment in an smart contract and using the oracle as an escrow. The difference is that Bob can do whatever he wants with those tokens. For example, he can use them before the market is resolved, assuming the person receiving them thinks Bob will complete his project and therefore considers they are worth 1 DAI. Or, if he wants, he could use them at a discounted value with someone that is not so sure about the result.
Conditional tokens can also be used to hedge risk. Imagine you have a business that would be negatively affected if one of the presidential candidates won. In that case, you could buy tokens for that outcome, and so if that candidate wins you have a counterweight for the damage to your business.
These are just some examples. The core idea here is that you can tokenize a potential future outcome: anything that can be built on that idea can be done with conditional tokens.
Check the official docs to know more, they are pretty good.
For a good (but somewhat negative) view on prediction markets, check this article by Hasu.
Conditional tokens are even more powerful than what I’ve shown here, because you can create tokens tied to deep, combinatorial outcomes. For example, you can bet that a team wins a tournament if they win the first match, without taking any position on what happens if they don’t win that match. The official docs have a more in-depth explanation of this.