Conditional market
Conditional markets are markets which based on the outcome of an existing market.
Let's take an example to follow up on the question from the previous section. We could have a market asking If the war in Ukraine ends in 2024, will Russia withdraw all its troops from Ukrainian territory by the end of 2025? This market will be conditional to the market Will war in Ukraine stop in 2024? resolving to Yes.
Create a conditional market
To create a conditional market, you must have an address of the parent market and the parent outcome:
Split, merge and redeem a conditional market
To interact with conditional outcome tokens, we have to use Router
instead of GnosisRouter
.
Splitting
Before splitting a conditional market, you must have enough parent outcome tokens first (by splitting or trading):
As you can see, the process is quite similar to splitting a simple market. Under the hood, we used a specific parentCollectionId instead of the default bytes32(0). The market contract has already saved this variable, and can be accessed with:
If you want to know how a parentCollectionId is generated in detail, you can check out the Conditional Tokens GitHub site. In short, it requires the parentCollectionId of the parent market, the conditionId of the parent market and the indexSet of the parent outcome.
After splitting, you will notice that your parent tokens are no longer present. Instead, you will have multiple sets of conditional outcome tokens at your disposal.
Merging
The process is the exact opposite of splitting. Here, the contract will burn your conditional outcome tokens and return the corresponding parent tokens to you.
Redeeming
The contract will burn the specified conditional outcome tokens. If you are redeeming a winning outcome, it will return the corresponding parent tokens to you in proportion to the payouts.
Nested conditional markets
In theory, the conditional tokens framework supports infinite nesting levels. You can create a conditional market based on another conditional market and interact with it as you would with any market.
However, conditional markets are dependent on their parent market's outcome. If the parent market resolves to an outcome different from the one assumed by the child market, then the child market and all markets nested under it become obsolete.
Last updated