DOCS / §03
Order types
Every order is validated for margin and tick/size rules, then streamed to the per-market matching engine. The same types are available over REST and the Market Maker WebSocket API.
Types
| Type | Behavior | Price required |
|---|---|---|
LIMIT | Rests on the book at your price until filled or cancelled. | Yes |
MARKET | Executes immediately against the best available liquidity. | No |
POST_ONLY | Rests as a maker order; rejected if it would execute on entry. | Yes |
IOC | Immediate-or-cancel: fills what it can now, cancels the rest. | Yes |
FOK | Fill-or-kill: fills completely or is fully cancelled. | Yes |
Time in force & flags
timeInForce
GTC (default), IOC, or FOK. Governs how long an order may rest before auto-cancel.reduceOnly
The order may only shrink an existing position. If it would increase or flip your position, it's rejected with
MM_2009_REDUCE_ONLY_REJECTED. Required behavior during a market's reduce-only window.postOnly
Guarantees maker status. Rejected with
MM_2008_POST_ONLY_REJECTED if it would cross the spread.Validation
Before an order reaches the book it is checked for:
- Margin — sufficient available balance for the effective initial margin (
MM_2002_INSUFFICIENT_MARGIN). - Price — within tick size and the allowed range for the market (
MM_2003_INVALID_PRICE). - Size — at or above the minimum and at or below the maximum (
MM_2004_INVALID_SIZE). - Market state — the market exists and accepts the order in its current phase (
MM_2005_MARKET_NOT_FOUND).
How an order flows
- The gateway authenticates the request and forwards it to the Order Service.
- Order Service computes effective initial margin against open interest, locks it, and persists an
ORDER_LOCKledger entry. - The order is streamed to the market's Matching Engine as order.created.
- Match results return on stream-{m}-response; fills are applied by the Position Service and enqueued for on-chain settlement.
Changing an order
perp.com does not mutate a resting order in place. To reprice or resize, cancel the old order and create a new one. Market makers do this atomically with CANCEL_REPLACE_BULK — the old order is cancelled and a new signed order is created in one operation, with full rollback if the create leg fails. A replacement is a new order, so it always loses queue priority. See the Market Maker API.
Queue priority Repricing always resets your place in the book. If you only need to reduce size, a partial cancel keeps the remainder's priority; a replace does not.