Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Order types

Parcl V4 supports four order types and three time-in-force options.

Order types

Market

Fills immediately at the best available price in the orderbook. Use price: 0 in the transaction. If the book is empty or has insufficient depth, the order fills partially or not at all depending on the time-in-force setting.

Best for: entering or exiting a position quickly when you care more about execution than price.

Limit

Rests on the orderbook at your specified price. Fills when the other side crosses your price. If the price is already crossable at submission time, it fills immediately (unless post_only is set).

Best for: getting a specific price. Limit orders that rest on the book pay the maker fee (which may be a rebate).

Stop market

A market order that activates when the trigger price is reached. Does nothing until triggered, then executes as a market order.

  • Long stop market: triggers when price rises to or above trigger_price
  • Short stop market: triggers when price falls to or below trigger_price

The reference price used to evaluate the trigger depends on the market's asset class:

  • Real estate: trigger evaluated against the oracle price. Your stop fires only when the oracle updates (daily at 9:05 AM ET), not when the orderbook moves intraday. This prevents stop-hunting on thin orderbooks.
  • Commodities: trigger evaluated against the median mark (median of oracle, impact mid, last trade). Your stop fires when the chain's real-time fair price crosses your trigger, with single-source manipulation rejected by the median property. This matches what you see on the chart.

The same reference rules apply to liquidations on each asset class — triggers and liquidations stay in sync. See Mark price for the full mechanics.

Stop limit

Same as stop market, but places a limit order at price instead of a market order when triggered. Gives you price control after the trigger fires, but risks not filling if the market moves past your limit.

Time-in-force

Controls what happens to unfilled portions of your order.

GTC (good til canceled)

The default. Unfilled portion rests on the orderbook until you cancel it. Use for limit orders you want to leave open.

IOC (immediate or cancel)

Fills whatever is available immediately, then cancels the rest. Use for market orders or when you want partial fills but don't want an open order.

FOK (fill or kill)

Fills entirely or not at all. If the full size can't be matched immediately, the entire order is rejected. Use when partial fills aren't acceptable.

Order options

reduce_only

If true, the order can only reduce an existing position. It won't open a new position or increase one. Useful for stop-loss orders where you don't want accidental position increases if you've already closed manually.

post_only

If true, the order is rejected if it would fill immediately (i.e., cross the spread). Guarantees your order rests on the book as a maker order. Use when you specifically want maker fees/rebates.

Attached TP/SL

You can attach take-profit and stop-loss orders when placing the initial order. These are created as conditional orders that activate after the parent order fills.

{
  "PlaceOrder": {
    "account_id": 12,
    "market_id": 0,
    "side": "Long",
    "order_type": "Market",
    "price": 0,
    "size": 1000000,
    "trigger_price": null,
    "reduce_only": false,
    "post_only": false,
    "time_in_force": "IOC",
    "take_profit": {
      "trigger_price": 60000000000,
      "order_type": "Market",
      "limit_price": null
    },
    "stop_loss": {
      "trigger_price": 55000000000,
      "order_type": "Market",
      "limit_price": null
    }
  }
}

Both take_profit and stop_loss are optional. Set order_type to "Limit" and provide a limit_price if you want price control on the exit.

Self-trade prevention

An incoming order can never match against one of your own resting orders on the same account. When this would happen, the resting order is canceled and matching continues through the next best price level.

How it works

Before matching any two orders, the engine checks whether the maker and taker belong to the same account_id. If they do, the maker order is removed from the book with CancelReason: SelfTradePrevention, and the taker continues matching against the next best order.

The taker order is not affected by the self-match. It fills normally against everything else on the book, up to its size or price limit.

When it fires

Self-trade prevention runs in every matching path:

  • Market orders crossing the book
  • Limit orders that cross on submission
  • Stop market and stop limit orders when triggered

Events

When a resting order is canceled by self-trade prevention, the exchange emits an OrderCanceled event with reason: "SelfTradePrevention". The event surfaces in WebSocket orders subscriptions and in the events array returned from POST /tx/sign-and-submit.

Example

You have a limit sell resting at $100 on NYC. You submit a market buy for the same market and same account. Before your buy matches your sell:

  1. The engine detects both orders share account_id.
  2. Your limit sell is canceled with SelfTradePrevention.
  3. Your market buy matches the next best ask above $100.

You receive two events: OrderCanceled (your sell) and OrderFilled (your buy, against whoever's next in the book).

FOK and self-trade makers

Fill-or-kill orders are evaluated for fillability before any matching happens. If your own resting orders sit between the taker and the required liquidity, FOK skips them when computing whether the order can fill. Your own orders are treated as not being on the book for the purpose of the all-or-nothing check.

This means an FOK taker can still fill if there is enough non-self liquidity after excluding your own makers.