Order commands
Byte-level encoding of Time Seventeen order commands — new order, cancel, amend, cancel all and withdrawal request — carried in signed frames.
A command body is the first field of every signed frame. All integers are little-endian.
New order (tag 10) — 64 bytes
| Offset | Field | Type | Value |
|---|---|---|---|
| 0 | tag | u8 | 10 |
| 1 | id | u64 | account × 2^32 + local |
| 9 | account | u32 | your account |
| 13 | market | u32 | market id |
| 17 | flags | u8 | bit 0 NO outcome · bit 1 sell · bit 2 post-only · bit 3 reduce-only |
| 18 | kind | u8 | 0 limit · 1 market · 2 market-to-limit · 3 stop · 4 stop-limit · 5 trailing stop · 6 pegged |
| 19 | trigger / trail / peg reference | u32 | 0 for limit |
| 23 | peg offset | i32 | 0 for limit |
| 27 | time in force | u8 | 0 GTC · 1 IOC · 2 FOK · 3 GFD · 4 GTD |
| 28 | GTD expiry | u64 | Unix ms for GTD, else 0 |
| 36 | price | u32 | ticks, own outcome |
| 40 | qty | u64 | contracts |
| 48 | display qty | u64 | 0 = all visible (iceberg otherwise) |
| 56 | OCO sibling | u64 | order id or 0 |
Start with limit orders
The web terminal and the quickstart send kind 0 (limit) only: a market order is a limit order at the touch plus your slippage, with IOC. The other kinds are executed by the engine and available over FIX; their REST use is supported but less tested.
Cancel (tag 11) — 13 bytes
tag u8 = 11 · account u32 · id u64
Amend (tag 12) — 25 bytes
tag u8 = 12 · account u32 · id u64 · price u32 · qty u64
qty is the new remaining quantity. Lowering it at the same price keeps time priority; any price change re-queues the order.
Cancel all (tag 13) — 13 bytes
tag u8 = 13 · account u32 · market u64 — market 0 cancels in every market, otherwise market id + 1.
Withdrawal request (tag 21) — 21 bytes
tag u8 = 21 · account u32 · id u64 · amount u64 (ticks)
Moves free cash into a pending withdrawal that the operator pays out (testnet: no real payout).
Example
Buy 10 YES in market 3 at 42 ticks, GTC, account 7, local id 1 (from the test vectors):
0a 0100000007000000 07000000 03000000 00 00 00000000 00000000 00 0000000000000000
2a000000 0a00000000000000 0000000000000000 0000000000000000