Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| developers:predictionmarkets [2026/05/18 17:33] – [Example: Lost (Long Position, Settles at 0)] chris | developers:predictionmarkets [2026/10/20 13:03] (current) – chad | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== THIS PAGE IS UNDER CONSTRUCTION ====== | ||
| - | |||
| - | |||
| - | |||
| ====== Prediction Markets ====== | ====== Prediction Markets ====== | ||
| Line 24: | Line 20: | ||
| * **Side** -- Opposite of your open position (long positions receive a sell; short positions receive a buy). | * **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' | * **Price** -- Either **0** (lost) or **1** (won), expressed in the instrument' | ||
| - | * **Order Type** -- '' | + | * **Order Type** -- Options Settlement. FIX: '' |
| * **Quantity** -- Equal to your open position size. | * **Quantity** -- Equal to your open position size. | ||
| Line 42: | Line 38: | ||
| - The order update represents a closing fill (opposite side of the open position). | - The order update represents a closing fill (opposite side of the open position). | ||
| - Price is exactly **0** or **1**. | - Price is exactly **0** or **1**. | ||
| - | - Order type is '' | + | - Order type is Options Settlement (FIX '' |
| <WRAP callout> | <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. | **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. | ||
| </ | </ | ||
| - | |||
| - | ===== 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: | ||
| - | |||
| - | ==== 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/ | ||
| - | // Fields to highlight: | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | </ | ||
| - | |||
| - | ==== Example: Lost (Long Position, Settles at 0) ==== | ||
| - | |||
| - | <code javascript> | ||
| - | // [TBD -- WebSocket order update JSON/ | ||
| - | // Fields to highlight: | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | </ | ||
| - | |||
| - | ==== Example: Won (Short Position, Settles at 0) ==== | ||
| - | |||
| - | <code javascript> | ||
| - | // [TBD -- WebSocket order update JSON/ | ||
| - | // Fields to highlight: | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | // | ||
| - | </ | ||
| ===== FIX API ===== | ===== FIX API ===== | ||
| Line 100: | Line 52: | ||
| ==== Key FIX Tags ==== | ==== Key FIX Tags ==== | ||
| - | ^ Tag ^ Field Name | + | ^ Tag ^ Field Name ^ Settlement Value ^ |
| - | | 35 | MsgType | + | | 1 | Account |
| - | | 39 | OrdStatus | + | | 8 | BeginString |
| - | | 54 | Side | + | | 9 | BodyLength |
| - | | 44 | + | | 10 | CheckSum |
| - | | 40 | + | | 11 | ClOrdID |
| - | | 32 | + | | 14 | CumQty |
| - | | 150 | ExecType | + | | 17 | ExecID |
| - | | 55 | + | | 21 | HandlInst |
| + | | 31 | LastPx | ||
| + | | 32 | LastQty | ||
| + | | 34 | MsgSeqNum | ||
| + | | 35 | MsgType | ||
| + | | 37 | OrderID | ||
| + | | 38 | OrderQty | ||
| + | | 39 | OrdStatus | ||
| + | | 40 | OrdType | ||
| + | | 44 | Price | Settlement price: 0 or 1 | | ||
| + | | 48 | SecurityID | ||
| + | | 49 | SenderCompID | ||
| + | | 50 | SenderSubID | ||
| + | | 52 | SendingTime | ||
| + | | 54 | Side | ||
| + | | 55 | ||
| + | | 56 | ||
| + | | 59 | TimeInForce | ||
| + | | 60 | ||
| + | | 97 | ||
| + | | 107 | SecurityDesc | ||
| + | | 151 | LeavesQty | ||
| + | | 167 | SecurityType | ||
| + | | 200 | MaturityMonthYear | ||
| + | | 201 | PutOrCall | ||
| + | | 204 | CustOrderCapacity | ||
| + | | 207 | SecurityExchange | ||
| + | | 447 | PartyIDSource | ||
| + | | 448 | PartyID | ||
| + | | 452 | PartyRole | ||
| + | | 453 | NoPartyIDs | ||
| ==== Example: Won (Long Position, Settles at 1) ==== | ==== Example: Won (Long Position, Settles at 1) ==== | ||
| < | < | ||
| - | [TBD -- FIX Execution Report example message] | + | << 8 : 1=ExampleAccount| |
| - | 8=FIX.4.2|35=8|49=[SenderCompID]|56=[TargetCompID]| | + | [9=451|35=8] EXECUTION: Market **SELL 1@1** | Order=CB7ED23B-1D2F-4652-BE77-DF16DB3ED854 | Filled=1/ |
| - | 54=2|44=1|40=[TBD]|32=1|39=[TBD]|150=[TBD]|55=[Symbol]|10=[checksum] | + | |
| </ | </ | ||
| Line 121: | Line 103: | ||
| < | < | ||
| - | << 8 : 1=ExampleAccount018=FIX.4.29=45110=24711=D22EB472-F0B2-49CC-9E69-0EB4F8B2310114=117=D22EB472-F0B2-49CC-9E69-0EB4F8B23101_0_T21=131=032=134=6835=837=D22EB472-F0B2-49CC-9E69-0EB4F8B2310138=139=248=XKLSH_POp KXBTC15M-26MAY181300-0049=test50=T4FIX52=20260518-17:00:26.60754=255=KXBTC15M56=TradeBook59=060=20260518-17:00:26.60697=Y107=BTC price up in next 15 mins?150=F151=0167=OPT200=202605201=1204=0207=KLSH_POp447=D448=Administrator452=44453=1 | + | << 8 : 1=ExampleAccount| 8=FIX.4.2 | 9=451 | 10=180 | 11=CB7ED23B-1D2F-4652-BE77-DF16DB3ED854 | 14=1 | 17=CB7ED23B-1D2F-4652-BE77-DF16DB3ED854_0_T | 21=1 | 31=0 | 32=1 | 34=70 | 35=8 | 37=CB7ED23B-1D2F-4652-BE77-DF16DB3ED854 | 38=1 | 39=2 | 40=S | 44=0 | 48=Contract Ticker | 49=test | 50=T4FIX | 52=20260827-15:15:45.148 | 54=2 | 55=Market | 56=TradeBook | 59=0 | 60=20260827-15:15:45.147 | 97=Y | 107=Example Contract Name | 150=F | 151=0 | 167=OPT | 200=202608 | 201=1 | 204=0 | 207=Exchange Name | 447=D | 448=Administrator | 452=44 | 453=1 | |
| - | [9=451|35=8] EXECUTION: | + | [9=451|35=8] EXECUTION: |
| </ | </ | ||
| Line 128: | Line 110: | ||
| < | < | ||
| - | [TBD -- FIX Execution Report example message] | + | << 8 : 1=ExampleAccount| |
| - | 8=FIX.4.2|35=8|49=[SenderCompID]|56=[TargetCompID]| | + | [9=451|35=8] EXECUTION: Market **BUY 1@0** | Order=CB7ED23B-1D2F-4652-BE77-DF16DB3ED854 | Filled=1/ |
| - | 54=1|44=0|40=[TBD]|32=1|39=[TBD]|150=[TBD]|55=[Symbol]|10=[checksum] | + | |
| </ | </ | ||