Skip to main content

Overview

Price-triggered orders activate when the fair/mark price reaches a specified threshold, not when the last traded price does. Stop, Take-Profit, Range, and Trailing orders generate reduce-only exits. A general Trigger can submit supported actions that open or reduce positions. On-Fill actions activate on a parent execution rather than a price threshold.

Stop Order

Triggers when the mark price moves against your position. Used for stop-loss protection.
  • Trigger direction: Below for longs, above for shorts
  • On trigger: Submits a reduce-only market order (if no limit price set) or a reduce-only GTC limit order at the specified limit price
  • Reduce-only: Always. Cannot open new positions.
Triggering does not guarantee a full exit. Market exits remain subject to liquidity, risk checks, and a slippage bound relative to fair price. Stop and Trailing exits use the configured stop-slippage default; Take-Profit exits use the configured market-slippage default. An explicit slippage overrides the applicable default; Range uses independent slSlippage and tpSlippage overrides. Limit exits use their specified limit and can remain unfilled.

Take-Profit Order

Triggers when the mark price moves in favor of your position. Used to lock in gains.
  • Trigger direction: Above for longs, below for shorts
  • On trigger: Same as Stop, either market or limit depending on whether a limit price is specified

Range Order

A two-leg conditional that places both a stop and a take-profit simultaneously with a single action. Internally creates two linked orders (OCO).
  • Long position: Lower trigger is stop-loss; upper trigger is take-profit
  • Short position: Lower trigger is take-profit; upper trigger is stop-loss
  • Each leg can have an optional limit price
  • When one leg triggers, the other is automatically cancelled (One-Cancels-Other)

Trigger Order

A general-purpose conditional that holds a set of supported actions. When the mark price reaches the trigger threshold, its embedded actions are queued as a transaction for admission on the following tick, with any applicable taker delay. They do not execute immediately as part of the trigger event.
  • Trigger direction: Above (fires when price is at or above threshold) or Below (fires when price is at or below threshold)
  • Actions: Supported nested order and cancellation actions, subject to validation and authorization
  • More flexible than Stop/TP since it is not restricted to reduce-only or a single instrument

Trailing Stop

A stop order that follows the market price. As the market moves in your favor, the stop level adjusts automatically. When the market reverses by the specified trail amount, the stop triggers.
  • trail_bps: Distance in basis points from the current price
  • step_bps: Minimum price movement before the trail resets
  • Internally implemented as a Stop order with a companion Trigger sentinel that resets the stop level on each step

On-Fill Orders

An On-Fill action attaches follow-up actions to a parent market or limit order. The follow-ups activate once, on the parent’s first fill, and can place Stop/TP orders or other supported orders and cancellations.
  • Before parent fills: The On-Fill children are dormant, not on the conditional book
  • First fill, including a partial fill: Follow-ups are queued once as a transaction for admission on the following tick, with any applicable taker delay
  • Parent cancelled before any fill: Its dormant follow-ups are removed
  • Later fills: Do not activate the same follow-ups again
  • Parent cancelled after a fill: Does not retract follow-ups already queued
  • Follow-up sizes remain as submitted; they are not automatically resized to the parent’s filled quantity. Reduce-only exits are limited by the position available when they execute.
Queued Trigger and On-Fill transactions are persisted in snapshots, separately from dormant registrations and orders already placed on the conditional book. Queueing a follow-up is not confirmation that it executed or that protection is already active.

Conditional Book

Price-triggered orders wait on a separate trigger book, not the main order book. Dormant On-Fill follow-ups are registrations, not orders on this book. The trigger book maintains two sorted maps:
  • Above book: Orders that fire when price reaches or exceeds the threshold
  • Below book: Orders that fire when price reaches or falls below the threshold
Each tick, the executor checks the current fair price against the book and drains all triggered levels in a single pass. OCO partners are cancelled after the drain. OCO cancellation follows trigger activation, not a successful fill. If execution fails or cannot fill the exit, the cancelled sibling is not automatically rearmed. Monitor order updates and the remaining position.

Parameters

Example: Limit Entry with TP/SL

Place a limit buy with attached take-profit and stop-loss using On-Fill:
  1. Submit a limit buy for 1 BTC at 95,000
  2. Attach a Range action as the On-Fill follow-up for the long position
  3. Set its upper take-profit trigger to 105,000 (market) and lower stop-loss trigger to 90,000 with limit 89,500
The entry’s first fill queues the Range follow-up. Once that follow-up executes, it places the linked TP/SL pair. If the mark reaches 105,000 first, the TP triggers and the SL is cancelled via OCO. Two separately submitted Stop and Take-Profit actions are not automatically an OCO pair.

API Reference

For full request/response examples and implementation details, see: