TypeScript SDK — Predictions: Order Management
Place, cancel, and query prediction market orders. All methods are on client.predictions. Every order method requires authentication. See the errors guide for error handling patterns.
placeOrder
POST /v1/prediction-markets/order · Authenticated
Place a single prediction market order. This is a POST mutation — never automatically retried. This method performs two pre-flight checks before sending the request to the server:
- Client-side validation — The request body is validated client-side. Invalid fields throw a
ValidationErrorwithout making a network call. - Terms acceptance check — The SDK calls
getPredictionMarketsTermsStatus()to verify you've accepted the latest prediction markets terms. If not, it throwsAcceptTermsRequiredinstead of sending the order.
Code
Validated fields:
| Field | Rule | Required |
|---|---|---|
symbol | string | Yes |
orderType | "limit" or "stop-limit" | Yes |
side | "buy" or "sell" | Yes |
quantity | decimal string | Yes |
price | decimal string, 0–1 | Yes |
outcome | "yes" or "no" | Yes |
stopPrice | decimal string, 0–1 | Required if orderType is "stop-limit" |
timeInForce | "good-til-cancel", "immediate-or-cancel", "fill-or-kill" | No |
makerOrCancel | boolean | Yes |
Caveat —
priceandquantitymust be decimal strings, not numbers.priceandstopPricemust be between 0 and 1 inclusive.
See the patterns guide for the recommended terms-acceptance flow.
placeOrderBatch
POST /v1/prediction-markets/order/batch · Authenticated
Place up to 20 orders in a single request. This is a POST mutation — never automatically retried. Like placeOrder, this method validates each order client-side and checks terms acceptance before sending. The request body is validated client-side.
Code
Validated — The
ordersarray must contain 1–20 items. Each order is validated with the same rules asplaceOrder.
cancelOrder
POST /v1/prediction-markets/order/cancel · Authenticated
Cancel a single active order by its ID. This is a POST mutation — never automatically retried. The orderId is validated client-side as a non-negative integer identifier (number, bigint, or numeric string).
Code
cancelOrderBatch
POST /v1/prediction-markets/order/batch/cancel · Authenticated
Cancel up to 20 orders in a single request. This is a POST mutation — never automatically retried. Each order ID is validated client-side.
Code
Validated —
orderIdsmust contain 1–20 non-negative order identifiers.
Tip — The response
orderIdfields are returned asbigint. See Data Types for int64 handling.
getActiveOrders
POST /v1/prediction-markets/orders/active · Authenticated
Retrieve your currently active (open) prediction market orders. This is a POST mutation — never automatically retried. The body is optional — omit it to get all active orders. Returns an OrdersResponse with an .orders array.
Code
Tip — The filter field is
symbol(contract instrument symbol), noteventTicker. ResponseorderIdvalues arebigint. See Data Types.
getOrderHistory
POST /v1/prediction-markets/orders/history · Authenticated
Retrieve your historical prediction market orders. This is a POST mutation — never automatically retried. The body is optional — omit it for the default history window. Returns an OrdersResponse with an .orders array.
Code
Tip — The
fromandtofields acceptbiginttimestamps (epoch milliseconds). ResponseorderIdvalues arebigint.
What's next
- Events & Discovery — browse and search prediction market events
- Positions & Terms — open and settled positions, terms acceptance
- Combos — multi-leg combo instruments
- Request Validation — how client-side validation works
- Error Handling — error types and metadata