Skip to main content

Overview

  • TP/SL: Attach Take Profit and/or Stop Loss settings to an entry order using the tpsl object.
  • Modes:
    • Full: Configures TP/SL in full mode.
    • Partial: Configures TP/SL in partial mode.
  • TP/SL order types: take_profit and stop_loss support market or limit configurations.
  • Trigger: Conditional orders use a trigger object with:
    • trigger_by: "LastPrice", "IndexPrice", or "MarkPrice".
    • trigger_direction: "Up" or "Down".
    • trigger_price: The price level that activates the order.
  • Reduce-only: Use reduce_only: true to prevent an order from increasing position exposure.

Request shape (POST /api/v1/order/place)

{
  "sub_account_address": "0x6160e0768af12ec30112972801aaa8287b42f15a2485ef68cd184a3eeec9dc49",
  "symbol": "CC-USDCx",
  "side": "Buy",
  "order_type": "Market",
  "qty": "8.32089394",
  "price": "0",
  "margin_mode": "Cross",
  "time_in_force": "IOC",
  "post_only": false,
  "reduce_only": false,
  "close_on_trigger": false,
  "tpsl": {
    "mode": "Full",
    "take_profit": {
      "market": {
        "trigger_price": "0.151785799",
        "trigger_by": "LastPrice"
      }
    },
    "stop_loss": {
      "market": {
        "trigger_price": "0.124188381",
        "trigger_by": "LastPrice"
      }
    }
  }
}

Behavior details

  • Conditional orders
    • The trigger object defines the price source (trigger_by), trigger direction (trigger_direction), and activation price (trigger_price).
  • Full mode
    • Configured using tpsl.mode: "Full".
    • Take Profit and Stop Loss settings are defined through take_profit and stop_loss.
  • Partial mode
    • Configured using tpsl.mode: "Partial".
    • Take Profit and Stop Loss settings are defined through take_profit and stop_loss.
  • TP/SL triggers
    • Take Profit and Stop Loss configurations specify their trigger settings within the selected market or limit configuration.
  • Reduce-only
    • Use reduce_only: true to prevent an order from increasing position exposure.