Order Types
PMX supports two order types, each with different matching behavior.
Limit Orders
A limit order rests in the orderbook at your specified price until it is filled, cancelled, or expires. If a matching counterparty exists at submission time, the order fills immediately (partially or fully) — any unfilled remainder stays in the book.
| Field | Value |
|---|
orderType | "limit" |
priceBps | 1–9,999 (your limit price) |
Default timeInForce | gtc |
When to use: You want a specific price and are willing to wait for it.
{
"orderMessage": { ... },
"signature": "...",
"orderType": "limit",
"timeInForce": "gtc"
}
Market Orders
A market order fills immediately at the best available prices in the book. Any unfilled remainder is automatically cancelled — market orders never rest in the book.
| Field | Value |
|---|
orderType | "market" |
priceBps | 1–10,000 (worst-case slippage limit) |
timeInForce | Always ioc (forced by the engine) |
When to use: You want immediate execution and accept the current market price.
{
"orderMessage": { ... },
"signature": "...",
"orderType": "market"
}
Market orders use priceBps as a slippage limit, not a target price. Set it to the maximum price you’re willing to pay (for buys) or minimum you’ll accept (for sells). A priceBps of 10000 means no slippage protection.
Time-in-Force Policies
Time-in-force controls what happens to unfilled quantity after matching.
GTC — Good-Til-Cancelled
The default for limit orders. The order stays in the book until fully filled, manually cancelled, or it reaches its expiry timestamp.
- Counts toward your open order limits (100 per market, 500 global)
- Must have an
expiry within 30 days
- Cancelled orders emit an
order:cancelled event on the user WebSocket channel
Fills as much as possible immediately, then cancels any remaining quantity. The order never rests in the book.
- Does not count toward open order limits (since it never rests)
- The response will show
status: "filled" or status: "cancelled" (partial fill + auto-cancel)
- All market orders are internally treated as IOC
FOK — Fill-Or-Kill
Must be filled entirely in a single match, or the entire order is rejected. Nothing partial.
- The engine checks book depth before matching. If the book can’t fill the full quantity, the order is rejected with
FOK_NOT_FILLABLE
- Useful when you need an exact quantity and can’t accept partials
Matching Behavior
The PMX matching engine supports three types of fills:
| Fill Type | How It Works |
|---|
| Direct | A buy YES order matches against a sell YES order (same outcome, opposite sides) |
| Complementary | A buy YES order matches against a buy NO order when yesPriceBps + noPriceBps >= 10000. The vault mints both outcome tokens |
| Sell Complementary | A sell YES order matches against a sell NO order. Both sellers’ tokens are burned and USDC is returned from the vault |
All three fill types can happen on a single order. For example, a large buy YES order might first match direct sellers, then match complementary NO buyers to fill the remaining quantity.
Order Limits
| Limit | Value |
|---|
| Max open orders per market | 100 |
| Max open orders globally | 500 |
| Min quantity | 1,000,000 (1 token) |
| Min notional value | 10,000 ($0.01) |
| Max expiry | 30 days from now |
IOC and FOK orders do not count toward open order limits since they never rest in the book.
Order Statuses
| Status | Meaning |
|---|
open | Resting in the book, waiting for a match |
partially_filled | Some quantity has been matched; remainder still in book |
filled | Fully matched — no remaining quantity |
cancelled | Cancelled by user, expired, or IOC remainder cancelled |
settling | Temporarily locked during on-chain settlement |
The status lifecycle is: open → partially_filled (optional) → filled or cancelled.