Outcome Tokens
Prediction Markets use the Conditional Token Framework (CTF) to represent different outcomes. A binary market typically contains two outcomes, such asYes and No.
Each outcome token has a unique Position ID, which is also used as its on-chain Token ID. Most integrations do not need to calculate Position IDs themselves; they can use the token_id returned by the market API.
Position ID Generation
The underlying Position ID calculation includes:- calculating
conditionIdfrom the Oracle, Question ID, and number of outcomes; - calculating the corresponding
collectionIdfromconditionIdandindexSet; - calculating the final
positionIdfrom the collateral asset andcollectionId.
Position Quantity
The account position API returns the current outcome-token quantity and distinguishes between:- total position quantity;
- quantity locked by orders or the settlement process;
- quantity currently available to sell or use for other operations;
- average entry price;
- current position value;
- claimable amount after settlement.
Market Settlement
After the market outcome is confirmed:- winning outcome tokens can be exchanged for the corresponding collateral asset according to the settlement rules;
- losing outcome tokens become worthless;
- account fields such as
settlement_status,won, andclaimable_amountare updated.
Redeeming Settled Positions
Before redemption, confirm that:- the Market has reached final settlement;
- the current account holds the corresponding outcome token;
- the position has a claimable amount.
If you are using the DexBuilder API only to build a frontend or trading application, rely directly on the market’s
token_id, account positions, and Claim APIs. You do not need to implement CTF Position ID calculation yourself.