Skip to content

Order types

STX supports two order types: limit and market. The type is set via the order_type field when calling POST /api/v1/orders.


A limit order specifies the worst price you are willing to accept:

  • Buy limit: sets a price ceiling. You will pay no more than your limit price per contract. The exchange fills you at the best available price up to your limit.
  • Sell limit: sets a price floor. You will receive no less than your limit price per contract.

If the full quantity cannot be filled at the limit price or better, the unfilled remainder is placed in the order book and waits for a matching counterparty. It stays there until fully filled or explicitly cancelled.

Use a limit order to name your price. If you want an order to rest on the book and have others trade against it, it must be a limit order.

Set fill_mode to post_only on a limit order to make sure it only ever rests on the book. A post-only order never takes liquidity:

  • If it would match an order already on the book when it arrives, the exchange cancels it instead. The response carries the order with status cancelled and cancellation_reason auto_matching; nothing is filled.
  • If the first order it would match is one of your own, it is rejected as a self-match (match_with_self), as any order of yours would be.
  • Otherwise it rests on the book like any limit order. Every later fill has it as the maker.

A market that has not opened yet decides this when the order is placed, the same way. Post-only is not available on market orders or on combination markets.

Set fill_mode to fill_or_kill on a limit order to fill all of it at once or none of it. A fill-or-kill order never rests on the book:

  • If the orders on the book at your limit price or better can fill its full quantity when it arrives, it fills in full, across as many of them as it takes.
  • Otherwise the exchange cancels it whole: status cancelled, cancellation_reason auto_matching, nothing filled. None of the orders it could have matched is traded, and the book is left as it was.

The response to POST /api/v1/orders carries the order accepted, or delayed during the in-play delay (below), as for any order: it is matched after the response. Its outcome, filled, cancelled or rejected, arrives on the orders channel, or from GET /api/v1/orders/{id} once stored. Rejections that apply to any order, such as a self-match (match_with_self) or the market’s liability limit (market_liability_limit), apply to it too, ahead of the fill-or-kill rule: it is then rejected, with nothing filled.

During the in-play delay a fill-or-kill order that would match waits delayed, then fills in full or is cancelled against the book as it stands when it leaves the queue, or is rejected then as above. A market that has not opened yet rejects it (wrong_market_state): nothing can fill before the open. Fill-or-kill is not available on market orders or on combination markets.

STX turns post-only and fill-or-kill on per exchange. GET /api_version on the exchange’s host (no signature needed) lists the modes it accepts in features:

{
"api_version": "3.4.25",
"features": ["order_post_only", "order_fill_or_kill"]
}
features contains Then
order_post_only fill_mode post_only is accepted.
order_fill_or_kill fill_mode fill_or_kill is accepted.
Not the mode you want That mode is not enabled there. Do not send it.

A market order does not constrain the price:

  • Buy market: buys at the best available offer price, sweeping through the book until filled or no more contracts are available.
  • Sell market: sells at the best available bid, sweeping downward.

Any quantity that cannot be filled immediately is cancelled; market orders never rest in the book. They are used to take existing liquidity, not to provide it.


See Place an order for the request, response and a runnable curl.

Prices are dollar amounts sent as strings, with at most two decimal places: "0.45" means $0.45.


Single cancel:

See Cancel an order for the request, response and a runnable curl.

Batch cancel:

See Cancel several orders for the request, response and a runnable curl.

Cancel all open orders on your account:

See Cancel all open orders for the request, response and a runnable curl.

A cancel is also a request: by the time it reaches the engine the order may already be fully filled. The response per order tells you the actual status after the attempt.


If your integration relies on continuous connectivity to manage order risk, you can instruct the server to cancel your open orders automatically if your WebSocket connection drops. See cancel_on_disconnect.

STX is operated by XV Exchange, LLC, a Designated Contract Market regulated by the U.S. Commodity Futures Trading Commission (CFTC). Contracts traded on STX are cleared by XV Clearing, LLC, a CFTC-registered Derivatives Clearing Organization. Trading involves substantial risk of loss and may not be appropriate for everyone. Members risk losing the cost to enter any transaction, including fees. Consider whether trading is appropriate for you in light of your experience and financial resources. Nothing on this site is investment advice or a recommendation to trade. Past performance is not indicative of future results.

© 2026 STX. All rights reserved.llms.txtllms-full.txtView as Markdown
Docs version v1.10.5