developers:predictionmarkets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
developers:predictionmarkets [2026/04/29 19:45] – created chaddevelopers:predictionmarkets [2026/04/29 19:55] (current) chad
Line 1: Line 1:
-Comin soon+====== THIS PAGE IS UNDER CONSTRUCTION ====== 
 + 
 + 
 + 
 +====== Prediction Markets ====== 
 + 
 +Prediction markets on the T4 platform are binary-outcome instruments that settle at either **0** or **1** (expressed as a price). This page explains how to interpret settlement messages so your application can correctly determine the outcome of a prediction market trade. 
 + 
 +===== Overview ===== 
 + 
 +Unlike traditional futures contracts, prediction market instruments resolve to one of two discrete values at expiration: 
 + 
 +  * **1** -- The event occurred; the "Yes" side wins. 
 +  * **0** -- The event did not occur; the "No" side wins. 
 + 
 +When a prediction market settles, the T4 platform generates a synthetic order update on the **opposite side** of your position at the settlement price. Your application should watch for this message to determine whether a held position resolved in or out of the money. 
 + 
 +===== Settlement Mechanics ===== 
 + 
 +==== How Settlement Works ==== 
 + 
 +At market expiration, T4 will evaluate the outcome and issue a closing order update for each open position. The message will always be: 
 + 
 +  * **Side** -- Opposite of your open position (long positions receive a sell; short positions receive a buy). 
 +  * **Price** -- Either **0** (lost) or **1** (won), expressed in the instrument's native price format. See [[developers:systempricing|System Price Format]]. 
 +  * **Order Type** -- ''[TBD -- settlement order type tag/value]'' 
 +  * **Quantity** -- Equal to your open position size. 
 + 
 +==== Outcome Matrix ==== 
 + 
 +^ Your Position ^ Settlement Price ^ Outcome ^ 
 +| Long           | 1                | Won -- event occurred | 
 +| Long           | 0                | Lost -- event did not occur | 
 +| Short          | 1                | Lost -- event occurred | 
 +| Short          | 0                | Won -- event did not occur | 
 + 
 +===== Identifying a Settlement Message ===== 
 + 
 +Your application should identify a settlement message by checking for the following combination of fields in an order update: 
 + 
 +  - The instrument is a prediction market type. See [[developers:websocket:markets|Market Data & Definitions]] for how to identify prediction market instruments. 
 +  - The order update represents a closing fill (opposite side of the open position). 
 +  - Price is exactly **0** or **1**. 
 +  - Order type is ''[TBD]''
 + 
 +<WRAP callout> 
 +**Note:** Settlement messages are generated by the platform and do not represent a resting order in the book. They will not appear in the order book feed and should be treated as system-generated close events. 
 +</WRAP> 
 + 
 +===== WebSocket API ===== 
 + 
 +Settlement is communicated via the standard order update message on the Trading API WebSocket feed. Subscribe to the account feed and watch for order updates matching the criteria above. 
 + 
 +For full message field definitions see [[developers:websocket:messages|Message Reference]] and [[developers:websocket:orders|Order Routing]]. 
 + 
 +==== Example: Won (Long Position, Settles at 1) ==== 
 + 
 +The following is an example order update received when a long position of 1 contract settles in the money. 
 + 
 +<code javascript> 
 +// [TBD -- WebSocket order update JSON/Protobuf example] 
 +// Fields to highlight: 
 +//   side:       Sell 
 +//   price:      1 
 +//   order_type: [TBD settlement type] 
 +//   qty:        1 
 +//   status:     [TBD] 
 +</code> 
 + 
 +==== Example: Lost (Long Position, Settles at 0) ==== 
 + 
 +<code javascript> 
 +// [TBD -- WebSocket order update JSON/Protobuf example] 
 +// Fields to highlight: 
 +//   side:       Sell 
 +//   price:      0 
 +//   order_type: [TBD settlement type] 
 +//   qty:        1 
 +//   status:     [TBD] 
 +</code> 
 + 
 +==== Example: Won (Short Position, Settles at 0) ==== 
 + 
 +<code javascript> 
 +// [TBD -- WebSocket order update JSON/Protobuf example] 
 +// Fields to highlight: 
 +//   side:       Buy 
 +//   price:      0 
 +//   order_type: [TBD settlement type] 
 +//   qty:        1 
 +//   status:     [TBD] 
 +</code> 
 + 
 +===== FIX API ===== 
 + 
 +Settlement is communicated via an **Execution Report (tag 35=8)** on the FIX session. The report will reflect the closing fill at the settlement price. 
 + 
 +For full FIX tag definitions see [[developers:fixapi:start|FIX API]]. 
 + 
 +==== Key FIX Tags ==== 
 + 
 +^ Tag ^ Field Name   ^ Settlement Value ^ 
 +| 35  | MsgType      | 8 (Execution Report) | 
 +| 39  | OrdStatus    | [TBD] | 
 +| 54  | Side         | Opposite of open position (1=Buy, 2=Sell) | 
 +| 44  | Price        | 0 or 1 | 
 +| 40  | OrdType      | [TBD -- settlement order type] | 
 +| 32  | LastQty      | Position size being closed | 
 +| 150 | ExecType     | [TBD] | 
 +| 55  | Symbol       | Prediction market instrument identifier | 
 + 
 +==== Example: Won (Long Position, Settles at 1) ==== 
 + 
 +<code> 
 +[TBD -- FIX Execution Report example message] 
 +8=FIX.4.2|35=8|49=[SenderCompID]|56=[TargetCompID]| 
 +54=2|44=1|40=[TBD]|32=1|39=[TBD]|150=[TBD]|55=[Symbol]|10=[checksum] 
 +</code> 
 + 
 +==== Example: Lost (Long Position, Settles at 0) ==== 
 + 
 +<code> 
 +[TBD -- FIX Execution Report example message] 
 +8=FIX.4.2|35=8|49=[SenderCompID]|56=[TargetCompID]| 
 +54=2|44=0|40=[TBD]|32=1|39=[TBD]|150=[TBD]|55=[Symbol]|10=[checksum] 
 +</code> 
 + 
 +==== Example: Won (Short Position, Settles at 0) ==== 
 + 
 +<code> 
 +[TBD -- FIX Execution Report example message] 
 +8=FIX.4.2|35=8|49=[SenderCompID]|56=[TargetCompID]| 
 +54=1|44=0|40=[TBD]|32=1|39=[TBD]|150=[TBD]|55=[Symbol]|10=[checksum] 
 +</code> 
 + 
 +===== P&L Calculation ===== 
 + 
 +Settlement P&L for a prediction market position is straightforward: 
 + 
 +  * **P&L per contract** = (Settlement Price - Entry Price) * Contract Multiplier * Quantity 
 +  * For a long at entry price 0.60 settling at 1: (1 - 0.60) * [multiplier] * qty = profit 
 +  * For a long at entry price 0.60 settling at 0: (0 - 0.60) * [multiplier] * qty = loss 
 + 
 +<WRAP callout> 
 +**Note:** Confirm the contract multiplier for each prediction market instrument via the [[developers:markets|Instruments API]]. 
 +</WRAP> 
 + 
  • developers/predictionmarkets.1777491930.txt.gz
  • Last modified: 2026/04/29 19:45
  • by chad