Gnosis Developer Portal Conditional Tokens

Gnosis Developer Portal Conditional Tokens

  • Introduction
  • Use Case
  • Documentation
  • Tutorials
  • Support

›Conditional Tokes Tutorial

Conditional Tokes Tutorial

  • Introduction
  • Setup
  • Conditions
  • Bit Arrays
  • Basic Outcome Collections
  • Positions
  • Splitting From Collateral
  • Splitting Unions
  • Combining Outcome Collections
  • Splitting to Deeper Positions
  • Merging Positions
  • Transferring to EOA addresses
  • Transferring to Contract Addresses
  • Reporting Payouts
  • Basic Redemption
  • Deeper Redemptions
  • Reporting Scalar markets
  • Scalar Redemptions

Combining Outcome Collections


To this point we've been supplying zeros as our parent collectionId this whole time. What this means is that we're only talking about a first level of positions. However, another important feature of the condition tokens is the ability to combine many different conditions in a single position. As in the image below.

Splitting

Let's say we want to create the position (A) & (hi). We can use the getCollection() function to find the collectionId

Specify the collectionId for the collection of outcome slot (A) by itself as a parentcollectionId.

Then we specify the conditionId for the other condition, the second condition that we prepared, which has two outcome slots (lo) and (hi).

Finally, we specify an index set that represents the index set for only the outcome slot (hi), which is 2.

In this case, we end up with a position that you can really call (A) & (hi), this is the position that pays out the collateral if both (A) occurs and (hi) occurs.

Note that you can derive the same positionId for (A) & (hi) by using the collectionId of (hi), the conditionId of the condition with outcome slots A, B,, and C, and the index set [1] which corresponds with (hi).

Find and note the collectionID for these positions.

(A) & (hi)
(A) & (lo)
(B) & (hi)
(B) & (lo)
(B|C) & (hi)
(B|C) & (hi)

From this, you can derive the positionId of each collection using their collectionId and the address of each collateral token.


Next we'll use these collectionIds and positionIds that we derived to split into deeper positions.

← Splitting UnionsSplitting to Deeper Positions →
Gnosis Ltd.
ImprintCopyright
© 2020 Gnosis LTD
Privacy Policy
Copyright © 2025 Gnosis LTD